Szerző Téma: Csak egy adóott személy  (Megtekintve 577 alkalommal)

Csak egy adóott személy
« Dátum: 2010. Október 22. - 06:53:10 »
0 Show voters
Sziasztok.
Lenne felétek egy olyan kérdésem ,hogy ha van egy parancs azt ,hogy lehetne megcsinállni, olyanra ,hogy csak mondjuk Franco néven tudod használni az adott parancsot.Tehát a KisPista vagy akkor netudd használni.
Pl:
 
if(strcmp(cmd, \"/kocsim\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
SetPlayerPos(playerid, 2273.1453,2792.8242,10.8203);
}
return 1;
     }

Nem elérhető ►ѕтa

  • 2016
  • Newbie
    • Profil megtekintése
Csak egy adóott személy
« Válasz #1 Dátum: 2010. Október 22. - 07:06:18 »
0 Show voters
if(strcmp(cmd, \"/kocsim\", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerName(playerid) == Franco)
{
   SetPlayerPos(playerid, 2273.1453,2792.8242,10.8203);
}
}
return 1;
}

 


stock PlayerName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
}

 
Ha rossz a kód, szólj.

Csak egy adóott személy
« Válasz #2 Dátum: 2010. Október 22. - 16:07:17 »
0 Show voters
Nem jó.Ugyanugy tudja más használni a parancso

Nem elérhető ZeRo

  • 4620
  • Ex Globális Moderátor
    • Profil megtekintése
Csak egy adóott személy
« Válasz #3 Dátum: 2010. Október 22. - 19:58:22 »
0 Show voters

if(strcmp(cmd, \"/kocsim\", true) == 0)
{
    static szName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, szName, MAX_PLAYER_NAME );
    if( strcmp( szName, \"Franco\" ) != 0 ) {
        SendClientMessage( playerid, COLOR_RED, \"Nem használhatod ezt a parancsot!\" );
    } else {   
        SetPlayerPos(playerid, 2273.1453,2792.8242,10.8203);
    }
    return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal