PHP Code:
#include <a_samp> // Include
new HotDog[MAX_PLAYERS]; // HotDog Job
new NextHDogs[][] =
{
{float:685.0278,float:-1594.2223,float:13.6814,10},
{float:481.5592,float:-1531.8152,float:19.3227,10},
{float:505.4998,float:-1357.8823,float:15.6998,10},
{float:667.5136,float:-1275.0409,float:13.0354,10},
{float:778.4696,float:-1149.0485,float:22.8772,10},
{float:763.7077,float:-1362.9611,float:13.5233,10}
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/hotdogs",true,strlen(cmdtext)))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 588)
{
HotDog[playerid] = 1;
new name[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "{0000FF}[RgX:INFO]{FF0000}%s {FFFFFF}is now a Hotdog Delivery.", name );
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid, 763.7077,-1362.9611,13.5233);
SetPlayerCheckpoint(playerid, 804.1773,-1455.8715,13.1253,10);
SendClientMessage(playerid, -1,"{00FFFF}Job{FFFFFF}: Follow the red markers");
return 1;
}
SendClientMessage(playerid, -1,"{CE0000}You have to be on a Hotdogs car to start the job!");
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 588)\
SendClientMessage(playerid, -1, "{FFFFFF}Job: You can start the Hotdogs job by using {00FF00}/hotdogs");
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 588)
{
for(new i,j=sizeof(NextHDogs); i<j; i++)
{
if(HotDog[playerid] == i && HotDog[playerid] != 7)
{
HotDog[playerid]++;
SetPlayerCheckpoint(playerid,NextHDogs[i][0],NextHDogs[i][1],NextHDogs[i][2],NextHDogs[i][3]);
} else if(HotDog[playerid] == 7) {
HotDog[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, -1,"{FF0000}Job{FFFFFF}: You have recieved {FF0000}$250000 {FFFFFF}for delivering the Hotdog");
GivePlayerMoney(playerid,250000);
}
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(HotDog[playerid] > 0)
{
HotDog[playerid] = 0;
SendClientMessage(playerid, -1, "{FF0000}Job{FFFFFF}: You have left your job");
DisablePlayerCheckpoint(playerid);
}
}