12.02.2012, 02:40
Hello,
I am scripting a pizza job for my server with my buddy, Blazed! I have used the SAMP - Tutorials and Wiki to somehow develop a minor script which was sort of based off of an abandoned script I found which was added and unfinished back in early 2011. I have tried adding checkpoint sounds but nothing seems to work.
Can someone maybe add them. You will get a (REP+1) if you are helpful.
I am scripting a pizza job for my server with my buddy, Blazed! I have used the SAMP - Tutorials and Wiki to somehow develop a minor script which was sort of based off of an abandoned script I found which was added and unfinished back in early 2011. I have tried adding checkpoint sounds but nothing seems to work.
Can someone maybe add them. You will get a (REP+1) if you are helpful.
PHP код:
#include <a_samp>
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
new PizzaJob[256];
public OnFilterScriptInit()
{
AddStaticVehicle(448,1353.9001,238.8588,19.5669,40.4306,0,0); // Pizza 1
AddStaticVehicle(448,1355.6724,241.7024,19.5669,40.4306,0,0); // Pizza 1
AddStaticVehicle(448,1362.5547,257.8708,19.5669,30.0905,0,0); // Pizza 2
AddStaticVehicle(448,1364.3494,262.7186,19.5669,27.2704,0,0); // Pizza 3
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pizzajob", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, 1361.2267,229.9569,19.5669))
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
PizzaJob[playerid] = 1;
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s is now a Pizzaboy.", name );
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid,1200.7805,246.8164,19.5547,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Follow the built in GPS markers to find the pizza destionation!");
return 1;
}
SendClientMessage(playerid, COLOR_RED,"Hop onto the pizza bike to start the pizza route!");
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
SendClientMessage(playerid, COLOR_RED, "* You can start the pizza route by using /pizzajob");
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
if(PizzaJob[playerid] == 1){
PizzaJob[playerid] = 2;
SetPlayerCheckpoint(playerid,1200.7805,246.8164,19.5547,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Deliver a pizza to all the houses! Then you will be rewarded!");
return 1;
}
if(PizzaJob[playerid] == 2){
PizzaJob[playerid] = 3;
SetPlayerCheckpoint(playerid,807.4531,372.4268,19.3820,10);
return 1;
}
if(PizzaJob[playerid] == 3){
PizzaJob[playerid] = 4;
SetPlayerCheckpoint(playerid,749.0499,258.3000,27.0859,10);
return 1;
}
if(PizzaJob[playerid] == 4){
PizzaJob[playerid] = 5;
SetPlayerCheckpoint(playerid,248.2986,-31.9731,1.5781,10);
return 1;
}
if(PizzaJob[playerid] == 5){
PizzaJob[playerid] = 6;
SetPlayerCheckpoint(playerid,251.4354,-287.8364,1.5836,10);
return 1;
}
if(PizzaJob[playerid] == 6){
PizzaJob[playerid] = 7;
SetPlayerCheckpoint(playerid,745.2696,-554.4398,18.0129,10);
return 1;
}
if(PizzaJob[playerid] == 7){
PizzaJob[playerid] = 8;
SetPlayerCheckpoint(playerid,794.0338,-507.9911,18.0129,10);
return 1;
}
if(PizzaJob[playerid] == 8){
PizzaJob[playerid] = 9;
SetPlayerCheckpoint(playerid,1079.9202,-345.0044,73.9922,10);
return 1;
}
if(PizzaJob[playerid] == 9){
PizzaJob[playerid] = 10;
SetPlayerCheckpoint(playerid,2236.6624,166.5144,28.1535,10);
return 1;
}
if(PizzaJob[playerid] == 10){
PizzaJob[playerid] = 11;
SetPlayerCheckpoint(playerid,1361.2267,229.9569,19.5669,10);
return 1;
}
if(PizzaJob[playerid] == 11){
PizzaJob[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_RED,"* Montgomery Pizza Co. has payed you $737 for delivering their pizzas.");
GivePlayerMoney(playerid,737);
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PizzaJob[playerid] > 0)
{
PizzaJob[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "* The pizza's have gotten cold and you failed to deliver them!");
DisablePlayerCheckpoint(playerid);
}
}
//* Credit to Ryan39 and Blazed *//