Wanted Level
#1

Hi.I ordered / su (/ suspect) given command wanted but I want the police to give a certain level to wanted and did not know how.Currently in the order made by me every typing commands give wanted one and I want when I write three to give Wanted Level 3 or I write 8 to give Wanted Level 8..Please help me tell me what to do or change my which will be placed.For exemple /su [playerid][wanted level][reason]

Код HTML:
dcmd_su(playerid, params[])
{
    if((gTeam[playerid] <= 6) && (gTeam[playerid] > 0))
    {
	    	if(CopDuty[playerid] == 1)
	        {
			    new
			        player1,
			        gWantedLevel,
			        string[128],
			        copname[MAX_PLAYER_NAME],
			        playername[MAX_PLAYER_NAME],
			        tmp [256],
			        tmp2 [256],
			        Index
			    ;
				tmp  = strtok(params,Index);
				tmp2 = strtok(params,Index);
			    if(!strlen(params)) return SendClientMessage(playerid, RED, "USAGE: /su [Player Id][Reason]");
			    if(!strlen(tmp2)) return SendClientMessage(playerid, RED, "ERROR: Reason unspecified!");
			    GetPlayerName(playerid, copname, sizeof(copname));
			    GetPlayerName(player1, playername, sizeof(playername));
			    player1 = strval(tmp);
			    format(string, sizeof(string), "Officer %s has suspected %s with %d [Reason: %s]", copname, playername, params[2]);
			    SendClientMessageToAll(COP_COLOR, string);
			    Info[playerid][Suspected_Players]++;
			    gWantedLevel = GetPlayerWantedLevel(player1);
			    return SetPlayerWantedLevel(player1, gWantedLevel +1);
			}
			else return SendClientMessage(playerid, RED, "ERROR: You have to be on cop duty!");
	}
	else return SendClientMessage(playerid, RED, "ERROR: You have to be a Cop to use this command!");
}
Reply
#2

use sscanf
Reply
#3

But how that is the condition?I'm sorry but I'm new in scripting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)