07.07.2012, 06:44
Everytime i use this stock (i made a test debug command) appears always ID 0
how to make it not return id 0
how to make it not return id 0
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 ii;
}
else
{
print("No Wanted Level Near");
ii = 0;
return ii;
}
}
return -1;
}
stock nearestrobbable(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))
{
printf("Player %d is The Nearest Robbable Player", i);
if(i = playerid) return 1;
else
{
ii = i;
return ii;
}
}
else
{
print("No Robbable player near");
ii = 0;
return ii;
}
}
return -1;
}