Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- forward LooDDetectorV(Float:radi, playerid, vehicleid);
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Respawn vehicle system by --LooD--");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- #endif
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/rtc", cmdtext, true, 10) == 0)
- {
- new string[128];
- if (IsPlayerConnected(playerid))
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), "{FFFFFF}%s{00C0FF} je respawnovao vozilo id %d.",ImePrezime(playerid),GetPlayerVehicleID(playerid));
- SendClientMessageToAll(0xDABB3EAA, string);
- new rcar = GetPlayerVehicleID(playerid);
- SetVehicleToRespawn(rcar);
- SendClientMessage(playerid, -1, " Vozilo respawnovano !");
- }
- }
- return 1;
- }
- if (strcmp("/rac", cmdtext, true, 10) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerAdmin(playerid))
- {
- new bool:unwanted[MAX_VEHICLES];
- new string[128];
- for(new player=0; player<MAX_PLAYERS; player++)
- {
- if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
- }
- for(new car = 1; car <= MAX_VEHICLES; car++)
- {
- if(!unwanted[car]) SetVehicleToRespawn(car);
- }
- format(string, sizeof(string), "{FFFFFF}%s{00C0FF} je respawnovao sva nekoristena vozila", ImePrezime(playerid));
- SendClientMessageToAll(-1, string);
- }
- }
- return 1;
- }
- if (strcmp("/rlc", cmdtext, true, 10) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerAdmin(playerid))
- {
- new bool:unwanted[MAX_VEHICLES];
- for(new player=0; player<MAX_PLAYERS; player++)
- {
- if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
- }
- for(new car = 1; car <= MAX_VEHICLES; car++)
- {
- if(LooDDetectorV(10.0, playerid, car))
- {
- if(!unwanted[car]) SetVehicleToRespawn(car);
- }
- }
- SendClientMessage(playerid, -1, "{00C0FF} Respawnali ste sva nekoristena vozila u svojoj blizini.");
- }
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public LooDDetectorV(Float:radi, playerid, vehicleid)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- //radi = 2.0; //Trigger Radius
- GetVehiclePos(vehicleid, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- stock ImePrezime(playerid)
- {
- new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname));
- new i = strfind(pname,"_",true);
- if(i != (-1)) pname[i] = ' ';
- return pname;
- }
Advertisement
Add Comment
Please, Sign In to add comment