26.06.2015, 20:43
It's so frustrating...I made all that code good,why the hell doesn't work?
So,I made 377 houses on my server,I put 1000 cuz I'll make more and here's the frustrating part...If I'm near of one house,in returns that message with the ID of the house...if I'm not near of any house,it says me this "SERVER:Unknown command!",instead of the message "-1" from the last return.Why?
CMD:inrange(playerid,params[])
{
new str[10];
for(new i=1;i<=1000;i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,house_spawn _x[i],house_spawn_y[i],house_spawn_z[i]))
{
format(str,10,"%i",i);
return SendClientMessage(playerid,-1,str);
}
}
return SendClientMessage(playerid,-1,"-1");
}
So,I made 377 houses on my server,I put 1000 cuz I'll make more and here's the frustrating part...If I'm near of one house,in returns that message with the ID of the house...if I'm not near of any house,it says me this "SERVER:Unknown command!",instead of the message "-1" from the last return.Why?
CMD:inrange(playerid,params[])
{
new str[10];
for(new i=1;i<=1000;i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,house_spawn _x[i],house_spawn_y[i],house_spawn_z[i]))
{
format(str,10,"%i",i);
return SendClientMessage(playerid,-1,str);
}
}
return SendClientMessage(playerid,-1,"-1");
}