12.05.2015, 19:26
Should be
if(sscanf(params, "s[5]", tmp))
but you don't need sscanf for 1 option your 'params' is same as tmp
if(sscanf(params, "s[5]", tmp))
but you don't need sscanf for 1 option your 'params' is same as tmp
pawn Код:
COMMAND:name(playerid, params[])
{
if(PlayerInfo[playerid][admin] || PlayerInfo[playerid][premium] || PlayerInfo[playerid][playerteam]==HITMAN || PlayerInfo[playerid][playerteam]==FBI || PlayerInfo[playerid][playerleve]>= 10)
{
if(isnull(params)) SCP(playerid, "[on/off]");
else if(strcmp(params,"on",true)==0)
{
PlayerTemp[playerid][hname]=0;
GameTextForPlayer(playerid,"~g~ShowName ON",1000,1);
PlayerLoop(i) ShowPlayerNameTagForPlayer(i,playerid,1);
}
else if(strcmp(params,"off",true)==0)
{
PlayerTemp[playerid][hname]=1;
GameTextForPlayer(playerid,"~r~ShowName OFF",1000,1);
PlayerLoop(i) if(!PlayerInfo[i][power]) ShowPlayerNameTagForPlayer(i,playerid,0);
}
else SCP(playerid, "[on/off]");
}
else SendClientError(playerid, CANT_USE_CMD);
return 1;
}