SA-MP Forums Archive
Wanted Level - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Wanted Level (/showthread.php?tid=462727)



Wanted Level - r0bi - 08.09.2013

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!");
}



Re : Wanted Level - Vukilore - 08.09.2013

use sscanf


Re: Wanted Level - r0bi - 08.09.2013

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