Maximum Anount - 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: Maximum Anount (
/showthread.php?tid=496433)
Maximum Anount -
Mriss - 22.02.2014
What is the code to make a maximum amount you can do like,
/setadmin [Playerid] [1-6] How to make it if they do /setadmin 0 77 make it not work, I want it to be 1-6
Re: Maximum Anount -
]Rafaellos[ - 22.02.2014
pawn Код:
if(Level < 1 || Level > 6)
Re: Maximum Anount -
Mriss - 22.02.2014
thanks man! +rep 4 u!
Re: Maximum Anount -
Mriss - 22.02.2014
Heres the script can u insert that code into it?
Код:
CMD:setadmin(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 9)
{
new sendername[MAX_PLAYER_NAME];
new giveplayername[MAX_PLAYER_NAME];
new giveplayerid,level;
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
if (!sscanf(params, "ii", giveplayerid,level))
{
if (giveplayerid != INVALID_PLAYER_ID)
{
new string[128];
format(string, sizeof(string), "The admin %s has made you a level %d admin",sendername,level);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "You have made %s a level %d admin",giveplayername,level);
SendClientMessage(playerid, COLOR_GRAD1, string);
PlayerInfo[giveplayerid][Admin] = level;
}
}
else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setadmin [playerid] [level]");
}
else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!!");
}
return 1;
}
Idk how to put that LOL
Re: Maximum Anount -
RajatPawar - 22.02.2014
EDIT: Did not refresh, already answered
pawn Код:
COMMAND:hello( playerid, params[] )
{
new player, level ;
if( sscanf( params, "ud", player, level ) ) return 0;
if( !(0 < level < 7) ) return 0;
...
Re: Maximum Anount -
Mriss - 22.02.2014
Coudl u just put it in the script?