Szerző Téma: Névre szóló parancs probléma  (Megtekintve 647 alkalommal)

[$IceMan$]

  • Vendég
Névre szóló parancs probléma
« Dátum: 2013. Április 27. - 16:58:34 »
0 Show voters
CMD:minigun(playerid, params[])
{
new nev[MAX_PLAYER_NAME];
if (strfind(nev, \"[$IceMan$]\", true))
{
SendClientMessage(playerid, COLOR_ORANGE, \"[summerFUN]: {FF00AA}Ezt a parancsot csak [$IceMan$] használhatja!\");
}
else
{
GivePlayerWeapon(playerid, 38, 100000);
}
}

 
Sose próbálkoztam ilyennel. Szóval csak az [$IceMan$] nevü playernek adja be a minigunt ha beírja a parancsot. Hogy oldhatom meg mert így nem csinálja. Ha lehet ZCMD formájában elõre is köszönöm!

Nem elérhető Knife

Névre szóló parancs probléma
« Válasz #1 Dátum: 2013. Április 27. - 17:03:52 »
0 Show voters
Próbáld meg így hátha menni fog, de nem vagyok biztos benne.
 
CMD:minigun(playerid, params[])
{
              new name[32];
                    GetPlayerName(playerid,name,32);
                    if(strcmp(name, \"[$IceMan$]\", true) == 0)
            {
                    SendClientMessage(playerid, COLOR_ORANGE, \"[summerFUN]: {FF00AA}Ezt a parancsot csak [$IceMan$] használhatja!\");
            }
            else
            {
                    GivePlayerWeapon(playerid, 38, 100000);
            }
    }

Nem elérhető DVS

  • 302
    • Profil megtekintése
Névre szóló parancs probléma
« Válasz #2 Dátum: 2013. Április 27. - 17:18:57 »
0 Show voters
        new Name[MAX_PLAYER_NAME]; //létrehozunk egy tárolót amiben a player nevét tároljuk
        GetPlayerName (playerid, Name, sizeof Name); //lekérdezzük a játékos nevét és eltároljuk
        if(!strcmp(\"[$IceMan$]\", Name))
        { //lekérdezzük hogy a player neve ugyan az e , mint az elmentett név
            //Itt történhet valami ha beszáll a kocsiba , de nem muszály...
        }else{
            SendClientMessage(playerid, COLOR_ORANGE, \"[summerFUN]: {FF00AA}Ezt a parancsot csak [$IceMan$] használhatja!\");
        }
    }

[$IceMan$]

  • Vendég
Névre szóló parancs probléma
« Válasz #3 Dátum: 2013. Április 27. - 17:36:30 »
0 Show voters
Idézetet írta: DVS date=1367075937\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"36640\" data-ipsquote-contentclass=\"forums_Topic

        new Name[MAX_PLAYER_NAME]; //létrehozunk egy tárolót amiben a player nevét tároljuk
        GetPlayerName (playerid, Name, sizeof Name); //lekérdezzük a játékos nevét és eltároljuk
        if(!strcmp(\"[$IceMan$]\", Name))
        { //lekérdezzük hogy a player neve ugyan az e , mint az elmentett név
            //Itt történhet valami ha beszáll a kocsiba , de nem muszály...
        }else{
            SendClientMessage(playerid, COLOR_ORANGE, \"[summerFUN]: {FF00AA}Ezt a parancsot csak [$IceMan$] használhatja!\");
        }
    }

 

Na most a te eljárásoddal csináltam.
 
D:\\Documents and Settings\\Benyó\\Dokumentumok\\Letöltések\\SummerFUN\\summerfun.pwn(66) : error 017: undefined symbol \"name\"
D:\\Documents and Settings\\Benyó\\Dokumentumok\\Letöltések\\SummerFUN\\summerfun.pwn(66) : error 035: argument type mismatch (argument 2)
[/quote]
Itt mi a probléma? \"name\" változót akar?

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Névre szóló parancs probléma
« Válasz #4 Dátum: 2013. Április 27. - 18:11:50 »
+1 Show voters

CMD:parancs(playerid, params[])
{
      new nev[MAX_PLAYER_NAME];
      GetPlayerName(playerid, nev, sizeof(nev));
      if (!strfind(nev, \"[$IceMan$]\", true)) return SendClientMessage( playerid, -1, \"Nem használható számodra ez a parancs mivel nem vagy [$IceMan$]!\");
      {
         GivePlayerWeapon(playerid, 38, 100000);
         SendClientMessage( playerid, -1, \"Mivel te vagy [$IceMan$] ezért kaptál egy minigunt! :)\" );
      }
      return 1;
}

 
E: javítva!
« Utoljára szerkesztve: 2013. Április 27. - 18:16:10 írta ZyZu »

[$IceMan$]

  • Vendég
Névre szóló parancs probléma
« Válasz #5 Dátum: 2013. Április 27. - 18:22:11 »
0 Show voters
Idézetet írta: ZyZu date=1367079110\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"36640\" data-ipsquote-contentclass=\"forums_Topic


CMD:parancs(playerid, params[])
{
      new nev[MAX_PLAYER_NAME];
      GetPlayerName(playerid, nev, sizeof(nev));
      if (!strfind(nev, \"[$IceMan$]\", true)) return SendClientMessage( playerid, -1, \"Nem használható számodra ez a parancs mivel nem vagy [$IceMan$]!\");
      {
         GivePlayerWeapon(playerid, 38, 100000);
         SendClientMessage( playerid, -1, \"Mivel te vagy [$IceMan$] ezért kaptál egy minigunt! :)\" );
      }
      return 1;
}

 
E: javítva!
 
Felmentem \"asd\" nevû playerként és beadta a minigunt.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Névre szóló parancs probléma
« Válasz #6 Dátum: 2013. Április 27. - 18:27:52 »
0 Show voters

CMD:parancs(playerid, params[])
{
      new nev[MAX_PLAYER_NAME];
      GetPlayerName(playerid, nev, sizeof(nev));
      if (strfind(nev, \"[$IceMan$]\", true)) return SendClientMessage( playerid, -1, \"Nem használható számodra ez a parancs mivel nem vagy [$IceMan$]!\");
      {
         GivePlayerWeapon(playerid, 38, 100000);
         SendClientMessage( playerid, -1, \"Mivel te vagy [$IceMan$] ezért kaptál egy minigunt! :)\" );
      }
      return 1;
}

 
így probáld meg..

[$IceMan$]

  • Vendég
Névre szóló parancs probléma
« Válasz #7 Dátum: 2013. Április 27. - 18:33:53 »
0 Show voters
Idézetet írta: ZyZu date=1367080072\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"36640\" data-ipsquote-contentclass=\"forums_Topic


CMD:parancs(playerid, params[])
{
      new nev[MAX_PLAYER_NAME];
      GetPlayerName(playerid, nev, sizeof(nev));
      if (strfind(nev, \"[$IceMan$]\", true)) return SendClientMessage( playerid, -1, \"Nem használható számodra ez a parancs mivel nem vagy [$IceMan$]!\");
      {
         GivePlayerWeapon(playerid, 38, 100000);
         SendClientMessage( playerid, -1, \"Mivel te vagy [$IceMan$] ezért kaptál egy minigunt! :)\" );
      }
      return 1;
}

 
így probáld meg..
 
Köszi megy a +!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal