SA-MP Forums Archive
GetPlayerWanted level how? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerWanted level how? (/showthread.php?tid=74789)



GetPlayerWanted level how? - Sal_Kings - 26.04.2009

Whats the script once u type a command it shows u the players wanted level. On your screen only?\

like /getwantedlevel id


Re: GetPlayerWanted level how? - joco96 - 26.04.2009

I think it'll work ^^. I didn't test it.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext) {
    if(!strcmp(cmdtext, "/getwanted", true, 10)) {
        new str[128];
        format(str, sizeof(str), "Your wanted level is %d", GetPlayerWantedLevel(playerid));
        SendClientMessage(playerid, 0xFFFF00FF, str);
        return 1;
    }
   
    return 0;
}



Re: GetPlayerWanted level how? - MenaceX^ - 26.04.2009

He meant to another player (ReturnUser/strval)


Re: GetPlayerWanted level how? - westre - 26.04.2009

If you use DCMD, use this:

Код:
dcmd(getwanted, 9, cmdtext);
Код:
dcmd_getwanted(playerid, params[])
	 {
	 new wantedid = strval(params);
	 	if(!strlen(params))
	 	{
	 		SendClientMessage(playerid, 0xFF0000FF, "Syntax: /getwanted [id]");
	 	}
	 	else
	 	{
 		if(IsPlayerConnected(wantedid))
	 	{
 		    new str[128];
		    format(str, sizeof(str), "His wanted level is %d.", GetPlayerWantedLevel(wantedid));
		    SendClientMessage(playerid, 0xFFFF00FF, str);
        }
	 }
	 return 1;
}
Sorry about the indentation. (I didn't test it btw but I think it'll work)