Wanted list unkonw on dialog? - 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 list unkonw on dialog? (
/showthread.php?tid=583258)
Wanted list unkonw on dialog? -
Metharon - 27.07.2015
pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(PlayerInfo[playerid][pMember] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not a cop.");
return 1;
}
new index;
new stringx[456];
format(stringx, sizeof(stringx), "{f48555}_______________________________\nListг urmгrire:");
for (new i; i<=MAX_PLAYERS; i++)
{
new zone[MAX_ZONE_NAME];
index ++;
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
if(PlayerInfo[playerid][pIsolated] != 1)
{
format(stringx, 456, "%s\n{f48555}%d. %s (%d) {fec879}(W.%d){f48555} (%s)", stringx, index, GetName(i),i, PlayerInfo[i][pWanted],zone);
}
else
{
format(stringx, 456, "%s\n{f48555}%d. %s (%d) {9b0000}(IZOLAT){f48555} (%s)", stringx, index,GetName(i),i,zone);
}
}
format(stringx,456, "%s\n{f48555}_______________________________", stringx);
ShowPlayerDialog(playerid, DIALOG_WANTED, DIALOG_STYLE_MSGBOX, "{9E9E9E}Listг de urmгrire", stringx, "Done", "");
}
result
.... why?
[img]
http://i.imgur.com/j3FOE69.jpg
[/img]
Re: Wanted list unkonw on dialog? -
DarkLored - 27.07.2015
make sure you are not using any type of other command processors if you are convert the command.
I'd recommend that you use zcmd it's more efficient and easy to use.
Re: Wanted list unkonw on dialog? -
SickAttack - 27.07.2015
A retrieved value from an array using an out of bound index is most likely invalid (causes that message to show up and terminates the command's process).
Also, check if the player id is valid, and switch to a newer/faster method of creating player loops (GetPlayerPoolSize() or foreach). And break the loop when it is necessary.