29.09.2016, 13:44
You are missing one variable. You put us[32] and 1 one variable.
PHP код:
CMD:vipset(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] == 5)
{
new Target, missingvariable[32+EOS];
if(!sscanf(params, "us[32]",Target, missingvariable))
{
if(!IsPlayerConnected(Target))
return SendClientMessage(playerid, red, "Player is not connected!");
new tname[MAX_PLAYER_NAME];
new pname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
GetPlayerName(playerid,pname,sizeof(pname));
if(VipSet[playerid] == false)
{
PlayerInfo[playerid][pVip] = 1;
GameTextForPlayer(playerid, "~W~VIP status ~g~added to the selected player", 5000, 5);
VipSet[playerid] = true;
}else{
PlayerInfo[playerid][pVip] = 0;
GameTextForPlayer(playerid, "~W~VIP status ~r~removed to the selected player", 5000, 5);
VipSet[playerid] = false;
}
}
else return SendClientMessage(playerid, red, "USAGE: /vipset <playerid>/<player name>");
return true;
}
else return 0;
}