SA-MP Forums Archive
Problem with vehicle function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with vehicle function (/showthread.php?tid=663690)



Problem with vehicle function - awiaprox - 08.02.2019

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


Re: Problem with vehicle function - TokicMajstor - 08.02.2019

Stvarno nmp o cemu pricss decko. Objasni sta oces?


Re: Problem with vehicle function - Pottus - 09.02.2019

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.


Re: Problem with vehicle function - awiaprox - 09.02.2019

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.


Re: Problem with vehicle function - awiaprox - 09.02.2019

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