Custom function problem
#7

Quote:
Originally Posted by Smileys
View Post
I wonder why you start with vehicleid 1, instead of 0, vehicle ids start with 0, not with one, so what you should be using is:

pawn Code:
for(new vehicleid=0; vehicleid < MAX_VEHICLES; vehicleid++)
unless you have a specific reason to start at 1.

not sure if this will fix it, but the rest of the code seems fine to me; this is the only thing I could find.

tho, I also wonder why you do this:

pawn Code:
new     Float:PretendentDistance = range +1; // creates a variable that has the range + 1;

if(Distance <= range && Distance <= PretendentDistance) // checks if the vehicle is within the normal range, and within the range of the normal range +1;
if it inside the normal range then obviously it's also inside the range + 1; so I don't really understand why you do that.


also, you should change this
pawn Code:
new     Float:p_X;
    new     Float:p_Y;
    new     Float:p_Z;

    new     Float:Distance;
    new     Float:PretendentDistance = range +1;
    new     Pretendent;
to this.
pawn Code:
new    
    Float:p_X,
    Float:p_Y,
    Float:p_Z,

    Float:Distance,
    Float:PretendentDistance = range +1,
    Pretendent
;

i don't see what is the diference?

and about pretendentdistance i change it inside for
Reply


Messages In This Thread
Custom function problem - by moof2010 - 05.05.2014, 19:30
Re: Custom function problem - by Smileys - 05.05.2014, 19:39
Re: Custom function problem - by Vince - 05.05.2014, 19:48
Re: Custom function problem - by Teemo - 05.05.2014, 19:50
Re: Custom function problem - by Konstantinos - 05.05.2014, 19:51
Re: Custom function problem - by Smileys - 05.05.2014, 19:51
Re: Custom function problem - by moof2010 - 05.05.2014, 19:54
Re: Custom function problem - by moof2010 - 05.05.2014, 20:08
Re: Custom function problem - by Konstantinos - 05.05.2014, 20:18
Re: Custom function problem - by moof2010 - 05.05.2014, 20:37

Forum Jump:


Users browsing this thread: 1 Guest(s)