Help - 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: Help (
/showthread.php?tid=562852)
Help -
Edw - 12.02.2015
Код HTML:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new jobs[254];
new string[1024];
new count=0;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(WantedLevel[i] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
if(count == 0)
{
format(jobs, sizeof(jobs), "%s - Wanted Level {FF0000}%d\n{FFFFFF}",giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
}
else if(count > 0)
{
format(jobs, sizeof(jobs), "%s%s - Wanted Level {FF0000}%d\n{FFFFFF}",string,giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
}
strcat(string,jobs);
count++;
}
}
}
ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",string,"Ok", "");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
}
}//not connected
return 1;
}
I wish that when you click on one who has wanted to put a checkpoint on the player that clicked. The problem is I do not know how can I find the id I clicked player
Re: Help -
PaulDinam - 12.02.2015
Create something like a global array for each player:
pawn Код:
new DialogInputs[MAX_PLAYERS][MAX_PLAYERS];
Inside your command where you check whether the wanted level is greater than ZERO do something like this:
pawn Код:
DialogInputs[playerid][count] = i;
And when responding to the dialog, simply do;
pawn Код:
new clickedID = DialogInputs[playerid][listitem];
This must work as i'm using this.