
new Float:Bomb_x[MAX_PLAYERS], Float:Bomb_y[MAX_PLAYERS], Float:Bomb_z[MAX_PLAYERS],Bomb[MAX_PLAYERS],Bomb_car[MAX_PLAYERS], Bomb_e[MAX_PLAYERS];
enum pInfo ..... pBomb,
if (strcmp(cmd, "/blowup", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerCuffed[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " You cant blow up this bomb you already Cuffed !");
return 1;
}
if(Bomb_e[playerid] != 0 || Bomb_car[playerid] != 0)
{
BlowUpBomb(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Use /placebomb first!");
return 1;
}
}
return 1;
}
if (strcmp(cmd, "/placebomb", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " To bad you are a Cop !");
return 1;
}
if(PlayerCuffed[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " You cant place a bomb you already Cuffed !");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /placebomb [detonator] [time] seconds!!!");
SendClientMessage(playerid, COLOR_GRAD2, "types: 0 = time, 1 = manual");
return 1;
}
new detonator;
detonator = strval(tmp);
if(detonator == 0)
{
tmp = strtok(cmdtext, idx);
new time;
time = strval(tmp);
if(time > 0)
{
if(PlayerInfo[playerid][pBomb] > 0)
{
if(Bomb_car[playerid] != 0 || Bomb_e[playerid] != 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Wait until your other bomb explodes!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
new car = GetPlayerVehicleID(playerid);
Bomb_car[playerid] = car;
format(string, sizeof(string), "You placed a bomb in your vehicle wich will blow up in %d seconds", time);
SendClientMessage(playerid, COLOR_RED2, string);
PlayerInfo[playerid][pBomb] -=1;
}
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
Bomb_x[playerid] = x;
Bomb_y[playerid] = y;
Bomb_z[playerid] = z;
Bomb[playerid] = CreateStreamObject(1654,Bomb_x[playerid],Bomb_y[playerid],Bomb_z[playerid]-0.958,270.0,0.0,00.00,200.0);
format(string, sizeof(string), "You placed a bomb wich will blow up in %d seconds", time);
SendClientMessage(playerid, COLOR_RED2, string);
PlayerInfo[playerid][pBomb] -= 1;
format(string, sizeof(string), "You have %d bombs left.", PlayerInfo[playerid][pBomb]);
SendClientMessage(playerid, COLOR_RED2, string);
Bomb_e[playerid] = 1;
}
SetTimerEx("BlowUpBomb", time*1000, 0, "i", playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You don't have a bomb!");
return 1;
}
}
}
else
{
if(PlayerInfo[playerid][pBomb] > 0)
{
if(Bomb_car[playerid] != 0 || Bomb_e[playerid] != 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Wait until your other bomb explodes!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
new car = GetPlayerVehicleID(playerid);
Bomb_car[playerid] = car;
format(string, sizeof(string), "You placed a bomb in your vehicle. Use /blowup to blow up the bomb.");
SendClientMessage(playerid, COLOR_RED2, string);
PlayerInfo[playerid][pBomb] -=1;
}
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
Bomb_x[playerid] = x;
Bomb_y[playerid] = y;
Bomb_z[playerid] = z;
Bomb[playerid] = CreateStreamObject(1654,Bomb_x[playerid],Bomb_y[playerid],Bomb_z[playerid]-0.958,270.0,0.0,00.00,200.0);
format(string, sizeof(string), "You placed a bomb. Use /blowup to blow up the bomb.");
SendClientMessage(playerid, COLOR_RED2, string);
PlayerInfo[playerid][pBomb] -= 1;
Bomb_e[playerid] = 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You don't have a bomb!");
return 1;
}
}
}
return 1;
}
if (strcmp(cmd, "/buygun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerMoney(playerid) < 1)
{
SendClientMessage(playerid, COLOR_GREY, " You dont have enough money with you !");
return 1;
}
new gun;
new gunid[16];
new gunstring1[256];
new gunstring2[256];
new gunstring3[256];
new gunstring4[256];
new gunstring5[256];
new infostring[256];
new guncharge;
new ammocharge;
new location = PlayerInfo[playerid][pLocal];
if(location == 99 || location == 100 || location == 102 || location == 104)
{
if(BizzInfo[location-99][bProducts] <= 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
new mod = 100;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "USAGE: /buygun [gunname] [ammoamount]");
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessage(playerid, COLOR_WHITE,"*** Guns & Ammo ***");
SendClientMessage(playerid, COLOR_GRAD2,string);
format(gunstring1, 256, "Weapons: parachute ($%d) golfclub ($%d) nightstick ($%d) baseballbat ($%d) shovel ($%d) poolcue ($%d)",
GunPrice[0][0]/100*mod,GunPrice[1][0]/100*mod,GunPrice[2][0]/100*mod,GunPrice[3][0]/100*mod,GunPrice[4][0]/100*mod,GunPrice[5][0]/100*mod,GunPrice[6][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring1);
format(gunstring2, 256, "Weapons: purpledildo ($%d) whitedildo ($%d) longwhitedildo ($%d) whitedildo2 ($%d) flowers ($%d) cane",
GunPrice[7][0]/100*mod,GunPrice[8][0]/100*mod,GunPrice[9][0]/100*mod,GunPrice[10][0]/100*mod,GunPrice[11][0]/100*mod,GunPrice[12][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring2);
format(gunstring3, 256, "Weapons: sdpistol ($%d) deagle ($%d) mp5 ($%d)",
GunPrice[13][0]/100*mod,GunPrice[14][0]/100*mod,GunPrice[15][0]/100*mod,GunPrice[16][0]/100*mod,GunPrice[17][0]/100*mod,GunPrice[18][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring3);
format(gunstring4, 256, "Weapons: shotgun ($%d) ak47 ($%d) m4 ($%d) rifle ($%d)",
GunPrice[19][0]/100*mod,GunPrice[20][0]/100*mod,GunPrice[21][0]/100*mod,GunPrice[22][0]/100*mod,GunPrice[23][0]/100*mod,GunPrice[24][0]/100*mod);
SendClientMessage(playerid, COLOR_GRAD3, gunstring4);
format(gunstring5, 256, "Weapons: pistolammo ($%d) shotgunammo ($%d) smgammo ($%d) assaultammo ($%d) rifleammo ($%d)",
GunPrice[25][0],GunPrice[26][0],GunPrice[27][0],GunPrice[28][0],GunPrice[29][0]);
SendClientMessage(playerid, COLOR_GRAD3, gunstring5);
SendClientMessage(playerid, COLOR_GRAD3, "Weapons: bomb ($150000)");
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "USAGE: /buygun [gunname] [ammoamount]");
return 1;
}
new ammo = strval(tmp);
if(ammo < 1 || ammo > 999) { SendClientMessage(playerid, COLOR_GREY, " Ammo ammount not lower then 1 or higher then 999 !"); return 1; }
if (strcmp(gunid, "parachute", true, strlen(gunid)) == 0)
{
gun = 46;
guncharge = GunPrice[0][0]/100*mod;
ammocharge = 0;
}
else if (strcmp(gunid, "golfclub", true, strlen(gunid)) == 0)
{
gun = 2; guncharge = GunPrice[1][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 2; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "nightstick", true, strlen(gunid)) == 0)
{
gun = 3; guncharge = GunPrice[2][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 3; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "baseballbat", true, strlen(gunid)) == 0)
{
gun = 5; guncharge = GunPrice[4][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 5; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "shovel", true, strlen(gunid)) == 0)
{
gun = 6; guncharge = GunPrice[5][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 6; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "poolcue", true, strlen(gunid)) == 0)
{
gun = 7; guncharge = GunPrice[6][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 7; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "purpledildo", true, strlen(gunid)) == 0)
{
gun = 10; guncharge = GunPrice[7][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 10; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "whitedildo", true, strlen(gunid)) == 0)
{
gun = 11; guncharge = GunPrice[8][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 11; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "longwhitedildo", true, strlen(gunid)) == 0)
{
gun = 12; guncharge = GunPrice[9][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 12; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "whitedildo2", true, strlen(gunid)) == 0)
{
gun = 13; guncharge = GunPrice[10][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 13; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "flowers", true, strlen(gunid)) == 0)
{
gun = 14; guncharge = GunPrice[11][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 14; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "cane", true, strlen(gunid)) == 0)
{
gun = 15; guncharge = GunPrice[12][0]/100*mod; ammocharge = 0;
PlayerInfo[playerid][pGun1] = 15; PlayerInfo[playerid][pAmmo1] = 1;
}
else if (strcmp(gunid, "sdpistol", true, strlen(gunid)) == 0)
{
gun = 23; guncharge = GunPrice[13][0]/100*mod; ammocharge = GunPrice[25][0]*ammo;
PlayerInfo[playerid][pGun2] = 23; PlayerInfo[playerid][pAmmo2] = ammo;
}
else if (strcmp(gunid, "deagle", true, strlen(gunid)) == 0)
{
gun = 24; guncharge = GunPrice[15][0]/100*mod; ammocharge = GunPrice[25][0]*ammo;
PlayerInfo[playerid][pGun2] = 24; PlayerInfo[playerid][pAmmo2] = ammo;
}
else if (strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
{
gun = 29; guncharge = GunPrice[18][0]/100*mod; ammocharge = GunPrice[27][0]*ammo;
PlayerInfo[playerid][pGun3] = 29; PlayerInfo[playerid][pAmmo3] = ammo;
}
else if (strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
{
gun = 25; guncharge = GunPrice[19][0]/100*mod; ammocharge = GunPrice[26][0]*ammo;
PlayerInfo[playerid][pGun3] = 25; PlayerInfo[playerid][pAmmo3] = ammo;
}
else if (strcmp(gunid, "ak47", true, strlen(gunid)) == 0)
{
gun = 30; guncharge = GunPrice[22][0]/100*mod; ammocharge = GunPrice[28][0]*ammo;
PlayerInfo[playerid][pGun4] = 30; PlayerInfo[playerid][pAmmo4] = ammo;
}
else if (strcmp(gunid, "m4", true, strlen(gunid)) == 0)
{
gun = 31; guncharge = GunPrice[23][0]/100*mod; ammocharge = GunPrice[28][0]*ammo;
PlayerInfo[playerid][pGun4] = 31; PlayerInfo[playerid][pAmmo4] = ammo;
}
else if (strcmp(gunid, "rifle", true, strlen(gunid)) == 0)
{
gun = 33; guncharge = GunPrice[24][0]/100*mod; ammocharge = GunPrice[29][0]*ammo;
PlayerInfo[playerid][pGun4] = 33; PlayerInfo[playerid][pAmmo4] = ammo;
}
else if (strcmp(gunid, "bomb", true, strlen(gunid)) == 0)
{
ammocharge = 75000;
guncharge = 75000;
gun = 999;
}
else
{
SendClientMessage(playerid, COLOR_GRAD6, "ShopKeeper says: I have never heard of that weapon.");
return 1;
}
if((guncharge+ammocharge) > GetPlayerMoney(playerid))
{
format(infostring, 256, " You don't have $%d !",guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
return 1;
}
if(GetPlayerMoney(playerid) < (guncharge+ammocharge))
{
SendClientMessage(playerid, COLOR_GREY, " Can't afford that !");
return 1;
}
if(gun == 999)
{
ammo = 1;
}
new payout = guncharge + ammocharge;
format(infostring, 256, "You have purchased %s with %d ammo for $%d",gunid,ammo,payout);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
if(location == 102 && IsACop(playerid)) { }
else { GivePlayerMoney(playerid, - payout); }
if(gun != 999) { BizzInfo[location-99][bTill] += payout; ExtortionBiz(location-99, payout); }
else { BizzInfo[location-99][bTill] += 15000; ExtortionBiz(location-99, 15000); }
BizzInfo[location-99][bProducts]-=2;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
if(gun != 999) { PlayerWeapons[playerid] = 1; GivePlayerWeapon(playerid, gun, ammo); }
else { PlayerInfo[playerid][pBomb] += ammo; }
if(IsACop(playerid) && OnDuty[playerid] < 1) { PlayerInfo[playerid][pBomb] = 0; }
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s bought weapons for $%d at biz %d", sendername, payout, location-99);
printf("%s", string);
PayLog(string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"You are not in a store.");
return 1;
}
}
return 1;
}
forward BlowUpBomb(playerid);
public BlowUpBomb(playerid)
{
if(Bomb_car[playerid] != 0)
{
new Float:x, Float:y, Float:z;
GetVehiclePos(Bomb_car[playerid], x, y, z);
CreateExplosion(x, y, z, 7, 45.0);
SetVehicleHealth(Bomb_car[playerid], 10);
Bomb_car[playerid] = 0;
CreateExplosion(x+10,y,z,7,45.0);
CreateExplosion(x,y+10,z,7,45.0);
CreateExplosion(x-10,y,z,7,45.0);
CreateExplosion(x,y-10,z,7,45.0);
}
else
{
CreateExplosion(Bomb_x[playerid], Bomb_y[playerid], Bomb_z[playerid], 7, 45.0);
DestroyStreamObject(Bomb[playerid]);
Bomb_e[playerid] = 0;
CreateExplosion(Bomb_x[playerid]+10,Bomb_y[playerid],Bomb_z[playerid],7,45.0);
CreateExplosion(Bomb_x[playerid],Bomb_y[playerid]+10,Bomb_z[playerid],7,45.0);
CreateExplosion(Bomb_x[playerid]-10,Bomb_y[playerid],Bomb_z[playerid],7,45.0);
CreateExplosion(Bomb_x[playerid],Bomb_y[playerid]-10,Bomb_z[playerid],7,45.0);
for(new v = 0; v < 700; v++)
{
if(VehicleToPoint(30.0, v, Bomb_x[playerid], Bomb_y[playerid], Bomb_z[playerid]))
{
SetVehicleHealth(v, 10);
}
}
}
SendClientMessage(playerid, COLOR_RED2, "Your bomb exploded");
WantedPoints[playerid]+= 12;
SetPlayerCriminal(playerid, 255, "Planted a bomb");
return 1;
}
forward VehicleToPoint(Float:radi, vehicleid, Float:x, Float:y, Float:z);
public VehicleToPoint(Float:radi, vehicleid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetVehiclePos(vehicleid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
new sweeper1, sweeper2, sweeper3, sweeper4, sweeper5; sweeper1 = AddStaticVehicle..... sweeper2 = AddStaticVehicle..... sweeper3 = AddStaticVehicle..... sweeper4 = AddStaticVehicle..... sweeper5 = AddStaticVehicle..... //Add your car spawns here
forward PlayerInSweeper(playerid);
public PlayerInSweeper(playerid)
{
new v = GetPlayerVehicleID(playerid);
if(v == sweeper1 || v == sweeper2 || v == sweeper3 || v == sweeper4 || v == sweeper5)
{
return 1;
}
return 0;
}
public DefineSanitaryCoords()
{
new a = 1;
new c = 1;
check_X[a][c] = -2044.27;
check_Y[a][c] = 26.70;
check_Z[a][c] = 34.73;
c = 2;
check_X[a][c] = -2004.65;
check_Y[a][c] = 36.23;
check_Z[a][c] = 32.37;
c = 3;
check_X[a][c] = -2004.07;
check_Y[a][c] = 82.01;
check_Z[a][c] = 27.10;
c = 4;
check_X[a][c] = -1986.38;
check_Y[a][c] = 146.26;
check_Z[a][c] = 27.25;
c = 5;
check_X[a][c] = -2000.53;
check_Y[a][c] = 285.16;
check_Z[a][c] = 33.30;
c = 6;
check_X[a][c] = -1999.61;
check_Y[a][c] = 363.80;
check_Z[a][c] = 34.58;
c = 7;
check_X[a][c] = -1999.22;
check_Y[a][c] = 497.70;
check_Z[a][c] = 34.58;
c = 8;
check_X[a][c] = -1999.80;
check_Y[a][c] = 609.55;
check_Z[a][c] = 34.58;
c = 9;
check_X[a][c] = -2000.11;
check_Y[a][c] = 718.56;
check_Z[a][c] = 44.86;
c = 10;
check_X[a][c] = -2000.27;
check_Y[a][c] = 882.40;
check_Z[a][c] = 44.86;
c = 11;
check_X[a][c] = -2000.24;
check_Y[a][c] = 994.52;
check_Z[a][c] = 49.31;
c = 12;
check_X[a][c] = -1958.80;
check_Y[a][c] = 1052.75;
check_Z[a][c] = 55.13;
c = 13;
check_X[a][c] = -1888.17;
check_Y[a][c] = 1030.86;
check_Z[a][c] = 42.86;
c = 14;
check_X[a][c] = -1903.32;
check_Y[a][c] = 820.79;
check_Z[a][c] = 34.58;
c = 15;
check_X[a][c] = -1901.85;
check_Y[a][c] = 744.22;
check_Z[a][c] = 45.01;
c = 16;
check_X[a][c] = -1903.04;
check_Y[a][c] = 618.63;
check_Z[a][c] = 34.58;
c = 17;
check_X[a][c] = -1853.70;
check_Y[a][c] = 529.99;
check_Z[a][c] = 33.56;
c = 18;
check_X[a][c] = -1837.96;
check_Y[a][c] = 440.71;
check_Z[a][c] = 16.92;
c = 19;
check_X[a][c] = -1783.00;
check_Y[a][c] = 338.25;
check_Z[a][c] = 12.21;
c = 20;
check_X[a][c] = -1714.53;
check_Y[a][c] = 332.47;
check_Z[a][c] = 6.59;
c = 21;
check_X[a][c] = -1629.90;
check_Y[a][c] = 416.55;
check_Z[a][c] = 6.59;
c = 22;
check_X[a][c] = -1558.33;
check_Y[a][c] = 536.91;
check_Z[a][c] = 6.59;
c = 23;
check_X[a][c] = -1555.45;
check_Y[a][c] = 674.11;
check_Z[a][c] = 6.60;
c = 24;
check_X[a][c] = -1555.20;
check_Y[a][c] = 828.63;
check_Z[a][c] = 6.60;
c = 25;
check_X[a][c] = -1579.22;
check_Y[a][c] = 1035.18;
check_Z[a][c] = 6.60;
c = 26;
check_X[a][c] = -1579.56;
check_Y[a][c] = 1142.27;
check_Z[a][c] = 6.60;
c = 27;
check_X[a][c] = -1688.83;
check_Y[a][c] = 1309.42;
check_Z[a][c] = 6.61;
c = 28;
check_X[a][c] = -1873.07;
check_Y[a][c] = 1358.84;
check_Z[a][c] = 6.60;
c = 29;
check_X[a][c] = -1979.46;
check_Y[a][c] = 1312.17;
check_Z[a][c] = 6.60;
c = 30;
check_X[a][c] = -2221.86;
check_Y[a][c] = 1336.13;
check_Z[a][c] = 6.60;
c = 31;
check_X[a][c] = -2599.19;
check_Y[a][c] = 1336.86;
check_Z[a][c] = 6.60;
c = 32;
check_X[a][c] = -2775.36;
check_Y[a][c] = 1294.87;
check_Z[a][c] = 5.53;
c = 33;
check_X[a][c] = -2845.39;
check_Y[a][c] = 976.94;
check_Z[a][c] = 43.09;
c = 34;
check_X[a][c] = -2747.28;
check_Y[a][c] = 842.69;
check_Z[a][c] = 57.78;
c = 35;
check_X[a][c] = -2748.66;
check_Y[a][c] = 996.48;
check_Z[a][c] = 53.88;
c = 36;
check_X[a][c] = -2499.37;
check_Y[a][c] = 1233.99;
check_Z[a][c] = 34.58;
c = 37;
check_X[a][c] = -2453.65;
check_Y[a][c] = 1253.12;
check_Z[a][c] = 31.32;
c = 38;
check_X[a][c] = -2123.52;
check_Y[a][c] = 1326.41;
check_Z[a][c] = 6.60;
c = 39;
check_X[a][c] = -1653.31;
check_Y[a][c] = 1230.03;
check_Z[a][c] = 6.60;
c = 40;
check_X[a][c] = -1562.97;
check_Y[a][c] = 741.46;
check_Z[a][c] = 6.60;
c = 41;
check_X[a][c] = -1698.11;
check_Y[a][c] = 360.39;
check_Z[a][c] = 6.59;
c = 42;
check_X[a][c] = -1851.78;
check_Y[a][c] = 531.93;
check_Z[a][c] = 33.51;
c = 43;
check_X[a][c] = -2008.80;
check_Y[a][c] = 534.09;
check_Z[a][c] = 34.58;
c = 44;
check_X[a][c] = -2010.80;
check_Y[a][c] = 133.35;
check_Z[a][c] = 27.10;
c = 45;
check_X[a][c] = -2069.39;
check_Y[a][c] = 33.14;
check_Z[a][c] = 34.73;
check_idx[a] = 45;
a = 2;
c = 1;
check_X[a][c] = -2064.02;
check_Y[a][c] = 9.50;
check_Z[a][c] = 35.04;
c = 2;
check_X[a][c] = -2066.99;
check_Y[a][c] = 9.50;
check_Z[a][c] = 35.04;
c = 3;
check_X[a][c] = -2070.00;
check_Y[a][c] = 9.50;
check_Z[a][c] = 35.04;
c = 4;
check_X[a][c] = -2072.98;
check_Y[a][c] = 9.48;
check_Z[a][c] = 35.04;
c = 5;
check_X[a][c] = -2093.39;
check_Y[a][c] = 30.77;
check_Z[a][c] = 34.73;
c = 6;
check_X[a][c] = -2162.52;
check_Y[a][c] = 31.03;
check_Z[a][c] = 34.74;
c = 7;
check_X[a][c] = -2174.44;
check_Y[a][c] = -173.66;
check_Z[a][c] = 34.73;
c = 8;
check_X[a][c] = -2341.78;
check_Y[a][c] = -188.50;
check_Z[a][c] = 34.73;
c = 9;
check_X[a][c] = -2366.26;
check_Y[a][c] = 34.71;
check_Z[a][c] = 34.74;
c = 10;
check_X[a][c] = -2257.10;
check_Y[a][c] = 49.43;
check_Z[a][c] = 34.74;
c = 11;
check_X[a][c] = -2249.91;
check_Y[a][c] = 311.80;
check_Z[a][c] = 34.74;
c = 12;
check_X[a][c] = -2340.02;
check_Y[a][c] = 456.10;
check_Z[a][c] = 32.52;
c = 13;
check_X[a][c] = -2383.14;
check_Y[a][c] = 664.26;
check_Z[a][c] = 34.46;
c = 14;
check_X[a][c] = -2425.07;
check_Y[a][c] = 1110.77;
check_Z[a][c] = 55.14;
c = 15;
check_X[a][c] = -2606.51;
check_Y[a][c] = 1024.11;
check_Z[a][c] = 75.38;
c = 16;
check_X[a][c] = -2606.65;
check_Y[a][c] = 910.05;
check_Z[a][c] = 64.57;
c = 17;
check_X[a][c] = -2606.59;
check_Y[a][c] = 759.77;
check_Z[a][c] = 36.89;
c = 18;
check_X[a][c] = -2609.28;
check_Y[a][c] = 531.09;
check_Z[a][c] = 14.02;
c = 19;
check_X[a][c] = -2609.17;
check_Y[a][c] = 324.31;
check_Z[a][c] = 3.74;
c = 20;
check_X[a][c] = -2646.19;
check_Y[a][c] = 287.98;
check_Z[a][c] = 3.74;
c = 21;
check_X[a][c] = -2649.15;
check_Y[a][c] = 222.84;
check_Z[a][c] = 3.75;
c = 22;
check_X[a][c] = -2702.83;
check_Y[a][c] = 220.34;
check_Z[a][c] = 3.74;
c = 23;
check_X[a][c] = -2695.30;
check_Y[a][c] = 332.55;
check_Z[a][c] = 3.75;
c = 24;
check_X[a][c] = -2670.12;
check_Y[a][c] = 412.57;
check_Z[a][c] = 3.70;
c = 25;
check_X[a][c] = -2749.57;
check_Y[a][c] = 399.87;
check_Z[a][c] = 3.70;
c = 26;
check_X[a][c] = -2708.89;
check_Y[a][c] = 235.33;
check_Z[a][c] = 3.74;
c = 27;
check_X[a][c] = -2707.34;
check_Y[a][c] = -61.01;
check_Z[a][c] = 3.75;
c = 28;
check_X[a][c] = -2492.00;
check_Y[a][c] = -71.10;
check_Z[a][c] = 24.84;
c = 29;
check_X[a][c] = -2294.69;
check_Y[a][c] = -71.94;
check_Z[a][c] = 34.73;
c = 30;
check_X[a][c] = -2136.29;
check_Y[a][c] = -72.68;
check_Z[a][c] = 34.73;
c = 31;
check_X[a][c] = -2074.23;
check_Y[a][c] = 15.66;
check_Z[a][c] = 34.88;
check_idx[a] = 31;
}
// This DefineSanitaryCoords must be called in GameModeInit !!!!!
OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
if(PlayerInfo[playerid][checkpoint] == check_idx[PlayerInfo[playerid][sweeper]])
{
SendClientMessage(playerid, COLOR_GREEN, "* You cleaned the streets *");
GivePlayerMoney(playerid, 2000);
PlayerInfo[playerid][checkpoint] = 0;
PlayerInfo[playerid][sweeper] = 0;
}
else
{
PlayerInfo[playerid][checkpoint] += 1;
new a, c;
a = PlayerInfo[playerid][sweeper];
c = PlayerInfo[playerid][checkpoint];
SetPlayerRaceCheckpoint(playerid, 0, check_X[a][c], check_Y[a][c], check_Z[a][c], check_X[a][c+1], check_Y[a][c+1], check_Z[a][c+1], 10);
}
}
}
OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerInfo[playerid][checkpoint] != 0)
{
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][checkpoint] = 0;
PlayerInfo[playerid][sweeper] = 0;
}
}
if(strcmp(cmd, "/cleanstreets", true) == 0)
{
if(PlayerInSweeper(playerid))
{
new r = random(3);
new b;
if(r == 0 || r == 1)
{
b = 1;
}
else
{
b = 2;
}
if(PlayerInfo[playerid][sweeper] == 0)
{
PlayerInfo[playerid][checkpoint] = 1;
PlayerInfo[playerid][sweeper] = b;
SetPlayerRaceCheckpoint(playerid, 0, check_X[b][1], check_Y[b][1], check_Z[b][1], check_X[b][2], check_Y[b][2], check_Z[b][2], 10);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, " You already started cleaning!");
return 1;
}
}
return 1;
}
Paintball with fog & different weapons
if(strcmp(cmd,"/startpaintball",true)==0)
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pPbiskey] == 110)
{
if(PaintballRound != 1 && StartingPaintballRound != 1)
{
StartingPaintballRound = 1;
SetTimer("PreparePaintball", 25000, 0);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2,"You are not the Paintball owner!");
}
return 1;
}
if (strcmp(cmd, "/paintballweapon", true) == 0)
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pPbiskey] == 110)
{
new gunid[16];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "USAGE: /paintballweapon [weapon]");
SendClientMessage(playerid, COLOR_GRAD2, string);
SendClientMessage(playerid, COLOR_GRAD2, "Available weapons: mp5, m4, shotgun, deagle, sniper");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
if(strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: mp5");
PaintballWeapon = 29;
}
if(strcmp(gunid, "m4", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: m4");
PaintballWeapon = 31;
}
if(strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: shotgun");
PaintballWeapon = 25;
}
if(strcmp(gunid, "deagle", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: deagle");
PaintballWeapon = 24;
}
if(strcmp(gunid, "sniper", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: sniper");
PaintballWeapon = 34;
}
}
return 1;
}
if(strcmp(cmd, "/paintballfog", true) == 0)
{
if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pPbiskey] == 110)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /paintballfog [on/off (1/0)])");
return 1;
}
new lights;
lights = strval(tmp);
if(lights == 0) { PaintballLights = 0; SendClientMessage(playerid, COLOR_GRAD2, "Lights deactivated"); }
else { PaintballLights = 1; SendClientMessage(playerid, COLOR_GRAD2, "Lights activated"); }
}
return 1;
}
public PreparePaintball()
{
SBizzInfo[10][sbLocked] = 1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerPaintballing[i] != 0)
{
SendClientMessage(i, COLOR_YELLOW, "Paintball Match will start in 20 seconds.");
}
}
}
if(PaintballLights == 1)
{
pb1 = CreateStreamObject(2780, -424.4894,2244.1006,41.0297, 0.0, 0.0, 0.0, 200.0); //nebelwerfer
pb2 = CreateStreamObject(2780, -444.2784,2229.9668,41.0297, 0.0, 0.0, 0.0, 200.0);
pb3 = CreateStreamObject(2780, -412.7010,2236.1665,41.0297, 0.0, 0.0, 0.0, 200.0);
pb4 = CreateStreamObject(2780, -395.0357,2222.0054,41.0297, 0.0, 0.0, 0.0, 200.0);
pb5 = CreateStreamObject(2780, -391.2655,2245.9839,41.0864, 0.0, 0.0, 0.0, 200.0);
pb6 = CreateStreamObject(2780, -379.0988,2250.5029,41.0847, 0.0, 0.0, 0.0, 200.0);
pb7 = CreateStreamObject(2780, -372.8440,2231.3389,41.0844, 0.0, 0.0, 0.0, 200.0);
pb8 = CreateStreamObject(2780, -355.1347,2210.4773,41.0844, 0.0, 0.0, 0.0, 200.0);
pb9 = CreateStreamObject(2780, -379.2328,2213.9641,41.0937, 0.0, 0.0, 0.0, 200.0);
pb10 = CreateStreamObject(2780, -379.0988,2250.5029,40.8847, 0.0, 0.0, 0.0, 200.0);
pb11 = CreateStreamObject(2780, -360.6726,2246.6438,41.0844, 0.0, 0.0, 0.0, 200.0);
pb12 = CreateStreamObject(2780, -416.7401,2199.7825,41.0297, 0.0, 0.0, 0.0, 200.0);
pb13 = CreateStreamObject(2780, -435.0857,2211.9426,41.0297, 0.0, 0.0, 0.0, 200.0);
pb14 = CreateStreamObject(2780, -399.0452,2264.4978,40.4586, 0.0, 0.0, 0.0, 200.0);
}
SetTimer("StartPaintball", 20000, 0);
return 1;
}
public StartPaintball()
{
PaintballRound = 1;
StartingPaintballRound = 0;
PaintballWinner = 999;
PaintballWinnerKills = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerPaintballing[i] != 0)
{
ResetPlayerWeapons(i);
GivePlayerWeapon(i, PaintballWeapon, 10000);
TogglePlayerControllable(i, 1);
SetPlayerArmour(i, 0);
SetPlayerHealth(i, 100);
SendClientMessage(i, COLOR_YELLOW, "Paintball Match started, 8 minutes left.");
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
}
}
}
SetTimer("PaintballEnded", 480000, 0);
return 1;
}
public PaintballEnded()
{
new string[256];
new name[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerPaintballing[i] != 0)
{
if(IsPlayerConnected(PaintballWinner))
{
GetPlayerName(PaintballWinner, name, sizeof(name));
format(string,sizeof(string), "** %s won the Paintball Match with %d kills **",name,PaintballWinnerKills);
SendClientMessage(i, COLOR_WHITE, string);
}
ResetPlayerWeapons(i);
PlayerPaintballing[i] = 0;
PlayerPaintballKills[i] = 0;
SetPlayerPos(i, SBizzInfo[10][sbEntranceX],SBizzInfo[10][sbEntranceY],SBizzInfo[10][sbEntranceZ]);
}
}
}
AnnouncedPaintballRound = 0;
PaintballRound = 0;
if(PaintballLights == 1)
{
DestroyStreamObject(pb1); DestroyStreamObject(pb2); DestroyStreamObject(pb3);
DestroyStreamObject(pb4); DestroyStreamObject(pb5); DestroyStreamObject(pb6);
DestroyStreamObject(pb7); DestroyStreamObject(pb8); DestroyStreamObject(pb9);
DestroyStreamObject(pb10); DestroyStreamObject(pb11); DestroyStreamObject(pb12);
DestroyStreamObject(pb13); DestroyStreamObject(pb14);
}
return 1;
}
if(PlayerPaintballing[playerid] != 0)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, PaintballWeapon, 999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
return 1;
}
|
Originally Posted by RDragon
Sanitary Andreas - Cleaning the streets (with checkpoints) Again, add this in pInfo: sweeper, checkpoint, #define MAX_CHECKPOINTS 40 #define MAX_CHECK_ROUTES 5 new check_idx[MAX_CHECK_ROUTES]; new Float:check_X[MAX_CHECK_ROUTES][MAX_CHECKPOINTS]; new Float:check_Y[MAX_CHECK_ROUTES][MAX_CHECKPOINTS]; new Float:check_Z[MAX_CHECK_ROUTES][MAX_CHECKPOINTS]; Code:
new sweeper1, sweeper2, sweeper3, sweeper4, sweeper5; sweeper1 = AddStaticVehicle..... sweeper2 = AddStaticVehicle..... sweeper3 = AddStaticVehicle..... sweeper4 = AddStaticVehicle..... sweeper5 = AddStaticVehicle..... //Add your car spawns here Code:
forward PlayerInSweeper(playerid);
public PlayerInSweeper(playerid)
{
new v = GetPlayerVehicleID(playerid);
if(v == sweeper1 || v == sweeper2 || v == sweeper3 || v == sweeper4 || v == sweeper5)
{
return 1;
}
return 0;
}
public DefineSanitaryCoords()
{
new a = 1;
new c = 1;
check_X[a][c] = -2044.27;
check_Y[a][c] = 26.70;
check_Z[a][c] = 34.73;
c = 2;
check_X[a][c] = -2004.65;
check_Y[a][c] = 36.23;
check_Z[a][c] = 32.37;
c = 3;
check_X[a][c] = -2004.07;
check_Y[a][c] = 82.01;
check_Z[a][c] = 27.10;
c = 4;
check_X[a][c] = -1986.38;
check_Y[a][c] = 146.26;
check_Z[a][c] = 27.25;
c = 5;
check_X[a][c] = -2000.53;
check_Y[a][c] = 285.16;
check_Z[a][c] = 33.30;
c = 6;
check_X[a][c] = -1999.61;
check_Y[a][c] = 363.80;
check_Z[a][c] = 34.58;
c = 7;
check_X[a][c] = -1999.22;
check_Y[a][c] = 497.70;
check_Z[a][c] = 34.58;
c = 8;
check_X[a][c] = -1999.80;
check_Y[a][c] = 609.55;
check_Z[a][c] = 34.58;
c = 9;
check_X[a][c] = -2000.11;
check_Y[a][c] = 718.56;
check_Z[a][c] = 44.86;
c = 10;
check_X[a][c] = -2000.27;
check_Y[a][c] = 882.40;
check_Z[a][c] = 44.86;
c = 11;
check_X[a][c] = -2000.24;
check_Y[a][c] = 994.52;
check_Z[a][c] = 49.31;
c = 12;
check_X[a][c] = -1958.80;
check_Y[a][c] = 1052.75;
check_Z[a][c] = 55.13;
c = 13;
check_X[a][c] = -1888.17;
check_Y[a][c] = 1030.86;
check_Z[a][c] = 42.86;
c = 14;
check_X[a][c] = -1903.32;
check_Y[a][c] = 820.79;
check_Z[a][c] = 34.58;
c = 15;
check_X[a][c] = -1901.85;
check_Y[a][c] = 744.22;
check_Z[a][c] = 45.01;
c = 16;
check_X[a][c] = -1903.04;
check_Y[a][c] = 618.63;
check_Z[a][c] = 34.58;
c = 17;
check_X[a][c] = -1853.70;
check_Y[a][c] = 529.99;
check_Z[a][c] = 33.56;
c = 18;
check_X[a][c] = -1837.96;
check_Y[a][c] = 440.71;
check_Z[a][c] = 16.92;
c = 19;
check_X[a][c] = -1783.00;
check_Y[a][c] = 338.25;
check_Z[a][c] = 12.21;
c = 20;
check_X[a][c] = -1714.53;
check_Y[a][c] = 332.47;
check_Z[a][c] = 6.59;
c = 21;
check_X[a][c] = -1629.90;
check_Y[a][c] = 416.55;
check_Z[a][c] = 6.59;
c = 22;
check_X[a][c] = -1558.33;
check_Y[a][c] = 536.91;
check_Z[a][c] = 6.59;
c = 23;
check_X[a][c] = -1555.45;
check_Y[a][c] = 674.11;
check_Z[a][c] = 6.60;
c = 24;
check_X[a][c] = -1555.20;
check_Y[a][c] = 828.63;
check_Z[a][c] = 6.60;
c = 25;
check_X[a][c] = -1579.22;
check_Y[a][c] = 1035.18;
check_Z[a][c] = 6.60;
c = 26;
check_X[a][c] = -1579.56;
check_Y[a][c] = 1142.27;
check_Z[a][c] = 6.60;
c = 27;
check_X[a][c] = -1688.83;
check_Y[a][c] = 1309.42;
check_Z[a][c] = 6.61;
c = 28;
check_X[a][c] = -1873.07;
check_Y[a][c] = 1358.84;
check_Z[a][c] = 6.60;
c = 29;
check_X[a][c] = -1979.46;
check_Y[a][c] = 1312.17;
check_Z[a][c] = 6.60;
c = 30;
check_X[a][c] = -2221.86;
check_Y[a][c] = 1336.13;
check_Z[a][c] = 6.60;
c = 31;
check_X[a][c] = -2599.19;
check_Y[a][c] = 1336.86;
check_Z[a][c] = 6.60;
c = 32;
check_X[a][c] = -2775.36;
check_Y[a][c] = 1294.87;
check_Z[a][c] = 5.53;
c = 33;
check_X[a][c] = -2845.39;
check_Y[a][c] = 976.94;
check_Z[a][c] = 43.09;
c = 34;
check_X[a][c] = -2747.28;
check_Y[a][c] = 842.69;
check_Z[a][c] = 57.78;
c = 35;
check_X[a][c] = -2748.66;
check_Y[a][c] = 996.48;
check_Z[a][c] = 53.88;
c = 36;
check_X[a][c] = -2499.37;
check_Y[a][c] = 1233.99;
check_Z[a][c] = 34.58;
c = 37;
check_X[a][c] = -2453.65;
check_Y[a][c] = 1253.12;
check_Z[a][c] = 31.32;
c = 38;
check_X[a][c] = -2123.52;
check_Y[a][c] = 1326.41;
check_Z[a][c] = 6.60;
c = 39;
check_X[a][c] = -1653.31;
check_Y[a][c] = 1230.03;
check_Z[a][c] = 6.60;
c = 40;
check_X[a][c] = -1562.97;
check_Y[a][c] = 741.46;
check_Z[a][c] = 6.60;
c = 41;
check_X[a][c] = -1698.11;
check_Y[a][c] = 360.39;
check_Z[a][c] = 6.59;
c = 42;
check_X[a][c] = -1851.78;
check_Y[a][c] = 531.93;
check_Z[a][c] = 33.51;
c = 43;
check_X[a][c] = -2008.80;
check_Y[a][c] = 534.09;
check_Z[a][c] = 34.58;
c = 44;
check_X[a][c] = -2010.80;
check_Y[a][c] = 133.35;
check_Z[a][c] = 27.10;
c = 45;
check_X[a][c] = -2069.39;
check_Y[a][c] = 33.14;
check_Z[a][c] = 34.73;
check_idx[a] = 45;
a = 2;
c = 1;
check_X[a][c] = -2064.02;
check_Y[a][c] = 9.50;
check_Z[a][c] = 35.04;
c = 2;
check_X[a][c] = -2066.99;
check_Y[a][c] = 9.50;
check_Z[a][c] = 35.04;
c = 3;
check_X[a][c] = -2070.00;
check_Y[a][c] = 9.50;
check_Z[a][c] = 35.04;
c = 4;
check_X[a][c] = -2072.98;
check_Y[a][c] = 9.48;
check_Z[a][c] = 35.04;
c = 5;
check_X[a][c] = -2093.39;
check_Y[a][c] = 30.77;
check_Z[a][c] = 34.73;
c = 6;
check_X[a][c] = -2162.52;
check_Y[a][c] = 31.03;
check_Z[a][c] = 34.74;
c = 7;
check_X[a][c] = -2174.44;
check_Y[a][c] = -173.66;
check_Z[a][c] = 34.73;
c = 8;
check_X[a][c] = -2341.78;
check_Y[a][c] = -188.50;
check_Z[a][c] = 34.73;
c = 9;
check_X[a][c] = -2366.26;
check_Y[a][c] = 34.71;
check_Z[a][c] = 34.74;
c = 10;
check_X[a][c] = -2257.10;
check_Y[a][c] = 49.43;
check_Z[a][c] = 34.74;
c = 11;
check_X[a][c] = -2249.91;
check_Y[a][c] = 311.80;
check_Z[a][c] = 34.74;
c = 12;
check_X[a][c] = -2340.02;
check_Y[a][c] = 456.10;
check_Z[a][c] = 32.52;
c = 13;
check_X[a][c] = -2383.14;
check_Y[a][c] = 664.26;
check_Z[a][c] = 34.46;
c = 14;
check_X[a][c] = -2425.07;
check_Y[a][c] = 1110.77;
check_Z[a][c] = 55.14;
c = 15;
check_X[a][c] = -2606.51;
check_Y[a][c] = 1024.11;
check_Z[a][c] = 75.38;
c = 16;
check_X[a][c] = -2606.65;
check_Y[a][c] = 910.05;
check_Z[a][c] = 64.57;
c = 17;
check_X[a][c] = -2606.59;
check_Y[a][c] = 759.77;
check_Z[a][c] = 36.89;
c = 18;
check_X[a][c] = -2609.28;
check_Y[a][c] = 531.09;
check_Z[a][c] = 14.02;
c = 19;
check_X[a][c] = -2609.17;
check_Y[a][c] = 324.31;
check_Z[a][c] = 3.74;
c = 20;
check_X[a][c] = -2646.19;
check_Y[a][c] = 287.98;
check_Z[a][c] = 3.74;
c = 21;
check_X[a][c] = -2649.15;
check_Y[a][c] = 222.84;
check_Z[a][c] = 3.75;
c = 22;
check_X[a][c] = -2702.83;
check_Y[a][c] = 220.34;
check_Z[a][c] = 3.74;
c = 23;
check_X[a][c] = -2695.30;
check_Y[a][c] = 332.55;
check_Z[a][c] = 3.75;
c = 24;
check_X[a][c] = -2670.12;
check_Y[a][c] = 412.57;
check_Z[a][c] = 3.70;
c = 25;
check_X[a][c] = -2749.57;
check_Y[a][c] = 399.87;
check_Z[a][c] = 3.70;
c = 26;
check_X[a][c] = -2708.89;
check_Y[a][c] = 235.33;
check_Z[a][c] = 3.74;
c = 27;
check_X[a][c] = -2707.34;
check_Y[a][c] = -61.01;
check_Z[a][c] = 3.75;
c = 28;
check_X[a][c] = -2492.00;
check_Y[a][c] = -71.10;
check_Z[a][c] = 24.84;
c = 29;
check_X[a][c] = -2294.69;
check_Y[a][c] = -71.94;
check_Z[a][c] = 34.73;
c = 30;
check_X[a][c] = -2136.29;
check_Y[a][c] = -72.68;
check_Z[a][c] = 34.73;
c = 31;
check_X[a][c] = -2074.23;
check_Y[a][c] = 15.66;
check_Z[a][c] = 34.88;
check_idx[a] = 31;
}
// This DefineSanitaryCoords must be called in GameModeInit !!!!!
Code:
OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
if(PlayerInfo[playerid][checkpoint] == check_idx[PlayerInfo[playerid][sweeper]])
{
SendClientMessage(playerid, COLOR_GREEN, "* You cleaned the streets *");
GivePlayerMoney(playerid, 2000);
PlayerInfo[playerid][checkpoint] = 0;
PlayerInfo[playerid][sweeper] = 0;
}
else
{
PlayerInfo[playerid][checkpoint] += 1;
new a, c;
a = PlayerInfo[playerid][sweeper];
c = PlayerInfo[playerid][checkpoint];
SetPlayerRaceCheckpoint(playerid, 0, check_X[a][c], check_Y[a][c], check_Z[a][c], check_X[a][c+1], check_Y[a][c+1], check_Z[a][c+1], 10);
}
}
}
OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerInfo[playerid][checkpoint] != 0)
{
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][checkpoint] = 0;
PlayerInfo[playerid][sweeper] = 0;
}
}
Code:
if(strcmp(cmd, "/cleanstreets", true) == 0)
{
if(PlayerInSweeper(playerid))
{
new r = random(3);
new b;
if(r == 0 || r == 1)
{
b = 1;
}
else
{
b = 2;
}
if(PlayerInfo[playerid][sweeper] == 0)
{
PlayerInfo[playerid][checkpoint] = 1;
PlayerInfo[playerid][sweeper] = b;
SetPlayerRaceCheckpoint(playerid, 0, check_X[b][1], check_Y[b][1], check_Z[b][1], check_X[b][2], check_Y[b][2], check_Z[b][2], 10);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, " You already started cleaning!");
return 1;
}
}
return 1;
}
|