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>
- new pizza = 0;
- new Float:PizzaDelivery[3][4] = {//change 3 to the no. of checkpoints
- {651.8204,-1619.4867,15.0000,1.0},
- {795.1389,-1691.2811,14.4633,1.0},
- {1237.6108,-1582.6001,13.4683,1.0}
- };
- new PizzaJob[sizeof(PizzaDelivery)];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/pizzajob", cmdtext, true) == 0)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
- {
- pizza = 1;
- new checkpoint, job = 0;
- do{
- for(new i=0; i<sizeof(PizzaJob); i++)
- if(PizzaJob[i] != 0)
- job++;
- if(job == sizeof(PizzaJob))
- for(new i=0; i<sizeof(PizzaJob); i++)
- PizzaJob[i] = 0;
- checkpoint = random(sizeof(PizzaDelivery));
- }while(PizzaJob[checkpoint]);
- SetPlayerCheckpoint(playerid,PizzaDelivery[checkpoint][0],PizzaDelivery[checkpoint][1],PizzaDelivery[checkpoint][2],PizzaDelivery[checkpoint][3]);
- GameTextForPlayer(playerid, "~g~You are now pizza delivery boy!", 3000, 3);
- new name[MAX_PLAYER_NAME], string[48];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s is now a pizza delivery boy.", name );
- SendClientMessageToAll(-1, string);
- return 1;
- }
- SendClientMessage(playerid, -1,"You have to be in a Pizzaboy bike delivery.");
- }
- if (strcmp("/pizza", cmdtext, true) == 0)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- AddStaticVehicleEx(448, X, Y, Z, 1, 1, 1, 0);
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448 && pizza == 1)
- {
- new checkpoint, job = 0;
- do{
- for(new i=0; i<sizeof(PizzaJob); i++)
- if(PizzaJob[i] != 0)
- job++;
- if(job == sizeof(PizzaJob))
- for(new i=0; i<sizeof(PizzaJob); i++)
- PizzaJob[i] = 0;
- checkpoint = random(sizeof(PizzaDelivery));
- }while(PizzaJob[checkpoint]);
- SetPlayerCheckpoint(playerid,PizzaDelivery[checkpoint][0],PizzaDelivery[checkpoint][1],PizzaDelivery[checkpoint][2],PizzaDelivery[checkpoint][3]);
- PizzaJob[checkpoint] = 1;
- SendClientMessage(playerid, -1, "You got a delivery mission.");
- SendClientMessage(playerid, -1, "Check the map for the location");
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448 && pizza == 1)
- {
- pizza = 0;
- SendClientMessage(playerid, -1, "You exited the vehicle!");
- SendClientMessage(playerid, -1, "Delivery Mission failed!");
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, -1, "You have sucessfuly delivered the pizza");
- GivePlayerMoney(playerid, 1000);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
- new checkpoint, job = 0;
- do{
- for(new i=0; i<sizeof(PizzaJob); i++)
- if(PizzaJob[i] != 0)
- job++;
- if(job == sizeof(PizzaJob))
- for(new i=0; i<sizeof(PizzaJob); i++)
- PizzaJob[i] = 0;
- checkpoint = random(sizeof(PizzaDelivery));
- }while(PizzaJob[checkpoint]);
- SetPlayerCheckpoint(playerid,PizzaDelivery[checkpoint][0],PizzaDelivery[checkpoint][1],PizzaDelivery[checkpoint][2],PizzaDelivery[checkpoint][3]);
- PizzaJob[checkpoint] = 1;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment