28.02.2012, 16:55
'Sup y'all?
I just made fast a "setvip"-command, and then, I tested it! Unfortunately, when I just write "/setvip [ID]" or only "/setvip", it doesn't show the usage! There's written, that I've set my VIP-level to 0, even though it should show the usage:
I just made fast a "setvip"-command, and then, I tested it! Unfortunately, when I just write "/setvip [ID]" or only "/setvip", it doesn't show the usage! There's written, that I've set my VIP-level to 0, even though it should show the usage:
PHP код:
COMMAND:setvip(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
new Target;
new Level;
if(!sscanf(params, "ui", Target, Level)) SendClientMessage(playerid,COLOR_RED,"USAGE: /setvip <playerid> <level>");
{
//if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "SERVER: Maximum level is 3!");
if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
if(PlayerInfo[Target][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
PlayerInfo[Target][VIPlevel] = Level;
new tname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
new MyString[128];
new TargetString[128];
format(MyString, sizeof(MyString), "You have set %s VIP Level to %i!", tname, Level);
format(TargetString, sizeof(TargetString), "You are now VIP Level %i, thanks to %s!", Level, pname);
SendClientMessage(Target, COLOR_RED, TargetString);
SendClientMessage(playerid,COLOR_GREEN,MyString);
PlayerPlaySound(Target,1057,0.0,0.0,0.0);
}
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
return 1;
}