How to add options instead of one option
#3

As FreAkeD said, you should use sscanf.

PHP код:
CMD:setscore(playerid,params[])
{
    if(
pInfo[playerid][Admin] >= 5)
    {
        new 
targetidscorestring[144];
         if(
sscanf(params"ud"targetidscore)) return SendClientMessage(playeridRED"USAGE: /setcriminal [playerid] [score]");
        if(
pInfo[targetid][Admin] == ServerInfo[MaxAdminLevel] && pInfo[playerid][Admin] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,RED,"SERVER: You are not authorized to use this command on this admin.");
        if(
IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID)
        {
            
CMDMessageToAdmins(playerid,"SETSCORE");
            
format(stringsizeof(string), "You have set \"%s's\" criminal level to '%d' "pInfo[playerid][Name], score); SendClientMessage(playerid,blue,string);
            if(
targetid != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your criminal level to '%d'"pInfo[playerid][Name], score); SendClientMessage(targetid,blue,string); }
            return 
SetPlayerCriminal(targetidscore);
        } else return 
SendClientMessage(playerid,RED,"SERVER: Player is not connected");
    } else return 
SendClientMessage(playerid,RED,"SERVER: You are not authorized to use this command.");

Reply


Messages In This Thread
How to add options instead of one option - by Oshery - 19.01.2018, 07:12
Re: How to add options instead of one option - by FreAkeD - 19.01.2018, 09:38
Re: How to add options instead of one option - by iamjems - 19.01.2018, 13:25
Re: How to add options instead of one option - by BulletRaja - 19.01.2018, 14:44
Re: How to add options instead of one option - by Oshery - 19.01.2018, 14:55
Re: How to add options instead of one option - by BulletRaja - 19.01.2018, 15:03
Re: How to add options instead of one option - by Inn0cent - 19.01.2018, 15:05
Re: How to add options instead of one option - by Oshery - 19.01.2018, 16:30
Re: How to add options instead of one option - by BulletRaja - 20.01.2018, 06:56
Re: How to add options instead of one option - by Oshery - 20.01.2018, 10:57

Forum Jump:


Users browsing this thread: 2 Guest(s)