Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(PlayerInfo[playerid][pJailed] == 2)
{
new string[256];
SendClientMessage(playerid, COLOR_LIGHTRED, "~ Do not bug abuse or get banned! ~");
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "[SERVER]: %s has been trying to prisonbreak from admin jail!", giveplayer);
ABroadCast(COLOR_YELLOW,string,1);
}
if (dying[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "~ You can`t drive when you are dying! ~");
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
}
if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
{
if (IsACopCar(vehicleid) && !ispassenger)
{
if(IsACop(playerid) || IsASheriff(playerid)) {}
else {
//WantedPoints[playerid]+=2;
//SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
if(!ispassenger) {
for(new i=0; i<MAX_PLAYERS; i++) {
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
new Float:cx, Float:cy, Float:cz;
new Float:ccx, Float:ccy, Float:ccz;
if(IsACop(playerid)) {
GetPlayerPos(playerid, ccx, ccy, ccz);
GetPlayerPos(i, cx, cy, cz);
SetPlayerPos(i, ccx - 5, ccy, ccz);
PlayerCuffed[i] = 1;
PlayerCuffedTime[i] = 9999;
}
return 1;
}
}
return 1;
}
if(IsACashCab(vehicleid) && ispassenger) {
SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You have just entered the cash cab!");
SendClientMessage(playerid, COLOR_GREEN, "You will be asked questions on your way to your destination and will win money for answering them correctly");
InCashCab[playerid] = 1;
GiveCash(playerid, -CashCabFare);
}
if(IsAGarageCar(vehicleid) && !ispassenger)
{
if(IsAGarageMan(playerid)) {}
else {
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
/*if (IsASheriffCar(vehicleid) && !ispassenger)
{
if(IsASheriff(playerid) || IsACop(playerid)) {}
else {
SendClientMessage(playerid,COLOR_GRAD2,"A warrant has been added for your arrest:Reason:Driving a cop car");
if(WantedPoints[playerid] == 0) { WantedPoints[playerid] = 3; }
else { WantedPoints[playerid]+= 2; }
SetPlayerCriminalEx(playerid,playerid, result);}
}
}
if(!ispassenger)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GRAD2,"A warrant has been added for your arrest:Reason:Stealing a car");
if(WantedPoints[playerid] == 0) { WantedPoints[playerid] = 3; }
else { WantedPoints[playerid]+= 2; }
SetPlayerCriminalEx(playerid,playerid, result);}
}
}
}*/
if (IsAnAmbulance(vehicleid) && !ispassenger)
{
if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
else
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if (GetPlayerState(playerid) == 1)
{
return 1;
}
if(dying[playerid] == 1){TogglePlayerControllable(playerid, 0); ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);}
AffectVehicleDamageToPlayer(playerid,vehicleid,0);
if(IsAHarvest(vehicleid))
{
if(FarmerVar[playerid] == 1)
{
SetTimer("FarmerExit", 7000, 0);
GameTextForPlayer(playerid, "~n~~w~You have ~r~7~w~ seconds~n~to get back on a harvest", 5000, 3);
}
}
if(IsADrugHarvest(vehicleid))
{
if(DrugFarmerVar[playerid] == 1)
{
SetTimer("DrugFarmerExit", 7000, 0);
GameTextForPlayer(playerid, "~n~~w~You have ~b~7~w~ seconds~n~to get back on a harvest", 5000, 3);
}
}
if(IsADmv(vehicleid))
{
}
if(IsASmuggleCar(vehicleid))
{
if(SmugglerWork[playerid] == 1)
{
SetTimer("SmugglerExit", 7000, 0);
GameTextForPlayer(playerid, "~n~~w~You have ~r~7~w~ seconds~n~to get back in car", 5000, 3);
}
}
if(gGas[playerid] == 1)
{
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~Left car", 500, 3);
}
if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0)
{
BusrouteEnd(playerid, vehicleid);
}
if(IsACashCab(vehicleid)) {
for(new i=0; i<=PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(CashCabPayout[i] > 0) {
SendClientMessage(i, COLOR_GREEN, "You have won some money in the cash cab!");
GiveCash(i, CashCabPayout[i]);
CashCabPayout[i] = 0;
InCashCab[i] = 0;
} else {
SendClientMessage(i, COLOR_LIGHTRED, "Sorry but you have not won anything in the cash cab");
}
}
}
}
if (IsABus(vehicleid))
{
for (new i=0; i<=PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (BusrouteEast[i][0] != 0 && BusrouteEast[i][1] == vehicleid)
{
GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~g~Passenger Left The Bus", 5000, 3);
}
else if (BusrouteWest[i][0] != 0 && BusrouteWest[i][1] == vehicleid)
{
GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~g~Passenger Left The Bus", 5000, 3);
}
}
}
}
if(SeatBelt[playerid]==true)
{
new string[256];
SeatBelt[playerid]=false;
format(string, sizeof(string), "* %s unbuckles his/her seat belt", GetPlayerNameEx(playerid));
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
Code:
if(strcmp(cmd, "/ccfare", true) == 0) {
if(IsPlayerConnected(playerid)) {
if(IsACashCabDriver(playerid)) {
new moneys;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ccfare [price]");
return 1;
}
moneys = strval(tmp);
if(moneys > 0 && moneys < 7501) {
CashCabFare = moneys;
format(string, sizeof(string), "Cash Cab Driver %s is on duty with a entry fee of %d", sendername, CashCabFare);
OOCNews(TEAM_GROVE_COLOR, string);
} else {
SendClientMessage(playerid, COLOR_GREY, "Fare cannot be higher than 7500");
}
} else {
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command");
}
}
return 1;
}
if(strcmp(cmd, "/payout", true) == 0) {
if(IsPlayerConnected(playerid)) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREY, "USAGE: /payout [playerid/PartOfName] [amount]");
return 1;
}
new playa;
new money;
new tmpcar = GetPlayerVehicleID(playerid);
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if(IsACashCabDriver(playerid)) {
if(IsPlayerConnected(playa)) {
if(playa != INVALID_PLAYER_ID) {
if(GetDistanceBetweenPlayers(playerid, playa) < 16) {
if(InCashCab[playa] == 1) {
if(IsACashCab(tmpcar)) {
CashCabPayout[playa] = CashCabPayout[playa] + money;
format(string, sizeof(string), "You have earned $%d more in the cash cab!", money);
SendClientMessage(playa, COLOR_GREEN, string);
} else {
SendClientMessage(playerid, COLOR_GREY, "You are not in a cash cab");
}
} else {
SendClientMessage(playerid, COLOR_GREY, "That person is not in a cab");
}
} else {
SendClientMessage(playerid, COLOR_GREY, "That player is not in your cash cab");
}
}
} else {
SendClientMessage(playerid, COLOR_GREY, "Player is unexistant");
}
} else {
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command");
}
}
return 1;
}
if(strcmp(cmd, "/question", true) == 0) {
new tmpcar = GetPlayerVehicleID(playerid);
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_GREY, "USAGE: /question [1-15]");
return 1;
}
if(IsACashCab(tmpcar)) {
if(strcmp(x_nr, "1", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack (Obama)");
} else if(strcmp(x_nr, "2", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current dictator of North Korea?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Kim Jon Il");
} else if(strcmp(x_nr, "3", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: What is 2 + 2 x 2?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "6");
} else if(strcmp(x_nr, "4", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who was the singer who created the song nicknamed (The Rick Roll)?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Rick Astley");
} else if(strcmp(x_nr, "5", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: What is the name of 1 of the 6 gangs fighting the Grove Street Famliies?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Da Nang Boys/Triads/San Fierro (Rifa)/Los Santos (Vagos)/Varios Los (Aztecas)/The (Ballas)");
} else if(strcmp(x_nr, "6", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: What is Zero's RC Shop?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "A (comic shop)");
} else if(strcmp(x_nr, "7", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: What is the last area you go to in Grand Theft Auto San Andreas?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Los Santos");
} else if(strcmp(x_nr, "8", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who was on CJ's side at the end of the game Grand Theft Auto San ANdreas?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Sweet");
} else if(strcmp(x_nr, "9", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
} else if(strcmp(x_nr, "10", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
} else if(strcmp(x_nr, "11", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
} else if(strcmp(x_nr, "12", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
} else if(strcmp(x_nr, "13", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
} else if(strcmp(x_nr, "14", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
} else if(strcmp(x_nr, "15", true) == 0) {
format(string, sizeof(string), "Cash Cab Driver %s asks: Who is the current president of the united states?", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Barack Obama");
}
} else {
SendClientMessage(playerid, COLOR_GREY, "You are not in a cash cab");
}
return 1;
}