Problem with vehicle function
#1

script dont respond to this code
PHP Code:
stock IsAdminVehicle(carid)
{
    if(
carid >= AdminVeh[0] && carid <= AdminVeh[12])
    {
        return 
true;
    }
    return 
false;

also i try out with this code but no effect but with this one script dont load vehicles
PHP Code:
stock IsAdminVehicle(carid)
{
       for(new 
0sizeof(AdminVeh); b++)
    {
        if(
carid == AdminVeh[b]) return true;
    }
    return 
false;

somebody see problem or write new code
Reply
#2

Stvarno nmp o cemu pricss decko. Objasni sta oces?
Reply
#3

I've seen this logic before in RP scripts checking vehicle id ranges so that if you remove one vehicle it breaks the whole system.
Reply
#4

Quote:
Originally Posted by Y_Less
View Post
1) English only here.

2) Are you sure the IDs you're testing against are correct and in order?
Say to dude above.

Im quite sure the IDs are correct.
Reply
#5

Quote:
Originally Posted by Pottus
View Post
I've seen this logic before in RP scripts checking vehicle id ranges so that if you remove one vehicle it breaks the whole system.
call it stuppid, but there must be answer for this problem.absurdly i didnt remove any vehicle so the system could not break i just define vehicles like this

PHP Code:
new testveh[3];
testveh[0] = AddStaticVehicleEx(etc.)
testveh[1] = AddStaticVehicleEx(etc.)
testveh[2] = AddStaticVehicleEx(etc.) 
and then in stock/functions i used varibale name instead of veh id
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)