[Question] Command only for one playerid. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Question] Command only for one playerid. (
/showthread.php?tid=336418)
[Question] Command only for one playerid. -
GBLTeam - 22.04.2012
I have tryed to make this command to work only for one nick like "GBL" . But tryed it from me not work, tryed from other nick work ??.
pawn Код:
if(strcmp(cmd, "/makeblackfamily", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /makeblackfamily [ID Igraca/Dio Imena]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName,"GBLTeam",true))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pBlackFamily] = level;
format(string, sizeof(string), " Dali/oduzeli ste %s-u BlackFamily clenstvo .", giveplayer,level);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "[GRESKA] Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}
Re: [Question] Command only for one playerid. -
Macluawn - 22.04.2012
if(
!strcmp(PlayerName,"GBLTeam",true))
Re: [Question] Command only for one playerid. -
GBLTeam - 22.04.2012
Quote:
Originally Posted by Macluawn
if(!strcmp(PlayerName,"GBLTeam",true))
|
Oh what i was wrong "!"

Thanks for help, fixed it.