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 RentVozila(carid);
- #if defined FILTERSCRIPT
- new Rent[8];
- new Rentano[MAX_PLAYERS];
- forward RentVozila(carid)
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- forward RentVozila(carid);
- public OnFilterScriptExit()
- {
- Rent[0] = AddStaticVehicleEx(462,1698.6999500,-1873.3000500,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[1] = AddStaticVehicleEx(462,1698.5999800,-1874.3000500,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[2] = AddStaticVehicleEx(462,1698.5000000,-1875.1999500,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[3] = AddStaticVehicleEx(462,1698.5000000,-1876.0999800,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[4] = AddStaticVehicleEx(462,1698.5000000,-1877.0000000,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[5] = AddStaticVehicleEx(462,1698.5999800,-1877.9000200,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[6] = AddStaticVehicleEx(462,1698.5000000,-1878.8000500,13.2000000,92.0000000,132,4,15); //Faggio
- Rent[7] = AddStaticVehicleEx(462,1698.5000000,-1879.8000500,13.2000000,92.0000000,132,4,15); //Faggio
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public RentVozila(carid)
- {
- for(new i = 0; i < sizeof(Rent); i++)
- {
- if(carid == Rent[i]) return 1;
- }
- return 0;
- }
- forward RentVozila(carid);
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- 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[])
- {
- CMD:rentaj(playerid,params[])
- {
- new string[128];
- if (GetPlayerMoney(playerid) < 150)//Ako igrac nema 150 $, nece moci da renta.
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Nemas dovoljno Novca!");
- return 1;
- }
- if(Rentano[playerid] != 299)//Proverava da li vec imas rentano vozilo.
- {
- SendClientMessage(playerid, SIVA, "Moras prvo da vratis iznajmljeno vozilo.");
- return 1;
- }
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(Rentano[i] == GetPlayerVehicleID(playerid))//Ako je neko rentao vozilo, neces ga moci rentati
- {
- SendClientMessage(playerid, SIVA, "Neko je vec rentao ovo vozilo.");
- return 1;
- }
- }
- GivePlayerMoney(playerid,-150);//Oduzima igracu 150$
- Rentano[playerid] = GetPlayerVehicleID(playerid);//Postavlja igracu rent vozilo(da drugi nmg rentati)
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);// Pusta neke zvuke...
- format(string, sizeof(string), "~r~/unrentcar~n~~g~/lock.");//Tekst koji ce biti u GameTextu
- SendClientMessage(playerid, ZUTA, "Prijatan dan!");// ispisuje poruku igracu
- TogglePlayerControllable(playerid, 1);//Odmrzava igraca - Omogucava mu da se krece
- GameTextForPlayer(playerid, string, 5000, 3);// Prikazuje GameText
- return 1;
- }
- CMD:unrentaj(playerid,params[])
- {
- new idcar = GetPlayerVehicleID(playerid);
- if(Rentano[playerid] != 299)
- {
- if(idcar == Rentano[playerid])
- {
- TogglePlayerControllable(playerid, 1);
- }
- SetVehicleToRespawn(Rentano[playerid]);
- Rentano[playerid] = 299;
- SendClientMessage(playerid,CRVENA,"Vratio si iznajmljeno vozilo!");
- }
- return 1;
- }
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- 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)
- {
- if(newstate == 2)
- {
- if(RentVozila(newcar))
- {
- if (Rentano[playerid] != newcar)
- {
- SendClientMessage(playerid,ZELENA,"========== RENT VOZILO ==========");
- SendClientMessage(playerid,LJUBICASTA,"Da rentas: /rentcar .");
- SendClientMessage(playerid,LJUBICASTA,"Da izadjes: /exitcar .");
- TogglePlayerControllable(playerid, 0);// Freeza igraca, da ne moze da pobegne
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- }
- else
- {
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment