Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnVehicleSpawn(vehicleid)
- {
- VehProtection(vehicleid);
- for(new i = 0; i < sizeof(VoziloInfo); i++)
- {
- new vFile[50];
- format(vFile, sizeof(vFile), AUTO_FILE, i);
- if(fexist(vFile))
- {
- if(vehicleid == VoziloInfo[i][vID])
- {
- for(new id = 1; id <= 17; id++)
- {
- if(VoziloInfo[i][vMod][id]!=0) { AddVehicleComponent(vehicleid,VoziloInfo[i][vMod][id]); }
- }
- if(VoziloInfo[i][vMod][0]>=0) { ChangeVehiclePaintjob(vehicleid,VoziloInfo[i][vMod][0]); }
- }
- }
- }
- return 1;
- }
- public OnVehicleDeath(vehicleid)
- {
- for (new p, mp = GetMaxPlayers(); p != mp; p++)
- {
- if (IsPlayerConnected(p) && !IsPlayerNPC(p))
- {
- new race = GetPVarInt(p, PVAR_TAG"currentRaceID");
- if (race)
- {
- race -= 2;
- if (raceOwners[race] != INVALID_PLAYER_ID)
- {
- if (GetPVarInt(p, PVAR_TAG"currentVehID") == vehicleid)
- {
- new Float: health;
- GetPlayerHealth(p, health);
- if (health > 0)
- {
- respawnPlayer(p, race);
- }
- break;
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement