SA-MP Forums Archive
[HELP] Car Respawn Timer - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Car Respawn Timer (/showthread.php?tid=231772)



[HELP] Car Respawn Timer - Rolyy - 26.02.2011

I need help to create a Car respawn timer under the line of
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
I already tryed 3 different kind of scripts, for example:
pawn Код:
for(new i; i < MAX_VEHICLES; i++)
        {
            if(!IsVehicleInUse(vehicleid))
            {
                SetTimer("SetVehicleToRespawn",500,1);
            }
        }
    printf("Cars Cleaned!");
    }


    IsVehicleInUse(vehicleid){
        new temp;
        for(new i=0;i<200;i++){
            if(IsPlayerConnected(i) && IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i)==PLAYER_STATE_DRIVER){
                temp++;
            }
        }
        if(temp > 0){ return true; } else return false;
    }

So what i practicly want in the script is:


Re: [HELP] Car Respawn Timer - LZLo - 26.02.2011

it's better:

PHP код:
AddStaticVehicleEx(modelidFloat:spawn_xFloat:spawn_yFloat:spawn_zFloat:anglecolor1color2respawn_delay);
modelid    The Model ID for the vehicle.
Float:spawn_X    The X-coordinate for the vehicle.
Float:spawn_Y    The Y-coordinate for the vehicle.
Float:spawn_Z    The Z-coordinate for the vehicle.
Float:angle    The facing angle for the vehicle.
color1    The primary color ID.
color2    The secondary color ID.
respawn_delay    The delay until the car is respawned without a driver in seconds.
Returns    The vehicle ID of the vehicle created
(https://sampwiki.blast.hk/wiki/AddStaticVehicleEx)


Re: [HELP] Car Respawn Timer - Rolyy - 27.02.2011

Hmm, Could you give me 2 or 3 example's of this? To make sure I understand it all.

Should I just set color1, color2, to
pawn Код:
AddStaticVehicleEx(1337, 700.0000, 500.0000, 100.0000, 0.0, 0, 0, 30);
                                                            ^  ^
                                                            |  |
so it will choose random colours for the vehicle?

If so then I will defenitly use this option.