SA-MP Forums Archive
Plates problem - 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: Plates problem (/showthread.php?tid=291043)



Plates problem - McCarthy - 18.10.2011

pawn Код:
//ongamemodeinit   
for(new i=0;i<MAX_VEHICLES;i++)
    for(new i2=0; i2<MAX_VEHICLES; i2++)
    {
    if(IsACopCar(i))
    {
        SetVehicleNumberPlate(i2,"SAPD");
    }
    if(IsAnFbiCar(i))
    {
        SetVehicleNumberPlate(i2,"FBI");
    }
    if(IsAFiremenCar(i))
    {
        SetVehicleNumberPlate(i2,"SAFD");
    }
    if(IsAnAmbulance(i))
    {
        SetVehicleNumberPlate(i2,"LSMD");
    }
    if(IsASwatCar(i))
    {
        SetVehicleNumberPlate(i2,"SWAT");
    }
    else
    {
        SetVehicleNumberPlate(i2,"STATE");
    }
    SetVehicleToRespawn(i);
    }
Plates are still ZXY000 or whatever the default text was...whats wrong in the script? :/


Re: Plates problem - nilanjay - 18.10.2011

Can you show the codes after SetVehicleToRespawn?


Re: Plates problem - Ensconce - 18.10.2011

Why are you looping through the vehicles again each time you loop through the vehicles? Makes no sense.


Re: Plates problem - nilanjay - 18.10.2011

I think because the he is using different vehicles thats why


Re: Plates problem - McCarthy - 18.10.2011

Quote:
Originally Posted by nilanjay
Посмотреть сообщение
Can you show the codes after SetVehicleToRespawn?
Uh just createpickups, objects, vehicles etc...


Re: Plates problem - Vince - 18.10.2011

Quote:
Originally Posted by Ensconce
Посмотреть сообщение
Why are you looping through the vehicles again each time you loop through the vehicles? Makes no sense.
Exactly what I was thinking.

Quote:
Originally Posted by nilanjay
Посмотреть сообщение
I think because the he is using different vehicles thats why
What does it matter? He has a loop in a loop, but both loops do the same thing, hence it makes no sense at all. And after all, this comes down to 2000^2 (4,000,000) iterations when you have only 2000 cars (max)!


Re: Plates problem - nilanjay - 18.10.2011

Quote:
Originally Posted by Vince
Посмотреть сообщение
Exactly what I was thinking.


What does it matter? He has a loop in a loop, but both loops do the same thing, hence it makes no sense at all. And after all, this comes down to 2000^2 (4,000,000) iterations when you have only 2000 cars (max)!
Oh okay. Thanks for telling.


Re: Plates problem - McCarthy - 18.10.2011

Uhm I see...I tried to fix it but still didn't get it to work >_>


Re: Plates problem - McCarthy - 21.10.2011

Any help..?