CMD problem
#6

PHP код:
CMD:giverank(playeridparams[])
{
    if(
pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1"You are not authorized to use that command!");
    new 
giveplayeridrank;
    if(
sscanf(params"ud"giveplayeridrank)) return SendClientMessage(playerid, -1"USAGE: /giverank [playerid] [Rank (1-2)]");
    if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1"There is no such player!");
    switch(
rank)
    {
        case 
1pInfo[giveplayerid][pMod] = 1;
        case 
2..6pInfo[giveplayerid][pAdmin] = rank 1;
        default: 
SendClientMessage(playerid, -1"Don't go below number 0, or above number 6!");
    }
    return 
1;

'rank' is not a string or array in this instance, so it doesn't need you to specify a size. It is an integer and can be a standalone variable.

I'm assuming pAdmin is increased when a number above 1 is entered, so this is the code I've given you. Please change accordingly.
Reply


Messages In This Thread
CMD problem - by KamilPolska - 15.12.2018, 16:31
Re: CMD problem - by TheToretto - 15.12.2018, 16:34
Re: CMD problem - by KamilPolska - 15.12.2018, 18:49
Re: CMD problem - by d1git - 15.12.2018, 20:06
Re: CMD problem - by KamilPolska - 16.12.2018, 11:41
Re: CMD problem - by Threshold - 16.12.2018, 11:58
Re: CMD problem - by KamilPolska - 16.12.2018, 12:39
Re: CMD problem - by Threshold - 16.12.2018, 13:01
Re: CMD problem - by KamilPolska - 16.12.2018, 14:03

Forum Jump:


Users browsing this thread: 3 Guest(s)