/setdonator - 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: /setdonator (
/showthread.php?tid=514370)
/setdonator -
KillerStrike23 - 21.05.2014
hey guys I want to learn how to create a set cmd without a value like that /setdonator I don't want a level with it.
Re: /setdonator -
XK - 21.05.2014
Thats even easier than making values,just the same as with values,use sscanf or...to detect if he wrote a playerid or name,for example i created one now,do the same
pawn Код:
CMD:setvip(playerid, params[])
{
new Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [playerid / partofname]");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
GetPlayerName(ID,pname,MAX_PLAYER_NAME);
format(str, sizeof(str),"%s has made you a donator!",Nam);
SendClientMessage(ID,0xFF9900AA,str);
format(str,sizeof(str),"You had set %s VIP Level to 0!",pname);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerInfo[ID][Donator] = 0;//remember to define Donator
}
return 1;
}
And for removing do the same but Make him donator = 0;
Re: /setdonator -
KillerStrike23 - 21.05.2014
ty dude +rep but I had already created one.