29.09.2016, 12:53
Hi, guys! Need help here. Is there something wrong with this command? Whenever I use it to a person, it repeats the command usage. Here's the command
PHP код:
CMD:vipset(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] == 5)
{
new Target;
if(!sscanf(params, "us[32]",Target))
{
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;
}