Wanted problem
#1

Hi guys ^^
When i type /su ( /suspect ) i want to give and the wanted level
Normal /su [playerid/partofname] Crimetext
How i want /su [playerid/partofname] Crimetext Wanted Level

And the command is
PHP код:
  if(strcmp(cmd"/suspect"true) == || strcmp(cmd"/su"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GREY"Scrie: (/su)spect [playerid/PartOfName] [crime text]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if (
IsACop(playerid))
            {
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(!
IsACop(giveplayerid))
                        {
                            
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            new 
length strlen(cmdtext);
                            while ((
idx length) && (cmdtext[idx] <= ' '))
                            {
                                
idx++;
                            }
                            new 
offset idx;
                            new 
result[64];
                            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                            {
                                
result[idx offset] = cmdtext[idx];
                                
idx++;
                            }
                            
result[idx offset] = EOS;
                            if(!
strlen(result))
                            {
                                
SendClientMessage(playeridCOLOR_GREY"Scrie: (/su)spect [playerid/PartOfName] [crime text]");
                                return 
1;
                            }
                            
WantedPoints[giveplayerid] += 2;
                            
SetPlayerCriminal(giveplayerid,playeridresult);
                            
format(string256"Wanted Bot: %s i-a dat lui %s Wanted pentru motivul %s",sendernamegiveplayerresult);
                            
ABroadCast(COLOR_YELLOW,string,1);
                            return 
1;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"You can't suspect a Cop !");
                        }
                    }
                }
                else
                {
                        
format(stringsizeof(string), "%d is not an active player."giveplayerid);
                        
SendClientMessage(playeridCOLOR_GRAD1string);
                        return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD2"You are not a Police Departament,FBI or National Guard !");
            }
        }
        return 
1;
    } 
Reply
#2

Use sscanf and a command processor such as ZCMD
Reply
#3

I need the entire command..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)