SA-MP Forums Archive
command - 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: command (/showthread.php?tid=309174)



command - Tanush123 - 06.01.2012

well how can i use strcmp or w/e? like for a zcmd command i would like it to work if their name is "Tan"


Re: command - Jakku - 06.01.2012

pawn Код:
CMD:yourcmd(playerid, params[])
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName,sizeof(PlayerName));

    if (strcmp(PlayerName,"Tan",true) == 0)
    {
    //Name is "Tan"
    }
    else
    {
    //Name is not "Tan"
    }

    return 1;
}



Re: command - Tanush123 - 06.01.2012

well is there something shorter than that? would
pawn Код:
if(!strcmp(Nam,"Tan",true) == 0 && !IsPlayerAdmin(playerid)) return 0;
work? (i put return 0 so it return's 0 when their name is not that.)


Re: command - Jakku - 06.01.2012

pawn Код:
if (strcmp(PlayerName,"Tan",true) != 0) return 0;