How to add options instead of one option
#4

PHP код:
CMD:setscore(playeridparams[])
{
    new 
options[128], targetidscorestring[144];
    if(
pInfo[playerid][Admin] >= 5)
    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)
    if(
sscanf(params"us[128]d",targetid,options,score))
    {
        
SendClientMessage(playerid, -1"Usage: /setscore [playerid] [Option] [score]");
        
SendClientMessage(playerid, -1"{FF0000}Option:{00FF00}Criminal, Cop, Paramedic");
        return 
1;
    }
    else if(!
strcmp(options"Criminal"true5))
    {
      
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);
      
pInfo[targetid][Criminal] = score;
    }
    else if(!
strcmp(options"Cop"true5))
    {
      
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 cop level to '%d'"pInfo[playerid][Name], score); SendClientMessage(targetid,blue,string); }
      return 
SetPlayerCop(targetidscore);
      
pInfo[targetid][Cop] = score;
    }
    else if(!
strcmp(options"Paramedic"true5))
    {
      
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 paramedic level to '%d'"pInfo[playerid][Name], score); SendClientMessage(targetid,blue,string); }
      return 
SetPlayerParamedic(targetidscore);
      
pInfo[targetid][Paramedic] = score;
    }
    else 
SendClientMessage(playeridCOLOR_RED"Invalid Option.");
    else return 
SendClientMessage(playerid,RED,"SERVER: Player is not connected");
    else return 
SendClientMessage(playerid,RED,"SERVER: You are not authorized to use this command.");
    return 
1;

try this cmd if u get error tell me
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: 1 Guest(s)