06.07.2012, 17:08
Im Now in creating stocks , but im kind of confuse i did this , if anyone can explain me why its not returning nothing (the ґiґ)
my command
And my errors are this
pawn Код:
stock nearestwanted(playerid)
{
new Float:x, Float:y, Float:z;
new ii;
GetPlayerPos(playerid, x, y, z);
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if (IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z) && GetPlayerWantedLevel(i) >= 3)
{
printf("Player %d is The Nearest Wanted Level", i);
ii = i;
return i;
}
else
{
printf("No Wanted Level Near");
ii = 0;
return i;
}
}
return ii;
}
pawn Код:
command(wanted, playerid, params[])
{
new string[250];
nearestwanted(playerid);
if(ii > 0)
{
format(string, sizeof(string), "* Nearest Wanted: %s", ii);
SendClientMessage(playerid, -1 ,string);
}
else
{
SendClientMessage(playerid, -1, "No Wanted Level Near");
}
return 1;
}
pawn Код:
(188) : error 017: undefined symbol "ii"
(190) : error 017: undefined symbol "ii"
pawn Код:
188: if(ii > 0)
{
190: format(string, sizeof(string), "* Nearest Wanted: %s", ii);
SendClientMessage(playerid, -1 ,string);
}