#include #include #include #include #include #define GAMEMODETEXT "RPG / Real Life / Freeroam / V1.7" #define FILE_SETTINGS "freeroam/config/settings.ini" #define FILE_TOTALSTAT "freeroam/save/totalstat.ini" #define FILE_PROPS "freeroam/save/props.ini" #define FILE_LOG "freeroam/logs/freeroam.log" #define FILE_CHEATLOG "freeroam/logs/cheat.log" #define FILE_REPORT "freeroam/logs/report.log" #define DIR_PLAYERS "freeroam/players/" #define DIR_CLANS "freeroam/clans/" #define MAX_VALUE 2000000000 #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x6666FFAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_ORANGE 0xFF9900AA #define INACTIVE_PLAYER_ID 255 #define COLOR_RED 0xAA3333AA new worldTime; new playername[MAX_PLAYERS][MAX_PLAYER_NAME]; new playerCheckpoint[MAX_PLAYERS]; new playercolor[MAX_PLAYERS]; new clan[MAX_PLAYERS][MAX_STRING]; new claninvite[MAX_PLAYERS][MAX_STRING]; new lastclass[MAX_PLAYERS]; new classrestored[MAX_PLAYERS]; new idle[MAX_PLAYERS]; new Float:idlepos[MAX_PLAYERS][3]; new spectator[MAX_PLAYERS][3]; new Float:spectlastpos[MAX_PLAYERS][3]; new logged[MAX_PLAYERS]; new logintimeout[MAX_PLAYERS]; new wrongpasses[MAX_PLAYERS]; new votes[MAX_PLAYERS]; new votetype[MAX_PLAYERS]; new votetime[MAX_PLAYERS]; new voted[MAX_PLAYERS][MAX_PLAYERS]; new muted[MAX_PLAYERS]; new mutetime[MAX_PLAYERS]; new mutetimer[MAX_PLAYERS]; new jailed[MAX_PLAYERS]; new jailtime[MAX_PLAYERS]; new jailtimer[MAX_PLAYERS]; new frozen[MAX_PLAYERS]; new reporttimeout[MAX_PLAYERS]; new god[MAX_PLAYERS]; new query[MAX_PLAYERS]; new ignore[MAX_PLAYERS][MAX_PLAYERS]; new antispawnkill[MAX_PLAYERS]; new antispawnkilltimeout[MAX_PLAYERS]; new cheatdeaths[MAX_PLAYERS]; new cheatweapons[MAX_PLAYERS]; new killsinarow[MAX_PLAYERS]; new smoney[MAX_PLAYERS]; new bank[MAX_PLAYERS]; new bounty[MAX_PLAYERS]; new respect[MAX_PLAYERS]; new playerColors[100] = { 0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,0xEE82EEFF,0xFFD720FF, 0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF, 0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF, 0x275222FF,0xF09F5BFF,0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF, 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,0x4B8987FF, 0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF, 0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF, 0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF, 0x9F945CFF,0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF, 0x3FE65CFF }; #define LSMAX_SPAWNS 8 new Float:LSSpawnPos[LSMAX_SPAWNS][4] = { {1686.26,1432.86,10.50,60.40}, // LS SPAWN1 {1686.26,1432.86,10.50,60.40}, // LS SPAWN2 {1686.26,1432.86,10.50,60.40}, // LS SPAWN3 {1686.26,1432.86,10.50,60.40}, // LS SPAWN4 {1686.26,1432.86,10.50,60.40}, // LS SPAWN5 {1686.26,1432.86,10.50,60.40}, // LS SPAWN6 {1686.26,1432.86,10.50,60.40}, // LS SPAWN7 {1686.26,1432.86,10.50,60.40} // LS SPAWN8 }; #define SFMAX_SPAWNS 7 new Float:SFSpawnPos[SFMAX_SPAWNS][4] = { {1686.26,1432.86,10.50,60.40}, // SF SPAWN1 {1686.26,1432.86,10.50,60.40}, // SF SPAWN2 {1686.26,1432.86,10.50,60.40}, // SF SPAWN3 {1686.26,1432.86,10.50,60.40}, // SF SPAWN4 {1686.26,1432.86,10.50,60.40}, // SF SPAWN5 {1686.26,1432.86,10.50,60.40}, // SF SPAWN6 {1686.26,1432.86,10.50,60.40} // SF SPAWN7 }; #define LVMAX_SPAWNS 6 new Float:LVSpawnPos[LVMAX_SPAWNS][4] = { {1686.26,1432.86,10.50,60.40}, // LV SPAWN1 {1686.26,1432.86,10.50,60.40}, // LV SPAWN2 {1686.26,1432.86,10.50,60.40}, // LV SPAWN3 {1686.26,1432.86,10.50,60.40}, // LV SPAWN4 {1686.26,1432.86,10.50,60.40}, // LV SPAWN5 {1686.26,1432.86,10.50,60.40} // LV SPAWN6 }; #define MAX_SPAWNS 3 new SpawnNames[MAX_SPAWNS][32] = { "Los Santos", "San Fierro", "Las Venturas" }; #define CP_STATION1 0 #define CP_STATION2 1 #define CP_STATION3 2 #define CP_STATION4 3 #define CP_STATION5 4 #define CP_STATION6 5 #define CP_STATION7 6 #define CP_STATION8 7 #define CP_STATION9 8 #define CP_STATION10 9 #define CP_STATION11 10 #define CP_STATION12 11 #define CP_STATION13 12 #define CP_STATION14 13 #define CP_STATION15 14 #define CP_STATION16 15 #define CP_BANK 16 #define CP_BANK2 17 #define CP_PIRATE 18 #define CP_ROOF 19 #define CP_PORT 20 #define CP_AMMU 21 #define CP_AMMU2 22 #define CP_SPRES 23 #define CP_AIR1 24 #define CP_AIR2 25 #define CP_AIR3 26 #define CP_DRAGON 27 #define CP_SEXSHOP 28 #define CP_BAR 29 #define CP_CALIGULA 30 #define CP_ZIP 31 #define CP_BINCO 32 #define CP_TATOO 33 #define CP_BOTIQUE 34 #define CP_JIZZY 35 #define CP_PIZZA 36 #define CP_VICTIM 37 #define CP_STRIPCLUB 38 #define CP_WANGCARS 39 #define CP_EMERALD 40 #define CP_VISAGE 41 #define CP_SUBURBAN 42 #define CP_PROLAPS 43 #define CP_BURGER 44 #define CP_CLUCKIN 45 #define CP_CLUB 46 #define CP_DS 47 #define CP_ZOMBO 48 #define MAX_POINTS 50 //33cp #define P_DRAGON 0 #define P_SEXSHOP 1 #define P_BAR 2 #define P_CALIGULA 3 #define P_ZIP 4 #define P_BINCO 5 #define P_TATOO 6 #define P_BOTIQUE 7 #define P_JIZZY 8 #define P_PIZZA 9 #define P_VICTIM 10 #define P_STRIPCLUB 11 #define P_WANGCARS 12 #define P_EMERALD 13 #define P_VISAGE 14 #define P_SUBURBAN 15 #define P_PROLAPS 16 #define P_BURGER 17 #define P_CLUCKIN 18 #define P_CLUB 19 #define P_DS 20 #define P_ZOMBO 21 #define P_OFFSET 27 new Float:checkCoords[MAX_POINTS][6] = { {2098.1316,901.7380,2137.7456,963.0146}, {2617.5967,1062.8710,2656.6526,1142.5109}, {501.7475,1626.7821,653.2095,1774.1093}, {-1351.2833,2638.8943,-1265.1661,2738.6450}, {-2450.3767,949.5080,-2400.8530,1069.8329}, {-1715.5112,349.5567,-1658.8451,458.3686}, {-2265.3027,-2586.3762,-2219.1868,-2558.2539}, {-1657.4102,-2763.3518,-1501.5303,-2666.7454}, {1903.7450,-1795.7990,1955.5667,-1759.5187}, {-135.2077,-1199.8291,-43.7008,-1134.7999}, {1336.7378,454.7961,1430.0760,483.9776}, {648.2494,-592.9003,670.9278,-540.8264}, {-1494.2593,1854.1290,-1449.4076,1885.2032}, {2097.0452,2708.1218,2172.7161,2762.7495}, {2187.6587,2462.8057,2215.5042,2495.0332}, {1577.7729,2182.5112,1616.5842,2242.3628}, {-22.2549,-55.6575,1003.5469}, {-36.5483,-57.9948,-17.2655,-49.2967}, //BANK {-38.2322,-91.9060,-14.9639,-74.7610}, //BANK2 {1894.6128,1445.3431,2084.9739,1637.8186}, //PIRATE {1430.9136,-1470.1956,1662.9897,-1246.3189},//ROOFTOP {-1679.0770,-76.0700,-1383.9709,262.7759}, //PORT {284.0546,-86.4384,302.9315,-56.6674}, //AMMUNATION {284.2423,-41.2138,299.9136,-31.3263}, //AMMUNATION2 {350.7979,152.1248,380.1650,217.2340}, //SPAWNRESIDENCE {1566.9074,-2386.0454,1833.3936,-2238.2758},//AIRPORT1 {-1742.0072,-695.7512,-1218.6909,-25.0761}, //AIRPORT2 {1461.3699,1300.9025,1823.6639,1646.0739}, //AIRPORT3 {1925.1511,968.2358,2019.0715,1067.4276}, //DRAGON {-115.9544,-24.2706,-99.1631,-7.1391}, //SEXSHOP {487.6558,-88.5900,512.0635, -67.7503}, //BAR {2216.7971,1638.0493,2255.2097,1714.0806}, //CALIGULA {144.9131,-96.0927,177.4128,-70.7923}, //ZIP {201.4462,-112.4556,218.5237,-95.1238}, //BINCO {-204.7623,-44.0326,-200.2330,-39.8128}, //TATOO {416.7485,-84.4242,422.6890,-74.0611}, //BOTIQUE {-2676.0637,1398.3545,-2642.4065,1421.6180},//JIZZY {369.0025,-131.6332,378.1711,-116.3600}, //PIZZA {201.9053,-11.7524,225.9064,-4.1778}, //VICTIM {1201.1422,-16.6343,1223.4420,12.6656}, //STRIPCLUB {-1996.0801,253.4684,-1942.0564,310.0717}, //WANG CARS {2099.1985,2328.5200,2179.1382,2405.8721}, //EMERALD ISLE {1998.3783,1875.9679,2066.3425,1957.0034}, //THE VISAGE {199.4294,-46.8185,209.5469,-34.0015}, //SUBURBAN {198.8601,-137.9890,214.9677,-128.5504}, //PRO LAPS {363.5299,-73.9080,381.7558,-57.7846}, //BURGER SHOT {364.8330,-10.3823,380.1563,-6.4998}, //CLUCKIN' BELL {478.4092,-22.1267,498.3633,-7.5962}, //CLUB {198.9507,-166.7670,210.7806,-156.2189}, //DIDIER SACHS {-1986.7450,640.8196,-1918.7468,712.6972} //ZOMBOTECH }; new Float:checkpoints[MAX_POINTS][6] = { //3 {2109.2126,917.5845,10.8203,5.0}, {2640.1831,1103.9224,10.8203,5.0}, {611.8934,1694.7921,6.7193,5.0}, {-1327.5398,2682.9771,49.7896,5.0}, {-2413.7427,975.9317,45.0031,5.0}, {-1672.3597,414.2950,6.8866,5.0}, {-2244.1365,-2560.6294,31.6276,5.0}, {-1603.0166,-2709.3589,48.2419,5.0}, {1939.3275,-1767.6813,13.2787,5.0}, {-94.7651,-1174.8079,1.9979,5.0}, {1381.6699,462.6467,19.8540,5.0}, {657.8167,-559.6507,16.0630,5.0}, {-1478.2916,1862.8318,32.3617,5.0}, {2147.3054,2744.9377,10.5263,5.0}, {2204.9602,2480.3494,10.5278,5.0}, {1590.9493,2202.2637,10.5247,5.0}, {1280.0591,-1500.0657,10.0469,2.0}, {-22.2549,-55.6575,1003.5469}, {-27.0437,-89.4715,1003.5468}, {2000.3132,1538.6012,13.5859}, {1532.4611,-1358.3649,329.4507}, {-1534.5357,112.4920,17.0078}, {291.0004,-84.5168,1001.5156}, {291.3284,-39.9767,1001.5156}, {362.4501,173.5097,1008.3828}, {1682.5954,-2330.7429,13.5468}, {-1424.3686,-290.0866,14.1484}, {1688.1124,1447.6761,10.7679}, {1989.0619,1005.5241,994.4688}, {-103.5525,-22.4661,1000.7188}, {501.4927,-75.4323,998.7578}, {2235.5408,1679.0402,1008.3594}, {161.1875,-79.9915,1001.8047}, {207.5640,-97.8188,1005.2578}, {-203.4864,-41.2045,1002.2734}, {418.5547,-80.1667,1001.8047}, {-2649.101,1409.747,906.2734}, {376.0949,-125.8507,1001.5}, {218.443,-8.778273,1001.211}, {1212.3918,-10.9459,1000.9219}, {-1957.5327,300.2131,35.4688}, {2127.5940,2370.4255,10.8203}, {2022.5179,1916.6848,12.3397}, {203.6803,-40.7557,1001.8047}, {206.9941,-133.5536,1002.8672}, {367.5272,-67.4198,1001.5078}, {371.3292,-8.9039,1001.8516}, {487.3790,-14.7161,1000.6797}, {204.3967,-161.7745,1000.5234}, {-1950.9393,674.2313,46.5625} }; new checkpointType[MAX_POINTS] = { CP_STATION1, CP_STATION2, CP_STATION3, CP_STATION4, CP_STATION5, CP_STATION6, CP_STATION7, CP_STATION8, CP_STATION9, CP_STATION10, CP_STATION11, CP_STATION12, CP_STATION13, CP_STATION14, CP_STATION15, CP_STATION16, CP_BANK, CP_BANK2, CP_PIRATE, CP_ROOF, CP_PORT, CP_AMMU, CP_AMMU2, CP_SPRES, CP_AIR1, CP_AIR2, CP_AIR3, CP_DRAGON, CP_SEXSHOP, CP_BAR, CP_CALIGULA, CP_ZIP, CP_BINCO, CP_TATOO, CP_BOTIQUE, CP_JIZZY, CP_PIZZA, CP_VICTIM, CP_STRIPCLUB, CP_WANGCARS, CP_EMERALD, CP_VISAGE, CP_SUBURBAN, CP_PROLAPS, CP_BURGER, CP_CLUCKIN, CP_CLUB, CP_DS, CP_ZOMBO }; #define MAX_PROPERTIES 22 new propertyowner[MAX_PROPERTIES][MAX_STRING]; new propertyBuyAble[MAX_PROPERTIES] = { 1, //DRAGON 1, //SEXSHOP 1, //BAR 1, //CALIGULA 1, //ZIP 1, //BINCO 1, //TATOO 1, //BOTIQUE 1, //JIZZY 1, //PIZZA 1, //VICTIM 1, //STRIPCLUB 1, //WANG CARS 1, //EMERALD ISLE 1, //THE VISAGE 1, //SUBURBAN 1, //PRO LAPS 1, //BURGER SHOT 1, //CLUCKIN' BELL 1, //CLUB 1, //DIDIER SACHS 1 //ZOMBOTECH }; new propertyReBuyAble[MAX_PROPERTIES] = { 1, //DRAGON 1, //SEXSHOP 1, //BAR 1, //CALIGULA 1, //ZIP 1, //BINCO 1, //TATOO 1, //BOTIQUE 1, //JIZZY 1, //PIZZA 1, //VICTIM 1, //STRIPCLUB 1, //WANG CARS 1, //EMERALD ISLE 1, //THE VISAGE 1, //SUBURBAN 1, //PRO LAPS 1, //BURGER SHOT 1, //CLUCKIN' BELL 1, //CLUB 1, //DIDIER SACHS 1 //ZOMBOTECH }; new propertyNames[MAX_PROPERTIES][32] = { "Four Dragons Casino", "Sex Shop", "Bar", "Caligula Casino", "Zip Shop", "Binco Shop", "Tatoo Parlor", "Botique", "Jizzy's Club", "The Well Stacked Pizza", "Victim Shop", "Strip Club", "Wang Cars", "Emerald Isle", "The Visage", "Sub Urban", "Pro Laps", "Burger Shot", "Cluckin' Bell", "Club", "Didier Sachs", "Zombotech Corp." }; new propertyValues[MAX_PROPERTIES] = { 3000000, 1000000, 800000, 4000000, 600000, 600000, 400000, 800000, 3000000, 600000, 600000, 1200000, 800000, 2400000, 4000000, 600000, 600000, 800000, 400000, 2000000, 5000000, 1600000 }; new propertyEarnings[MAX_PROPERTIES] = { 7500, 2500, 2000, 10000, 1500, 1500, 1000, 2000, 7500, 1500, 1500, 3000, 2000, 6000, 10000, 1500, 1500, 2000, 1000, 5000, 12500, 4000 }; #define WEAP_MELEE 8 new weaponNamesMelee[WEAP_MELEE][32] = { "Golf Club", "Night Stick", "Knife", "Baseball Bat", "Shovel", "Pool Cue", "Katana", "Chainsaw" }; new weaponIDsMelee[WEAP_MELEE] = { 2, //Golf Club 3, //Night Stick 4, //Knife 5, //Baseball Bat 6, //Shovel 7, //Pool cue 8, //Katana 9 //Chainsaw }; new weaponCostMelee[WEAP_MELEE] = { 1000, 1500, 3000, 1500, 1000, 1000, 3000, 5000 }; #define WEAP_PISTOLS 3 new weaponNamesPistols[WEAP_PISTOLS][32] = { "Pistol", "Silenced Pistol", "Desert Eagle" }; new weaponIDsPistols[WEAP_PISTOLS] = { 22, //Pistol 23, //Silenced Pistol 24 //Desert Eagle }; new weaponCostPistols[WEAP_PISTOLS] = { 20, 30, 60 }; #define WEAP_SHOTGUNS 3 new weaponNamesShotguns[WEAP_SHOTGUNS][32] = { "Shotgun", "Sawn Off", "Combat Shotgun" }; new weaponIDsShotguns[WEAP_SHOTGUNS] = { 25, //Shotgun 26, //Sawn Off 27 //Combat shotgun }; new weaponCostShotguns[WEAP_SHOTGUNS] = { 70, 120, 150 }; #define WEAP_SMGS 3 new weaponNamesSMGs[WEAP_SMGS][32] = { "Tec9", "Micro Uzi", "MP5" }; new weaponIDsSMGs[WEAP_SMGS] = { 32, //Tec9 28, //Micro Uzi 29 //MP5 }; new weaponCostSMGs[WEAP_SMGS] = { 50, 80, 150 }; #define WEAP_RIFLES 2 new weaponNamesRifles[WEAP_RIFLES][32] = { "AK47", "M4" }; new weaponIDsRifles[WEAP_RIFLES] = { 30, //AK47 31 //M4 }; new weaponCostRifles[WEAP_RIFLES] = { 250, 300 }; #define WEAP_RIFLES2 1 new weaponNamesRifles2[WEAP_RIFLES2][32] = { "Rifle" }; new weaponIDsRifles2[WEAP_RIFLES2] = { 33 }; new weaponCostRifles2[WEAP_RIFLES2] = { 200 }; #define WEAP_GIFTS 4 new weaponNamesGifts[WEAP_GIFTS][32] = { "Purple Dildo", "White Dildo", "Flowers", "Cane" }; new weaponIDsGifts[WEAP_GIFTS] = { 10, //Purple Dildo 12, //White Dildo 14, //Flowers 15 //Cane }; new weaponCostGifts[WEAP_GIFTS] = { 1000, 1000, 1500, 2000 }; #define WEAP_SPRAYS 2 new weaponNamesSprays[WEAP_SPRAYS][32] = { "Spray Paint", "Fire Extinguisher" }; new weaponIDsSprays[WEAP_SPRAYS] = { 41, //Spray Paint 42 //Fire Extinguisher }; new weaponCostSprays[WEAP_SPRAYS] = { 100, 100 }; #define RANKS_RESPECT 12 new RankRespectNames[RANKS_RESPECT][32] = { "Very Very Bad Guy", "Sinister Asshole", "Sith", "Darksider", "Thief", "Unknown", "Famous", "Lightsider", "Jedi", "Respectable Guy", "Godfather", "MADEMAN" }; new RankRespect[RANKS_RESPECT] = { -100, -50, -25, -10, -5, 0, 10, 25, 50, 100, 250, 1000 }; #define RANKS_KILLS 12 new RankKillNames[RANKS_KILLS][32] = { "Civilian", "Pickpocket", "Criminal", "Murderer", "Buster", "Gangsta", "OG", "Maniac", "Hitman", "Terrorist", "Monster", "GODOFGTA" }; new RankKills[RANKS_KILLS] = { 0, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000 }; #define RANKS_KILLSIAR 12 new RankKillIARNames[RANKS_KILLSIAR][32] = { "Pacific", "Double-killer", "Mega-killer", "Ultra-killer", "Ludicrous-killer", "Worth Ten", "Damned", "Cheated Death", "Serial Killer", "Army", "Holy Shit", "BLASTBOY" }; new RankKillsIAR[RANKS_KILLSIAR] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 25 }; #define RANKS_DEATHS 12 new RankDeathNames[RANKS_DEATHS][32] = { "Virgin", "Victim", "Target", "Crackhead", "Bitch", "Undead", "Meat", "Frag", "Sieve", "Fucked Up", "Ghost", "LIVELONG" }; new RankDeaths[RANKS_DEATHS] = { 0, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000 }; #define RANKS_SUICIDES 12 new RankSuicideNames[RANKS_SUICIDES][32] = { "Intelligent", "Bad Lucker", "Self-killer", "Crazy", "Shithead", "Psycho", "Life-hater", "Kamikazee", "Freefaller", "Nutter", "Headless", "YAKUZADEATH" }; new RankSuicides[RANKS_SUICIDES] = { 0, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000 }; #define RANKS_MONEY 12 new RankMoneyNames[RANKS_MONEY][32] = { "Looser", "Bad Player", "Casino Beginner", "Poor Man", "Usual", "Businessman", "Rich Guy", "Lucker", "Millioneer", "Big Boss", "Oligarch", "IAMDAVEJ" }; new RankMoneys[RANKS_MONEY] = { -1000000, -100000, -10000, 0, 10000, 100000, 1000000, 5000000, 10000000, 50000000, 100000000, 1000000000 }; #define RANKS_BOUNTY 8 new RankBountyNames[RANKS_BOUNTY][32] = { "Not Needed", "Ordered", "Low Interest", "Big Interest", "Wanted", "Main Target", "Most Wanted", "DESIRES" }; new RankBounty[RANKS_BOUNTY] = { 0, 10000, 50000, 100000, 500000, 1000000, 5000000, 10000000 }; #define MAX_LOCS 14 new Float:TLocs[MAX_LOCS][3] = { {2492.9375,-1670.4402,13.3359}, {1925.1957,-2426.8733,13.5391}, {1556.2386,-1357.8395,329.4544}, {154.0820,-1938.4050,3.7734}, {-2026.0696,175.2042,28.8359}, {-1281.1655,-166.1917,14.1484}, {-1753.8291,885.4835,295.8750}, {-2678.8230,1595.1827,217.2739}, {2030.2551,1007.9247,10.8203}, {1525.6610,1594.5865,10.8203}, {2057.1145,2435.5623,165.6172}, {-2321.2866,-1637.9414,483.7031}, {324.9738,2520.6030,16.6942}, {213.6413,1904.4032,17.6406} }; new TLocNames[MAX_LOCS][32] = { "LS: Groove St.", "LS: Airport", "LS: Highest Building", "LS: Lighthouse", "SF: Doherty", "SF: Airport", "SF: Highest Building", "SF: Golden Gate", "LV: Four Dragons", "LV: Airport", "LV: Highest Building", "Mountain Chilliad", "Abandoned Airport", "Area 69" }; new Filling[MAX_PLAYERS]; //petrol #define GasMax 100 #define RunOutTime 4000 #define RefuelWait 5000 enum SavePlayerPosEnum { Float:LastX, Float:LastY, Float:LastZ } new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum]; #define CAR_AMOUNT 255//Change to Your Vehicle Amount new Gas[CAR_AMOUNT]; new Police[MAX_PLAYERS]; new times[24] = {1,2,3,4,5,6,7,8,9,10,11,12}; new curtime = 0; //new heat[12] = {100,200,300,400,500,600,700,800,900,1000,1100,1200}; //new curheat = 0; main() { print("\n----------------------------------------------------------"); print(" Running Freeroam by Jayne, Thanks to everyone who help!"); print("----------------------------------------------------------\n"); WriteLog(""); WriteLog("*** Freeroam gamemode loaded!"); WriteLog(""); worldTime = 12; } UnlockPoliceCars(playerid) { SetVehicleParamsForPlayer(1, playerid, 0, 1); SetVehicleParamsForPlayer(2, playerid, 0, 1); SetVehicleParamsForPlayer(3, playerid, 0, 1); SetVehicleParamsForPlayer(4, playerid, 0, 1); SetVehicleParamsForPlayer(5, playerid, 0, 1);} public isPlayerInArea(playerID, Float:data[4]) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerID, X, Y, Z); if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) { return 1; } return 0; } public Fill() { for(new i=0;i xmin && y > ymin && z > zmin && x < xmax && y < ymax && z < zmax)return 1; return 0; } public PayDay(playerid, cash) { GameTextForPlayer(playerid, "Payday, you earn $1500", 700, 1); GivePlayerMoney(playerid, 1500); } public CheckGas() { new string[256]; for(new i=0;i= 1) { new Float:x,Float:y,Float:z; new Float:distance,value; GetPlayerPos(i, x, y, z); //curtime++; if(curtime == 24) curtime = 0; SetWorldTime(times[curtime]); distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2)); value = floatround(distance * 5600); //val = floatround(distance * 3600); /* if(val >= 90) { curheat++; } if(val < 90) { curheat--; }*/ format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~MpH:~h~~y~%d ~n~~w~Fuel:~h~~y~%d~b~% ~w~Time:~y~%i:00",floatround(value/3600),Gas[GetPlayerVehicleID(i)],curtime); GameTextForPlayer(i,string,8500,3); SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; } else { //new string[256]; new Float:x,Float:y,Float:z; SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; new Float:distance,value; GetPlayerPos(i, x, y, z); curtime++; if(curtime == 12) curtime = 1; SetWorldTime(times[curtime]); distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2)); value = floatround(distance * 5600); RemovePlayerFromVehicle(i); format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~MpH:~h~~w~%d~n~~r~Fuel:~h~~w~%d~b~% ~g~Time:~w~%i:00",floatround(value/3600),Gas[GetPlayerVehicleID(i)],curtime); GameTextForPlayer(i,string,8500,3); } if(Gas[GetPlayerVehicleID(i)] >= 100) { Filling[i] = 0; } } } return 1; } public Time2() { curtime++; SetWorldTime(times[curtime]); return 1; } public FuelDown() { for(new i=0;i= FillUp) { new mess[64]; format(mess, sizeof(mess), "* Type /refuel To Re-Fuel Your Car"); SendClientMessage(playerid, COLOR_GREY, mess); } } return 1; } new motdstring1[MAX_STRING] = "I Am So Dumb"; new motdstring2[MAX_STRING] = "And Have Not"; new motdstring3[MAX_STRING] = "Edited My Server"; new motdstring4[MAX_STRING] = "Motd Yet!"; new motdcolor[MAX_STRING] = "FFFFFFAA"; new usestandardchat = 0; new usestandardpms = 0; new allowdeadpeoplechating = 1; new mutepmsonmuting = 0; new adminsseepms = 1; new queryprefix[MAX_STRING] = "!"; new adminchatprefix[MAX_STRING] = "#"; new adminchatcolor[MAX_STRING] = "FFFFFFAA"; new loggingtype = 3; new cheatlog = 1; new usedefaultplayercolor = 0; new defaultplayercolor[MAX_STRING] = "FFFFFFAA"; new crashinsteadofkick = 0; new anticheatenabled = 1; new healthscan = 1; new onhealthcheat = 2; new Float:maxhealth = 100.0; new moneyscan = 1; new onmoneycheat = 2; new maxmoney = 9000000; new ignorenonscripttransactions = 0; new antiweaponcheat = 1; new onweaponcheat = 2; new weaponcheatstopunish = 3; new forbiddenweapons[MAX_STRING] = "1,16,17,18,35,36,37,38,39,40"; new antideathcheat = 1; new ondeathcheat = 2; new cheatdeathstopunish = 2; new antiidle = 1; new idlekicktime = 5; new spawnedplayercolor[MAX_STRING] = "ABCDEF00"; new enableantispawnkill = 1; new spawnkilltimeout = 5000; new onspawnkill = 3; new spawnkilljailtime = 10; new antirooftopkill = 1; new onrooftopkill = 3; new rooftopkilljailtime = 10; new antiportshipkill = 1; new onportshipkill = 3; new portshipkilljailtime = 10; new antipirateshipkill = 1; new onpirateshipkill = 3; new pirateshipkilljailtime = 10; new antidriveby = 0; new ondriveby = 3; new drivebyjailtime = 10; new savemoneyonbadkill = 1; new freezejailed = 0; new addtimeforkillinjail = 10; new nopunishlevel = 3; new spawnmoney = 5000; new timecycle = 1; new showtimeupdate = 1; new rooftop = 1; new rooftopmoney = 100; new portship = 1; new portshipmoney = 100; new pirateship = 1; new pirateshipmoney = 100; new allowregister = 1; new registerrequired = 0; new maxusers = 1000; new loggingtimeoutkick = 1; new loggingtimeout = 20000; new kickonnotloggedspawn = 0; new wrongpassestokick = 5; new saveposition = 1; new Float:minzpos = 0.0; new Float:maxzpos = 700.0; new savehealth = 1; new respectforkill = 0; new respectforclankill = -1; new respectfordeath = 0; new respectforsuicide = 0; new respectfordriveby = 0; new respectforholdareakill = 0; new respectforspawnkill = 0; new respectrequired = 1; new respecttosetbounty = 0; new respecttogetbounty = 0; new respecttobuyprops = 0; new respecttospawnweapons = 0; new respecttoholdareas = 0; new respecttospawnchange = 0; new respecttoairports = 0; new respecttochangeowncolor = 0; new respecttocreateclan = 0; new respecttochangeclancolor = 0; new clans = 1; new clanregister = 1; new maxclans = 200; new clanbank = 1; new clanchatprefix[MAX_STRING] = "@"; new usedefaultclanchatcolor = 0; new defaultclanchatcolor[MAX_STRING] = "33CCFFAA"; new allowclanchangecolor = 1; new clanchangecolorcost = 50000000; new enableadminscript = 1; new locking = 1; new enablebank = 1; new send = 1; new transact = 1; new enablebounty = 1; new properties = 1; new sellpropertyonquit = 0; new offlinepaymentdivisor = 100; new spawnweapons = 1; new spawnweaponsammolimit = 1000; new reloadcost = 5000; new skydive = 1; new maxskydive = 2000; new allowcarskydive = 0; new parachute = 1; new reporting = 1; new reportingtimeout = 2; new votekick = 1; new votekicktime = 60; new votekickminplayers = 10; new votekickpercent = 50; new voteban = 1; new votebantime = 30; new votebanminplayers = 10; new votebanpercent = 90; new allowspawnchange = 1; new spawnchangecost = 50000; new airports = 1; new airportticket = 1000; new allowchangecolor = 1; new changecolorcost = 25000000; new spectators = 1; new spectatormaxdist = 20; new statsofothers = 1; new statsmoneyofothers = 1; new statsofotherclans = 1; new statsmoneyofotherclans = 1; public LoadSettings() { if (!dini_Exists(FILE_SETTINGS)) { dini_Create(FILE_SETTINGS); dini_Set(FILE_SETTINGS, "motdstring1", "I Am So Dumb"); dini_Set(FILE_SETTINGS, "motdstring2", "And Have Not"); dini_Set(FILE_SETTINGS, "motdstring3", "Edited My Server"); dini_Set(FILE_SETTINGS, "motdstring4", "Motd Yet!"); dini_Set(FILE_SETTINGS, "motdcolor", "FFFFFFAA"); dini_IntSet(FILE_SETTINGS, "usestandardchat", 0); dini_IntSet(FILE_SETTINGS, "usestandardpms", 0); dini_IntSet(FILE_SETTINGS, "allowdeadpeoplechating", 1); dini_IntSet(FILE_SETTINGS, "mutepmsonmuting", 0); dini_IntSet(FILE_SETTINGS, "adminsseepms", 1); dini_Set(FILE_SETTINGS, "queryprefix", "!"); dini_Set(FILE_SETTINGS, "adminchatprefix", "#"); dini_Set(FILE_SETTINGS, "adminchatcolor", "FFFFFFAA"); dini_IntSet(FILE_SETTINGS, "loggingtype", 3); dini_IntSet(FILE_SETTINGS, "cheatlog", 1); dini_IntSet(FILE_SETTINGS, "usedefaultplayercolor", 0); dini_Set(FILE_SETTINGS, "defaultplayercolor", "FFFFFFAA"); dini_IntSet(FILE_SETTINGS, "crashinsteadofkick", 0); dini_IntSet(FILE_SETTINGS, "anticheatenabled", 1); dini_IntSet(FILE_SETTINGS, "healthscan", 1); dini_IntSet(FILE_SETTINGS, "onhealthcheat", 2); dini_FloatSet(FILE_SETTINGS, "maxhealth", 100.0); dini_IntSet(FILE_SETTINGS, "moneyscan", 1); dini_IntSet(FILE_SETTINGS, "onmoneycheat", 2); dini_IntSet(FILE_SETTINGS, "maxmoney", 9000000); dini_IntSet(FILE_SETTINGS, "ignorenonscripttransactions", 0); dini_IntSet(FILE_SETTINGS, "antiweaponcheat", 1); dini_IntSet(FILE_SETTINGS, "onweaponcheat", 2); dini_IntSet(FILE_SETTINGS, "weaponcheatstopunish", 3); dini_Set(FILE_SETTINGS, "forbiddenweapons", "1,16,17,18,35,36,37,38,39,40"); dini_IntSet(FILE_SETTINGS, "antideathcheat", 1); dini_IntSet(FILE_SETTINGS, "ondeathcheat", 2); dini_IntSet(FILE_SETTINGS, "cheatdeathstopunish", 2); dini_IntSet(FILE_SETTINGS, "antiidle", 1); dini_IntSet(FILE_SETTINGS, "idlekicktime", 5); dini_Set(FILE_SETTINGS, "spawnedplayercolor", "ABCDEF00"); dini_IntSet(FILE_SETTINGS, "enableantispawnkill", 1); dini_IntSet(FILE_SETTINGS, "spawnkilltimeout", 5000); dini_IntSet(FILE_SETTINGS, "onspawnkill", 3); dini_IntSet(FILE_SETTINGS, "spawnkilljailtime", 10); dini_IntSet(FILE_SETTINGS, "antirooftopkill", 1); dini_IntSet(FILE_SETTINGS, "onrooftopkill", 3); dini_IntSet(FILE_SETTINGS, "rooftopkilljailtime", 10); dini_IntSet(FILE_SETTINGS, "antiportshipkill", 1); dini_IntSet(FILE_SETTINGS, "onportshipkill", 3); dini_IntSet(FILE_SETTINGS, "portshipkilljailtime", 10); dini_IntSet(FILE_SETTINGS, "antipirateshipkill", 1); dini_IntSet(FILE_SETTINGS, "onpirateshipkill", 3); dini_IntSet(FILE_SETTINGS, "pirateshipkilljailtime", 10); dini_IntSet(FILE_SETTINGS, "antidriveby", 0); dini_IntSet(FILE_SETTINGS, "ondriveby", 3); dini_IntSet(FILE_SETTINGS, "drivebyjailtime", 10); dini_IntSet(FILE_SETTINGS, "savemoneyonbadkill", 1); dini_IntSet(FILE_SETTINGS, "freezejailed", 0); dini_IntSet(FILE_SETTINGS, "addtimeforkillinjail", 10); dini_IntSet(FILE_SETTINGS, "nopunishlevel", 3); dini_IntSet(FILE_SETTINGS, "spawnmoney", 5000); dini_IntSet(FILE_SETTINGS, "timecycle", 1); dini_IntSet(FILE_SETTINGS, "showtimeupdate", 1); dini_IntSet(FILE_SETTINGS, "rooftop", 1); dini_IntSet(FILE_SETTINGS, "rooftopmoney", 100); dini_IntSet(FILE_SETTINGS, "portship", 1); dini_IntSet(FILE_SETTINGS, "portshipmoney", 100); dini_IntSet(FILE_SETTINGS, "pirateship", 1); dini_IntSet(FILE_SETTINGS, "pirateshipmoney", 100); dini_IntSet(FILE_SETTINGS, "allowregister", 1); dini_IntSet(FILE_SETTINGS, "registerrequired", 0); dini_IntSet(FILE_SETTINGS, "maxusers", 1000); dini_IntSet(FILE_SETTINGS, "loggingtimeoutkick", 1); dini_IntSet(FILE_SETTINGS, "loggingtimeout", 20000); dini_IntSet(FILE_SETTINGS, "kickonnotloggedspawn", 0); dini_IntSet(FILE_SETTINGS, "wrongpassestokick", 5); dini_IntSet(FILE_SETTINGS, "saveposition", 1); dini_FloatSet(FILE_SETTINGS, "minzpos", 0.0); dini_FloatSet(FILE_SETTINGS, "maxzpos", 700.0); dini_IntSet(FILE_SETTINGS, "savehealth", 1); dini_IntSet(FILE_SETTINGS, "respectforkill", 2); dini_IntSet(FILE_SETTINGS, "respectforclankill", -1); dini_IntSet(FILE_SETTINGS, "respectfordeath", -1); dini_IntSet(FILE_SETTINGS, "respectforsuicide", -1); dini_IntSet(FILE_SETTINGS, "respectfordriveby", -5); dini_IntSet(FILE_SETTINGS, "respectforholdareakill", -10); dini_IntSet(FILE_SETTINGS, "respectforspawnkill", -10); dini_IntSet(FILE_SETTINGS, "respectrequired", 1); dini_IntSet(FILE_SETTINGS, "respecttosetbounty", 30); dini_IntSet(FILE_SETTINGS, "respecttogetbounty", 0); dini_IntSet(FILE_SETTINGS, "respecttobuyprops", 100); dini_IntSet(FILE_SETTINGS, "respecttospawnweapons", 10); dini_IntSet(FILE_SETTINGS, "respecttoholdareas", 0); dini_IntSet(FILE_SETTINGS, "respecttospawnchange", 10); dini_IntSet(FILE_SETTINGS, "respecttoairports", 0); dini_IntSet(FILE_SETTINGS, "respecttochangeowncolor", 150); dini_IntSet(FILE_SETTINGS, "respecttocreateclan", 100); dini_IntSet(FILE_SETTINGS, "respecttochangeclancolor", 200); dini_IntSet(FILE_SETTINGS, "clans", 1); dini_IntSet(FILE_SETTINGS, "clanregister", 1); dini_IntSet(FILE_SETTINGS, "maxclans", 200); dini_IntSet(FILE_SETTINGS, "clanbank", 1); dini_Set(FILE_SETTINGS, "clanchatprefix", "@"); dini_IntSet(FILE_SETTINGS, "usedefaultclanchatcolor", 0); dini_Set(FILE_SETTINGS, "defaultclanchatcolor", "33CCFFAA"); dini_IntSet(FILE_SETTINGS, "allowclanchangecolor", 1); dini_IntSet(FILE_SETTINGS, "clanchangecolorcost", 50000000); dini_IntSet(FILE_SETTINGS, "enableadminscript", 1); dini_IntSet(FILE_SETTINGS, "locking", 1); dini_IntSet(FILE_SETTINGS, "enablebank", 1); dini_IntSet(FILE_SETTINGS, "send", 1); dini_IntSet(FILE_SETTINGS, "transact", 1); dini_IntSet(FILE_SETTINGS, "enablebounty", 1); dini_IntSet(FILE_SETTINGS, "properties", 1); dini_IntSet(FILE_SETTINGS, "sellpropertyonquit", 0); dini_IntSet(FILE_SETTINGS, "offlinepaymentdivisor", 100); dini_IntSet(FILE_SETTINGS, "spawnweapons", 1); dini_IntSet(FILE_SETTINGS, "spawnweaponsammolimit", 1000); dini_IntSet(FILE_SETTINGS, "reloadcost", 5000); dini_IntSet(FILE_SETTINGS, "skydive", 1); dini_IntSet(FILE_SETTINGS, "maxskydive", 2000); dini_IntSet(FILE_SETTINGS, "allowcarskydive", 0); dini_IntSet(FILE_SETTINGS, "parachute", 1); dini_IntSet(FILE_SETTINGS, "reporting", 1); dini_IntSet(FILE_SETTINGS, "reportingtimeout", 2); dini_IntSet(FILE_SETTINGS, "votekick", 1); dini_IntSet(FILE_SETTINGS, "votekicktime", 60); dini_IntSet(FILE_SETTINGS, "votekickminplayers", 10); dini_IntSet(FILE_SETTINGS, "votekickpercent", 50); dini_IntSet(FILE_SETTINGS, "voteban", 1); dini_IntSet(FILE_SETTINGS, "votebantime", 30); dini_IntSet(FILE_SETTINGS, "votebanminplayers", 10); dini_IntSet(FILE_SETTINGS, "votebanpercent", 90); dini_IntSet(FILE_SETTINGS, "allowspawnchange", 1); dini_IntSet(FILE_SETTINGS, "spawnchangecost", 50000); dini_IntSet(FILE_SETTINGS, "airports", 1); dini_IntSet(FILE_SETTINGS, "airportticket", 1000); dini_IntSet(FILE_SETTINGS, "allowchangecolor", 1); dini_IntSet(FILE_SETTINGS, "changecolorcost", 25000000); dini_IntSet(FILE_SETTINGS, "spectators", 1); dini_IntSet(FILE_SETTINGS, "spectatormaxdist", 20); dini_IntSet(FILE_SETTINGS, "statsofothers", 1); dini_IntSet(FILE_SETTINGS, "statsmoneyofothers", 1); dini_IntSet(FILE_SETTINGS, "statsofotherclans", 1); dini_IntSet(FILE_SETTINGS, "statsmoneyofotherclans", 1); WriteLog(""); WriteLog(""); WriteLog("*** Settings file created."); } else { motdstring1 = dini_Get(FILE_SETTINGS, "motdstring1"); motdstring2 = dini_Get(FILE_SETTINGS, "motdstring2"); motdstring3 = dini_Get(FILE_SETTINGS, "motdstring3"); motdstring4 = dini_Get(FILE_SETTINGS, "motdstring4"); motdcolor = dini_Get(FILE_SETTINGS, "motdcolor"); usestandardchat = dini_Int(FILE_SETTINGS, "usestandardchat"); usestandardpms = dini_Int(FILE_SETTINGS, "usestandardpms"); allowdeadpeoplechating = dini_Int(FILE_SETTINGS, "allowdeadpeoplechating"); mutepmsonmuting = dini_Int(FILE_SETTINGS, "mutepmsonmuting"); adminsseepms = dini_Int(FILE_SETTINGS, "adminsseepms"); queryprefix = dini_Get(FILE_SETTINGS, "queryprefix"); adminchatprefix = dini_Get(FILE_SETTINGS, "adminchatprefix"); adminchatcolor = dini_Get(FILE_SETTINGS, "adminchatcolor"); loggingtype = dini_Int(FILE_SETTINGS, "loggingtype"); cheatlog = dini_Int(FILE_SETTINGS, "cheatlog"); usedefaultplayercolor = dini_Int(FILE_SETTINGS, "usedefaultplayercolor"); defaultplayercolor = dini_Get(FILE_SETTINGS, "defaultplayercolor"); crashinsteadofkick = dini_Int(FILE_SETTINGS, "crashinsteadofkick"); anticheatenabled = dini_Int(FILE_SETTINGS, "anticheatenabled"); healthscan = dini_Int(FILE_SETTINGS, "healthscan"); onhealthcheat = dini_Int(FILE_SETTINGS, "onhealthcheat"); maxhealth = dini_Float(FILE_SETTINGS, "maxhealth"); moneyscan = dini_Int(FILE_SETTINGS, "moneyscan"); onmoneycheat = dini_Int(FILE_SETTINGS, "onmoneycheat"); maxmoney = dini_Int(FILE_SETTINGS, "maxmoney"); ignorenonscripttransactions = dini_Int(FILE_SETTINGS, "ignorenonscripttransactions"); antiweaponcheat = dini_Int(FILE_SETTINGS, "antiweaponcheat"); onweaponcheat = dini_Int(FILE_SETTINGS, "onweaponcheat"); weaponcheatstopunish = dini_Int(FILE_SETTINGS, "weaponcheatstopunish"); forbiddenweapons = dini_Get(FILE_SETTINGS, "forbiddenweapons"); antideathcheat = dini_Int(FILE_SETTINGS, "antideathcheat"); ondeathcheat = dini_Int(FILE_SETTINGS, "ondeathcheat"); cheatdeathstopunish = dini_Int(FILE_SETTINGS, "cheatdeathstopunish"); antiidle = dini_Int(FILE_SETTINGS, "antiidle"); idlekicktime = dini_Int(FILE_SETTINGS, "idlekicktime"); spawnedplayercolor = dini_Get(FILE_SETTINGS, "spawnedplayercolor"); enableantispawnkill = dini_Int(FILE_SETTINGS, "enableantispawnkill"); spawnkilltimeout = dini_Int(FILE_SETTINGS, "spawnkilltimeout"); antirooftopkill = dini_Int(FILE_SETTINGS, "antirooftopkill"); antiportshipkill = dini_Int(FILE_SETTINGS, "antiportshipkill"); antipirateshipkill = dini_Int(FILE_SETTINGS, "antipirateshipkill"); antidriveby = dini_Int(FILE_SETTINGS, "antidriveby"); enableantispawnkill = dini_Int(FILE_SETTINGS, "enableantispawnkill"); spawnkilltimeout = dini_Int(FILE_SETTINGS, "spawnkilltimeout"); onspawnkill = dini_Int(FILE_SETTINGS, "onspawnkill"); spawnkilljailtime = dini_Int(FILE_SETTINGS, "spawnkilljailtime"); antirooftopkill = dini_Int(FILE_SETTINGS, "antirooftopkill"); onrooftopkill = dini_Int(FILE_SETTINGS, "onrooftopkill"); rooftopkilljailtime = dini_Int(FILE_SETTINGS, "rooftopkilljailtime"); antiportshipkill = dini_Int(FILE_SETTINGS, "antiportshipkill"); onportshipkill = dini_Int(FILE_SETTINGS, "onportshipkill"); portshipkilljailtime = dini_Int(FILE_SETTINGS, "portshipkilljailtime"); antipirateshipkill = dini_Int(FILE_SETTINGS, "antipirateshipkill"); onpirateshipkill = dini_Int(FILE_SETTINGS, "onpirateshipkill"); pirateshipkilljailtime = dini_Int(FILE_SETTINGS, "pirateshipkilljailtime"); antidriveby = dini_Int(FILE_SETTINGS, "antidriveby"); ondriveby = dini_Int(FILE_SETTINGS, "ondriveby"); drivebyjailtime = dini_Int(FILE_SETTINGS, "drivebyjailtime"); savemoneyonbadkill = dini_Int(FILE_SETTINGS, "savemoneyonbadkill"); freezejailed = dini_Int(FILE_SETTINGS, "freezejailed"); addtimeforkillinjail = dini_Int(FILE_SETTINGS, "addtimeforkillinjail"); nopunishlevel = dini_Int(FILE_SETTINGS, "nopunishlevel"); spawnmoney = dini_Int(FILE_SETTINGS, "spawnmoney"); timecycle = dini_Int(FILE_SETTINGS, "timecycle"); showtimeupdate = dini_Int(FILE_SETTINGS, "showtimeupdate"); rooftop = dini_Int(FILE_SETTINGS, "rooftop"); rooftopmoney = dini_Int(FILE_SETTINGS, "rooftopmoney"); portship = dini_Int(FILE_SETTINGS, "portship"); portshipmoney = dini_Int(FILE_SETTINGS, "portshipmoney"); pirateship = dini_Int(FILE_SETTINGS, "pirateship"); pirateshipmoney = dini_Int(FILE_SETTINGS, "pirateshipmoney"); allowregister = dini_Int(FILE_SETTINGS, "allowregister"); registerrequired = dini_Int(FILE_SETTINGS, "registerrequired"); maxusers = dini_Int(FILE_SETTINGS, "maxusers"); loggingtimeoutkick = dini_Int(FILE_SETTINGS, "loggingtimeoutkick"); loggingtimeout = dini_Int(FILE_SETTINGS, "loggingtimeout"); kickonnotloggedspawn = dini_Int(FILE_SETTINGS, "kickonnotloggedspawn"); wrongpassestokick = dini_Int(FILE_SETTINGS, "wrongpassestokick"); saveposition = dini_Int(FILE_SETTINGS, "saveposition"); minzpos = dini_Float(FILE_SETTINGS, "minzpos"); maxzpos = dini_Float(FILE_SETTINGS, "maxzpos"); savehealth = dini_Int(FILE_SETTINGS, "savehealth"); respectforkill = dini_Int(FILE_SETTINGS, "respectforkill"); respectforclankill = dini_Int(FILE_SETTINGS, "respectforclankill"); respectfordeath = dini_Int(FILE_SETTINGS, "respectfordeath"); respectforsuicide = dini_Int(FILE_SETTINGS, "respectforsuicide"); respectfordriveby = dini_Int(FILE_SETTINGS, "respectfordriveby"); respectforholdareakill = dini_Int(FILE_SETTINGS, "respectforholdareakill"); respectforspawnkill = dini_Int(FILE_SETTINGS, "respectforspawnkill"); respectrequired = dini_Int(FILE_SETTINGS, "respectrequired"); respecttosetbounty = dini_Int(FILE_SETTINGS, "respecttosetbounty"); respecttogetbounty = dini_Int(FILE_SETTINGS, "respecttogetbounty"); respecttobuyprops = dini_Int(FILE_SETTINGS, "respecttobuyprops"); respecttospawnweapons = dini_Int(FILE_SETTINGS, "respecttospawnweapons"); respecttoholdareas = dini_Int(FILE_SETTINGS, "respecttoholdareas"); respecttospawnchange = dini_Int(FILE_SETTINGS, "respecttospawnchange"); respecttoairports = dini_Int(FILE_SETTINGS, "respecttoairports"); respecttochangeowncolor = dini_Int(FILE_SETTINGS, "respecttochangeowncolor"); respecttocreateclan = dini_Int(FILE_SETTINGS, "respecttocreateclan"); respecttochangeclancolor = dini_Int(FILE_SETTINGS, "respecttochangeclancolor"); clans = dini_Int(FILE_SETTINGS, "clans"); clanregister = dini_Int(FILE_SETTINGS, "clanregister"); maxclans = dini_Int(FILE_SETTINGS, "maxclans"); clanbank = dini_Int(FILE_SETTINGS, "clanbank"); clanchatprefix = dini_Get(FILE_SETTINGS, "clanchatprefix"); usedefaultclanchatcolor = dini_Int(FILE_SETTINGS, "usedefaultclanchatcolor"); defaultclanchatcolor = dini_Get(FILE_SETTINGS, "defaultclanchatcolor"); allowclanchangecolor = dini_Int(FILE_SETTINGS, "allowclanchangecolor"); clanchangecolorcost = dini_Int(FILE_SETTINGS, "clanchangecolorcost"); enableadminscript = dini_Int(FILE_SETTINGS, "enableadminscript"); locking = dini_Int(FILE_SETTINGS, "locking"); enablebank = dini_Int(FILE_SETTINGS, "enablebank"); send = dini_Int(FILE_SETTINGS, "send"); transact = dini_Int(FILE_SETTINGS, "transact"); enablebounty = dini_Int(FILE_SETTINGS, "enablebounty"); properties = dini_Int(FILE_SETTINGS, "properties"); sellpropertyonquit = dini_Int(FILE_SETTINGS, "sellpropertyonquit"); offlinepaymentdivisor = dini_Int(FILE_SETTINGS, "offlinepaymentdivisor"); spawnweapons = dini_Int(FILE_SETTINGS, "spawnweapons"); spawnweaponsammolimit = dini_Int(FILE_SETTINGS, "spawnweaponsammolimit"); reloadcost = dini_Int(FILE_SETTINGS, "reloadcost"); skydive = dini_Int(FILE_SETTINGS, "skydive"); maxskydive = dini_Int(FILE_SETTINGS, "maxskydive"); allowcarskydive = dini_Int(FILE_SETTINGS, "allowcarskydive"); parachute = dini_Int(FILE_SETTINGS, "parachute"); reporting = dini_Int(FILE_SETTINGS, "reporting"); reportingtimeout = dini_Int(FILE_SETTINGS, "reportingtimeout"); votekick = dini_Int(FILE_SETTINGS, "votekick"); votekicktime = dini_Int(FILE_SETTINGS, "votekicktime"); votekickminplayers = dini_Int(FILE_SETTINGS, "votekickminplayers"); votekickpercent = dini_Int(FILE_SETTINGS, "votekickpercent"); voteban = dini_Int(FILE_SETTINGS, "voteban"); votebantime = dini_Int(FILE_SETTINGS, "votebantime"); votebanminplayers = dini_Int(FILE_SETTINGS, "votebanminplayers"); votebanpercent = dini_Int(FILE_SETTINGS, "votebanpercent"); allowspawnchange = dini_Int(FILE_SETTINGS, "allowspawnchange"); spawnchangecost = dini_Int(FILE_SETTINGS, "spawnchangecost"); airports = dini_Int(FILE_SETTINGS, "airports"); airportticket = dini_Int(FILE_SETTINGS, "airportticket"); allowchangecolor = dini_Int(FILE_SETTINGS, "allowchangecolor"); changecolorcost = dini_Int(FILE_SETTINGS, "changecolorcost"); spectators = dini_Int(FILE_SETTINGS, "spectators"); spectatormaxdist = dini_Int(FILE_SETTINGS, "spectatormaxdist"); statsofothers = dini_Int(FILE_SETTINGS, "statsofothers"); statsmoneyofothers = dini_Int(FILE_SETTINGS, "statsmoneyofothers"); statsofotherclans = dini_Int(FILE_SETTINGS, "statsofotherclans"); statsmoneyofotherclans = dini_Int(FILE_SETTINGS, "statsmoneyofotherclans"); WriteLog(""); WriteLog(""); WriteLog("*** Settings file loaded."); } } WriteLog(string[]) { new h, m, s; new tmp[MAX_STRING]; gettime(h,m,s); if (strlen(string)) format(tmp, sizeof(tmp), "[%d:%d:%d] %s", h,m,s,string); if (loggingtype == 1 || loggingtype == 3) printf(tmp); if (loggingtype == 2 || loggingtype == 3) { new File:f = fopen(FILE_LOG, io_append); fwrite(f, tmp); fwrite(f, "\r\n"); fclose(f); } } getCheckpointType(playerid) { return checkpointType[playerCheckpoint[playerid]]; } IsPlayerAt(playerid, Float:x1, Float:y1, Float:x2, Float:y2) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if (x >= x1 && x <= x2 && y >= y1 && y <= y2) return 1; return 0; } EncodeNick(playernick[]) { new tmp[MAX_STRING]; set(tmp, strlower(playernick)); tmp = strreplace("_", "_00", tmp); tmp = strreplace(";", "_01", tmp); tmp = strreplace("!", "_02", tmp); tmp = strreplace("/", "_03", tmp); tmp = strreplace("\\", "_04", tmp); tmp = strreplace("[", "_05", tmp); tmp = strreplace("]", "_06", tmp); tmp = strreplace("?", "_07", tmp); tmp = strreplace(".", "_08", tmp); tmp = strreplace("*", "_09", tmp); tmp = strreplace("<", "_10", tmp); tmp = strreplace(">", "_11", tmp); tmp = strreplace("{", "_12", tmp); tmp = strreplace("}", "_13", tmp); tmp = strreplace(" ", "_14", tmp); tmp = strreplace("\"", "_15", tmp); tmp = strreplace(":", "_16", tmp); tmp = strreplace("|", "_17", tmp); tmp = strreplace("=", "_18", tmp); return tmp; } #define MAX_CLASSES 300 new classes; new classmodel[MAX_CLASSES]; AddPlayerClass2(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) { classmodel[classes] = modelid; classes++; AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); } GetVehicleDriver(vehicleid) { for (new i=0;i= nopunishlevel && nopunishlevel > 0) return; muted[playerid] = 1; if (duration > 0) mutetime[playerid] = duration; else mutetime[playerid] = -1; format(string, sizeof(string), "--- %s (id: %d) muted by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) muted by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason); SendClientMessageToAll(COLOR_RED, string); GameTextForPlayer(playerid, "~r~You are muted!", 3000, 5); format(string, sizeof(string), "UnMutePlayer%d", playerid); mutetimer[playerid] = SetTimer(string, duration*60000, 0); } else { muted[playerid] = 0; format(string, sizeof(string), "--- %s (id: %d) unmuted by %s. Reason: %s", playername[playerid],playerid,kickername,reason); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) unmuted by %s. Reason: %s", playername[playerid],playerid,kickername,reason); SendClientMessageToAll(COLOR_GREEN, string); GameTextForPlayer(playerid, "~g~You are unmuted!", 3000, 5); } } public UnMutePlayer0() MutePlayer(0, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer1() MutePlayer(1, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer2() MutePlayer(2, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer3() MutePlayer(3, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer4() MutePlayer(4, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer5() MutePlayer(5, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer6() MutePlayer(6, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer7() MutePlayer(7, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer8() MutePlayer(8, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer9() MutePlayer(9, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer10() MutePlayer(10, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer11() MutePlayer(11, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer12() MutePlayer(12, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer13() MutePlayer(13, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer14() MutePlayer(14, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer15() MutePlayer(15, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer16() MutePlayer(16, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer17() MutePlayer(17, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer18() MutePlayer(18, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer19() MutePlayer(19, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer20() MutePlayer(20, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer21() MutePlayer(21, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer22() MutePlayer(22, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer23() MutePlayer(23, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer24() MutePlayer(24, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer25() MutePlayer(25, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer26() MutePlayer(26, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer27() MutePlayer(27, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer28() MutePlayer(28, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer29() MutePlayer(29, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer30() MutePlayer(30, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer31() MutePlayer(31, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer32() MutePlayer(32, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer33() MutePlayer(33, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer34() MutePlayer(34, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer35() MutePlayer(35, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer36() MutePlayer(36, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer37() MutePlayer(37, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer38() MutePlayer(38, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer39() MutePlayer(39, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer40() MutePlayer(40, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer41() MutePlayer(41, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer42() MutePlayer(42, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer43() MutePlayer(43, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer44() MutePlayer(44, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer45() MutePlayer(45, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer46() MutePlayer(46, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer47() MutePlayer(47, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer48() MutePlayer(48, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer49() MutePlayer(49, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer50() MutePlayer(50, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer51() MutePlayer(51, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer52() MutePlayer(52, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer53() MutePlayer(53, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer54() MutePlayer(54, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer55() MutePlayer(55, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer56() MutePlayer(56, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer57() MutePlayer(57, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer58() MutePlayer(58, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer59() MutePlayer(59, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer60() MutePlayer(60, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer61() MutePlayer(61, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer62() MutePlayer(62, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer63() MutePlayer(63, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer64() MutePlayer(64, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer65() MutePlayer(65, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer66() MutePlayer(66, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer67() MutePlayer(67, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer68() MutePlayer(68, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer69() MutePlayer(69, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer70() MutePlayer(70, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer71() MutePlayer(71, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer72() MutePlayer(72, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer73() MutePlayer(73, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer74() MutePlayer(74, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer75() MutePlayer(75, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer76() MutePlayer(76, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer77() MutePlayer(77, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer78() MutePlayer(78, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer79() MutePlayer(79, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer80() MutePlayer(80, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer81() MutePlayer(81, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer82() MutePlayer(82, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer83() MutePlayer(83, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer84() MutePlayer(84, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer85() MutePlayer(85, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer86() MutePlayer(86, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer87() MutePlayer(87, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer88() MutePlayer(88, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer89() MutePlayer(89, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer90() MutePlayer(90, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer91() MutePlayer(91, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer92() MutePlayer(92, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer93() MutePlayer(93, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer94() MutePlayer(94, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer95() MutePlayer(95, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer96() MutePlayer(96, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer97() MutePlayer(97, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer98() MutePlayer(98, "!Protection!", "Mute time expired!", 0, true); public UnMutePlayer99() MutePlayer(99, "!Protection!", "Mute time expired!", 0, true); JailPlayer(playerid, kickername[], reason[], duration=0, unjail=false) { new string[MAX_STRING]; if (!unjail) { if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return; jailed[playerid] = 1; if (duration > 0) jailtime[playerid] = duration; else jailtime[playerid] = -1; if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED) { RemovePlayerFromVehicle(playerid); SetPlayerInterior(playerid, 6); SetPlayerPos(playerid, 265.1273,77.6823,1001.0391); if (freezejailed) FreezePlayer(playerid); } format(string, sizeof(string), "--- %s (id: %d) jailed by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) jailed by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason); SendClientMessageToAll(COLOR_RED, string); GameTextForPlayer(playerid, "~r~You are jailed!", 3000, 5); format(string, sizeof(string), "UnJailPlayer%d", playerid); jailtimer[playerid] = SetTimer(string, duration*60000, 0); } else { jailed[playerid] = 0; if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED) { RemovePlayerFromVehicle(playerid); SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 1551.4037,-1675.3488,15.8326); FreezePlayer(playerid, true); } format(string, sizeof(string), "--- %s (id: %d) released by %s. Reason: %s", playername[playerid],playerid,kickername,reason); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) released by %s. Reason: %s", playername[playerid],playerid,kickername,reason); SendClientMessageToAll(COLOR_GREEN, string); GameTextForPlayer(playerid, "~g~You are released!", 3000, 5); } } public UnJailPlayer0() JailPlayer(0, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer1() JailPlayer(1, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer2() JailPlayer(2, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer3() JailPlayer(3, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer4() JailPlayer(4, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer5() JailPlayer(5, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer6() JailPlayer(6, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer7() JailPlayer(7, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer8() JailPlayer(8, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer9() JailPlayer(9, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer10() JailPlayer(10, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer11() JailPlayer(11, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer12() JailPlayer(12, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer13() JailPlayer(13, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer14() JailPlayer(14, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer15() JailPlayer(15, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer16() JailPlayer(16, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer17() JailPlayer(17, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer18() JailPlayer(18, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer19() JailPlayer(19, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer20() JailPlayer(20, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer21() JailPlayer(21, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer22() JailPlayer(22, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer23() JailPlayer(23, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer24() JailPlayer(24, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer25() JailPlayer(25, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer26() JailPlayer(26, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer27() JailPlayer(27, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer28() JailPlayer(28, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer29() JailPlayer(29, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer30() JailPlayer(30, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer31() JailPlayer(31, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer32() JailPlayer(32, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer33() JailPlayer(33, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer34() JailPlayer(34, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer35() JailPlayer(35, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer36() JailPlayer(36, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer37() JailPlayer(37, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer38() JailPlayer(38, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer39() JailPlayer(39, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer40() JailPlayer(40, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer41() JailPlayer(41, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer42() JailPlayer(42, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer43() JailPlayer(43, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer44() JailPlayer(44, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer45() JailPlayer(45, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer46() JailPlayer(46, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer47() JailPlayer(47, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer48() JailPlayer(48, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer49() JailPlayer(49, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer50() JailPlayer(50, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer51() JailPlayer(51, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer52() JailPlayer(52, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer53() JailPlayer(53, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer54() JailPlayer(54, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer55() JailPlayer(55, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer56() JailPlayer(56, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer57() JailPlayer(57, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer58() JailPlayer(58, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer59() JailPlayer(59, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer60() JailPlayer(60, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer61() JailPlayer(61, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer62() JailPlayer(62, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer63() JailPlayer(63, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer64() JailPlayer(64, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer65() JailPlayer(65, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer66() JailPlayer(66, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer67() JailPlayer(67, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer68() JailPlayer(68, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer69() JailPlayer(69, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer70() JailPlayer(70, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer71() JailPlayer(71, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer72() JailPlayer(72, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer73() JailPlayer(73, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer74() JailPlayer(74, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer75() JailPlayer(75, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer76() JailPlayer(76, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer77() JailPlayer(77, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer78() JailPlayer(78, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer79() JailPlayer(79, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer80() JailPlayer(80, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer81() JailPlayer(81, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer82() JailPlayer(82, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer83() JailPlayer(83, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer84() JailPlayer(84, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer85() JailPlayer(85, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer86() JailPlayer(86, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer87() JailPlayer(87, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer88() JailPlayer(88, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer89() JailPlayer(89, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer90() JailPlayer(90, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer91() JailPlayer(91, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer92() JailPlayer(92, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer93() JailPlayer(93, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer94() JailPlayer(94, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer95() JailPlayer(95, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer96() JailPlayer(96, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer97() JailPlayer(97, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer98() JailPlayer(98, "!Protection!", "Jail time expired!", 0, true); public UnJailPlayer99() JailPlayer(99, "!Protection!", "Jail time expired!", 0, true); FreezePlayer(playerid, unfreeze=false) { if (!unfreeze) { TogglePlayerControllable(playerid, 0); frozen[playerid] = 1; } else { TogglePlayerControllable(playerid, 1); frozen[playerid] = 0; } } public KickPlayer0() Kick(0); public KickPlayer1() Kick(1); public KickPlayer2() Kick(2); public KickPlayer3() Kick(3); public KickPlayer4() Kick(4); public KickPlayer5() Kick(5); public KickPlayer6() Kick(6); public KickPlayer7() Kick(7); public KickPlayer8() Kick(8); public KickPlayer9() Kick(9); public KickPlayer10() Kick(10); public KickPlayer11() Kick(11); public KickPlayer12() Kick(12); public KickPlayer13() Kick(13); public KickPlayer14() Kick(14); public KickPlayer15() Kick(15); public KickPlayer16() Kick(16); public KickPlayer17() Kick(17); public KickPlayer18() Kick(18); public KickPlayer19() Kick(19); public KickPlayer20() Kick(20); public KickPlayer21() Kick(21); public KickPlayer22() Kick(22); public KickPlayer23() Kick(23); public KickPlayer24() Kick(24); public KickPlayer25() Kick(25); public KickPlayer26() Kick(26); public KickPlayer27() Kick(27); public KickPlayer28() Kick(28); public KickPlayer29() Kick(29); public KickPlayer30() Kick(30); public KickPlayer31() Kick(31); public KickPlayer32() Kick(32); public KickPlayer33() Kick(33); public KickPlayer34() Kick(34); public KickPlayer35() Kick(35); public KickPlayer36() Kick(36); public KickPlayer37() Kick(37); public KickPlayer38() Kick(38); public KickPlayer39() Kick(39); public KickPlayer40() Kick(40); public KickPlayer41() Kick(41); public KickPlayer42() Kick(42); public KickPlayer43() Kick(43); public KickPlayer44() Kick(44); public KickPlayer45() Kick(45); public KickPlayer46() Kick(46); public KickPlayer47() Kick(47); public KickPlayer48() Kick(48); public KickPlayer49() Kick(49); public KickPlayer50() Kick(50); public KickPlayer51() Kick(51); public KickPlayer52() Kick(52); public KickPlayer53() Kick(53); public KickPlayer54() Kick(54); public KickPlayer55() Kick(55); public KickPlayer56() Kick(56); public KickPlayer57() Kick(57); public KickPlayer58() Kick(58); public KickPlayer59() Kick(59); public KickPlayer60() Kick(60); public KickPlayer61() Kick(61); public KickPlayer62() Kick(62); public KickPlayer63() Kick(63); public KickPlayer64() Kick(64); public KickPlayer65() Kick(65); public KickPlayer66() Kick(66); public KickPlayer67() Kick(67); public KickPlayer68() Kick(68); public KickPlayer69() Kick(69); public KickPlayer70() Kick(70); public KickPlayer71() Kick(71); public KickPlayer72() Kick(72); public KickPlayer73() Kick(73); public KickPlayer74() Kick(74); public KickPlayer75() Kick(75); public KickPlayer76() Kick(76); public KickPlayer77() Kick(77); public KickPlayer78() Kick(78); public KickPlayer79() Kick(79); public KickPlayer80() Kick(80); public KickPlayer81() Kick(81); public KickPlayer82() Kick(82); public KickPlayer83() Kick(83); public KickPlayer84() Kick(84); public KickPlayer85() Kick(85); public KickPlayer86() Kick(86); public KickPlayer87() Kick(87); public KickPlayer88() Kick(88); public KickPlayer89() Kick(89); public KickPlayer90() Kick(90); public KickPlayer91() Kick(91); public KickPlayer92() Kick(92); public KickPlayer93() Kick(93); public KickPlayer94() Kick(94); public KickPlayer95() Kick(95); public KickPlayer96() Kick(96); public KickPlayer97() Kick(97); public KickPlayer98() Kick(98); public KickPlayer99() Kick(99); KickPlayer(playerid, kickername[], reason[]) { new string[MAX_STRING]; if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return; if (strcmp(kickername, "!AntiCheat!", true) == 0) { if (!anticheatenabled) return; if (cheatlog == 1) { new File:f = fopen(FILE_CHEATLOG, io_append); new h, m, s; new day, month, year; gettime(h,m,s); getdate(year,month,day); format(string, sizeof(string), "%d.%d.%d [%d:%d:%d] Kicked %s (id: %d) for cheating: %s", day,month,year,h,m,s,playername[playerid],playerid,reason); fwrite(f, string); fwrite(f, "\r\n"); fclose(f); } } format(string, sizeof(string), "*** %s (id: %d) kicked by %s. Reason: %s", playername[playerid],playerid,kickername,reason); WriteLog(string); SendClientMessageToAll(COLOR_GREY, string); GameTextForPlayer(playerid, "You are kicked from the server!", 1000, 2); if (crashinsteadofkick) { GameTextForPlayer(playerid, "~", 1000, 5); playercolor[playerid] = 0; SetPlayerColor(playerid, 0); } else { format(string, sizeof(string), "KickPlayer%d", playerid); SetTimer(string, 2000, 0); } dini_IntSet(FILE_TOTALSTAT, "kicks", dini_Int(FILE_TOTALSTAT, "kicks")+1); } BanPlayer(playerid, kickername[], reason[]) { new string[MAX_STRING]; if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return; if (strcmp(kickername, "!AntiCheat!", true) == 0) { if (!anticheatenabled) return; if (cheatlog) { new File:f = fopen(FILE_CHEATLOG, io_append); new h, m, s; new day, month, year; gettime(h,m,s); getdate(year,month,day); format(string, sizeof(string), "%d.%d.%d [%d:%d:%d] Banned %s (id: %d) for cheating: %s", day,month,year,h,m,s,playername[playerid],playerid,reason); fwrite(f, string); fwrite(f, "\r\n"); fclose(f); } } format(string, sizeof(string), "*** %s (id: %d) banned by %s. Reason: %s", playername[playerid],playerid,kickername,reason); WriteLog(string); SendClientMessageToAll(COLOR_GREY, string); GameTextForPlayer(playerid, "You are banned from the server!", 1000, 2); Ban(playerid); dini_IntSet(FILE_TOTALSTAT, "bans", dini_Int(FILE_TOTALSTAT, "bans")+1); } GiveMoney(playerid, amount) { if (IsPlayerConnected(playerid)) { if (GetPlayerMoney(playerid)+amount <= maxmoney) { GivePlayerMoney(playerid, amount); if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); if (amount > 0) { if (dini_Int(FILE_TOTALSTAT, "moneyreceived")+amount > 2000000000) dini_IntSet(FILE_TOTALSTAT, "moneyreceived", amount); else dini_IntSet(FILE_TOTALSTAT, "moneyreceived", dini_Int(FILE_TOTALSTAT, "moneyreceived")+amount); } else { if (dini_Int(FILE_TOTALSTAT, "moneylost")-amount > 2000000000) dini_IntSet(FILE_TOTALSTAT, "moneylost", -amount); else dini_IntSet(FILE_TOTALSTAT, "moneylost", dini_Int(FILE_TOTALSTAT, "moneylost")-amount); } smoney[playerid] += amount; } else { if (bank[playerid]+amount < MAX_VALUE) bank[playerid] += amount; SendClientMessage(playerid, COLOR_RED, "* WARNING! Your money at maximum and you cannot receive more money!"); SendClientMessage(playerid, COLOR_RED, "* Store money in bank or send them to be able to get more."); SendClientMessage(playerid, COLOR_YELLOW, "* Last transaction stored in bank."); } } } SwapMoney(playerid, toplayerid, amount) { if (IsPlayerConnected(playerid) && IsPlayerConnected(toplayerid)) { GivePlayerMoney(playerid, -amount); smoney[playerid] -= amount; if (GetPlayerMoney(toplayerid)+amount <= maxmoney) { GivePlayerMoney(toplayerid, amount); smoney[toplayerid] += amount; } else { if (bank[toplayerid]+amount < MAX_VALUE) bank[toplayerid] += amount; SendClientMessage(toplayerid, COLOR_RED, "* WARNING! Your money at maximum and you cannot receive more money!"); SendClientMessage(toplayerid, COLOR_RED, "* Store money in bank or send them to be able to get more."); SendClientMessage(toplayerid, COLOR_YELLOW, "* Last transaction stored in bank."); } } } GetPlayers() { new players; for (new i=0;i= 1) SendClientMessage(i, color, string); } SendChatMessage(playerid, color, string[]) { for (new i=0;i= respecttoholdareas)) { if (rooftop && IsPlayerAt(i, 1530.9, -1370.2, 1563.0, -1346.3)) GiveMoney(i, rooftopmoney); if (portship && IsPlayerAt(i, -1579.1, 24.1, -1484.0, 163.0)) GiveMoney(i, portshipmoney); if (pirateship && IsPlayerAt(i, 1995.5, 1518.0, 2006.0, 1569.0)) GiveMoney(i, pirateshipmoney); } } public GlobalPlayerSave() { new Float:x, Float:y, Float:z; for (new i=0;i maxhealth) { if (onhealthcheat == 1) KickPlayer(i, "!AntiCheat!", "Possible health cheat!"); if (onhealthcheat == 2) BanPlayer(i, "!AntiCheat!", "Possible health cheat!"); } } } public MoneyScan() { if (!moneyscan) return; for (new i=0;i maxmoney) { ResetPlayerMoney(i); if (onmoneycheat == 1) KickPlayer(i, "!AntiCheat!", "Possible money cheat!"); if (onmoneycheat == 2) BanPlayer(i, "!AntiCheat!", "Possible money cheat!"); } } public MoneyCheck() { if (!ignorenonscripttransactions) return; for (new i=0;i smoney[i]) GivePlayerMoney(i, -GetPlayerMoney(i)+smoney[i]); } public ColorCheck() { for (new i=0;i idlekicktime) { idle[i] = 0; KickPlayer(i, "!Protection!", "Idle"); } } else idle[i] = 0; idlepos[i][0] = x; idlepos[i][1] = y; idlepos[i][2] = z; } } public SpectatorUpdate() { for(new i=0;i 0 && 0 <= spectator[i][2] <= 2) { if (IsPlayerConnected(spectator[i][0])) { new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(spectator[i][0], x,y,z); GetPlayerFacingAngle(spectator[i][0], a); if (spectator[i][2] == 0) SetPlayerCameraPos(i, x-(floatsin(-a, degrees)*spectator[i][1]),y-(floatcos(-a, degrees)*spectator[i][1]),z+2); if (spectator[i][2] == 1) SetPlayerCameraPos(i, x+spectator[i][1],y+spectator[i][1],z+spectator[i][1]); if (spectator[i][2] == 2) SetPlayerCameraPos(i, x,y,z+spectator[i][1]); SetPlayerCameraLookAt(i, x,y,z); SetPlayerPos(i, x,y,z-30); } else { spectator[i][1] = INVALID_PLAYER_ID; SetSpawnInfo(i,0,classmodel[lastclass[i]],1686.26,1432.86,10.50,60.40,0,0,5,1,0,0); //1234 SpawnPlayer(i); FreezePlayer(i, true); GameTextForPlayer(i, "~r~Spectator mode off! ~n~~y~Player left the server.", 3000, 5); } } } public ReportTimeoutUpdate() { if (!reporting) return; for (new i=0;i 0) reporttimeout[i]--; } public VoteKickBanUpdate() { new string[MAX_STRING]; for (new i=0;i= votekickpercent) { votes[i] = 0; for (new j=0;j= votebanpercent) { votes[i] = 0; for (new j=0;j 0) mutetime[playerid] = strval(tmp); tmp = dini_Get(PlayerFile(playername[playerid]), "muted"); if (strval(tmp) == 1) { muted[playerid] = 1; format(string, sizeof(string), "UnMutePlayer%d", playerid); mutetimer[playerid] = SetTimer(string, mutetime[playerid]*60000, 0); } tmp = dini_Get(PlayerFile(playername[playerid]), "jailtime"); if (strval(tmp) > 0) jailtime[playerid] = strval(tmp); tmp = dini_Get(PlayerFile(playername[playerid]), "jailed"); if (strval(tmp) == 1) { jailed[playerid] = 1; format(string, sizeof(string), "UnJailPlayer%d", playerid); jailtimer[playerid] = SetTimer(string, jailtime[playerid]*60000, 0); } tmp = dini_Get(PlayerFile(playername[playerid]), "respect"); respect[playerid] = strval(tmp); tmp = dini_Get(PlayerFile(playername[playerid]), "color"); if (strlen(tmp)) { playercolor[playerid] = HexToInt(tmp); SetPlayerColor(playerid, HexToInt(tmp)); } tmp = dini_Get(PlayerFile(playername[playerid]), "clan"); format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(tmp2)) { clan[playerid] = tmp; tmp = dini_Get(tmp2, "color"); if (strlen(tmp)) { playercolor[playerid] = HexToInt(tmp); SetPlayerColor(playerid, HexToInt(tmp)); } } tmp = dini_Get(PlayerFile(playername[playerid]), "lastclass"); lastclass[playerid] = strval(tmp); } else { SendClientMessage(playerid, COLOR_YELLOW, "* In order to save your info (money, frags, etc) you need to /register."); SendClientMessage(playerid, COLOR_YELLOW, "* After successful registration identify yourself using /login."); if (registerrequired) SendClientMessage(playerid, COLOR_ORANGE, "* NOTE: Registration required on this server."); logged[playerid] = 1; } query[playerid] = spectator[playerid][0] = INVALID_PLAYER_ID; for (new i=0;i MAX_VALUE) bank[playerid] = MAX_VALUE; dini_IntSet(PlayerFile(playername[playerid]), "bank", bank[playerid]); dini_IntSet(PlayerFile(playername[playerid]), "bounty", bounty[playerid]); dini_IntSet(PlayerFile(playername[playerid]), "respect", respect[playerid]); if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED && !frozen[playerid]) { GetPlayerPos(playerid, x,y,z); dini_FloatSet(PlayerFile(playername[playerid]), "x", x); dini_FloatSet(PlayerFile(playername[playerid]), "y", y); dini_FloatSet(PlayerFile(playername[playerid]), "z", z); } tmp = dini_Get(PlayerFile(playername[playerid]), "killsinarow"); if (strval(tmp) < killsinarow[playerid]) dini_IntSet(PlayerFile(playername[playerid]), "killsinarow", killsinarow[playerid]); dini_IntSet(PlayerFile(playername[playerid]), "lastclass", lastclass[playerid]); GetPlayerHealth(playerid, hp); if (0 < hp < maxhealth) dini_FloatSet(PlayerFile(playername[playerid]), "health", hp); if (muted[playerid]) { dini_IntSet(PlayerFile(playername[playerid]), "muted", 1); dini_IntSet(PlayerFile(playername[playerid]), "mutetime", mutetime[playerid]); } else dini_Unset(PlayerFile(playername[playerid]), "muted"); if (jailed[playerid]) { dini_IntSet(PlayerFile(playername[playerid]), "jailed", 1); dini_IntSet(PlayerFile(playername[playerid]), "jailtime", jailtime[playerid]); } else dini_Unset(PlayerFile(playername[playerid]), "jailed"); format(string, sizeof(string), "--- %s logged out.", playername[playerid]); WriteLog(string); } KillTimer(logintimeout[playerid]); KillTimer(antispawnkilltimeout[playerid]); KillTimer(mutetimer[playerid]); KillTimer(jailtimer[playerid]); logged[playerid] = playercolor[playerid] = clan[playerid][0] = bank[playerid] = bounty[playerid] = god[playerid] = jailed[playerid] = muted[playerid] = 0; killsinarow[playerid] = cheatdeaths[playerid] = wrongpasses[playerid] = cheatweapons[playerid] = idle[playerid] = lastclass[playerid] = classrestored[playerid] = 0; mutetime[playerid] = jailtime[playerid] = frozen[playerid] = votes[playerid] = votetime[playerid] = respect[playerid] = 0; format(string, sizeof(string), "--- %s (id: %d) disconnected.", playername[playerid],playerid); WriteLog(string); playername[playerid][0] = 0; } public OnPlayerRequestClass(playerid, classid) { SetupPlayerForClassSelection(playerid); if (!classrestored[playerid]) { SetSpawnInfo(playerid,0,classmodel[lastclass[playerid]],1686.26,1432.86,10.50,60.40,0,0,5,1,0,0); //111 classrestored[playerid] = 1; } else lastclass[playerid] = classid; return 1; } public SetupPlayerForClassSelection(playerid) { SetPlayerInterior(playerid, 14); SetPlayerPos(playerid, 258.4893,-41.4008,1002.0234); SetPlayerFacingAngle(playerid, 270.0); SetPlayerCameraPos(playerid, 256.0815,-43.0475,1004.0234); SetPlayerCameraLookAt(playerid, 258.4893,-41.4008,1002.0234); } public OnPlayerSpawn(playerid) { new string[MAX_STRING]; new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING]; for(new p=0;p= respecttogetbounty) && bounty[playerid] > 0) { format(string, sizeof(string), "* You earned a bounty of $%d for killing %s.", bounty[playerid],playername[playerid]); SendClientMessage(killerid, COLOR_GREEN, string); GiveMoney(killerid, bounty[playerid]); bounty[playerid] = 0; } format(string, sizeof(string), "--- %s (id: %d) killed %s (id: %d) with weapon (id: %d).", playername[killerid],killerid,playername[playerid],playerid,reason); WriteLog(string); killsinarow[killerid]++; if (IsPlayerConnected(killerid)) if (IsPlayerInAnyVehicle(killerid) && GetVehicleDriver(GetPlayerVehicleID(killerid)) == killerid && PlayerAccess(killerid) < nopunishlevel && detected != 1) { respect[killerid] += respectfordriveby; respectchange2 += respectfordriveby; if (antidriveby) { format(string, sizeof(string), "--- %s (id: %d) punished for drive-by.", playername[killerid],killerid); WriteLog(string); SendClientMessage(killerid, COLOR_RED, "* You punished for drive-by."); if (ondriveby == 1) KickPlayer(killerid, "!Protection!", "Do not drive-by!"); if (ondriveby == 2) BanPlayer(killerid, "!Protection!", "Do not drive-by!"); if (ondriveby == 3) JailPlayer(killerid, "!Protection!", "Do not drive-by!", drivebyjailtime); if (ondriveby == 4) SetPlayerHealth(killerid, 0.0); } detected = 1; } if (IsPlayerConnected(killerid)) if (antispawnkill[playerid] == 1 && PlayerAccess(killerid) < nopunishlevel && detected != 1) { respect[killerid] += respectforspawnkill; respectchange2 += respectforspawnkill; if (enableantispawnkill) { format(string, sizeof(string), "--- %s (id: %d) punished for spawn killing.", playername[killerid],killerid); WriteLog(string); SendClientMessage(killerid, COLOR_RED, "* You punished for spawn killing."); if (onspawnkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on spawn!"); if (onspawnkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on spawn!"); if (onspawnkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on spawn!", spawnkilljailtime); if (onspawnkill == 4) SetPlayerHealth(killerid, 0.0); } detected = 1; } if (IsPlayerConnected(killerid)) if ((IsPlayerAt(playerid, 1530.9, -1370.2, 1563.0, -1346.3) || IsPlayerAt(killerid, 1530.9, -1370.2, 1563.0, -1346.3)) && PlayerAccess(killerid) < nopunishlevel && detected != 1) { respect[killerid] += respectforholdareakill; respectchange2 += respectforholdareakill; if (antirooftopkill) { format(string, sizeof(string), "--- %s (id: %d) punished for killing on the roof.", playername[killerid],killerid); WriteLog(string); SendClientMessage(killerid, COLOR_RED, "* You punished for killing on the roof."); if (onrooftopkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on hold areas!"); if (onrooftopkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on hold areas!"); if (onrooftopkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on hold areas!", rooftopkilljailtime); if (onrooftopkill == 4) SetPlayerHealth(killerid, 0.0); } detected = 1; } if (IsPlayerConnected(killerid)) if ((IsPlayerAt(playerid, -1579.1, 24.1, -1484.0, 163.0) || IsPlayerAt(killerid, -1579.1, 24.1, -1484.0, 163.0)) && PlayerAccess(playerid) < nopunishlevel && detected != 1) { respect[killerid] += respectforholdareakill; respectchange2 += respectforholdareakill; if (antiportshipkill) { format(string, sizeof(string), "--- %s (id: %d) punished for killing on the cargo ship.", playername[killerid],killerid); WriteLog(string); SendClientMessage(killerid, COLOR_RED, "* You punished for killing on the cargo ship."); if (onportshipkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on hold areas!"); if (onportshipkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on hold areas!"); if (onportshipkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on hold areas!", portshipkilljailtime); if (onportshipkill == 4) SetPlayerHealth(killerid, 0.0); } detected = 1; } if (IsPlayerConnected(killerid)) if ((IsPlayerAt(playerid, 1995.5, 1518.0, 2006.0, 1569.0) || IsPlayerAt(killerid, 1995.5, 1518.0, 2006.0, 1569.0)) && PlayerAccess(killerid) < nopunishlevel && detected != 1) { respect[killerid] += respectforholdareakill; respectchange2 += respectforholdareakill; if (antipirateshipkill) { format(string, sizeof(string), "--- %s (id: %d) punished for killing on the pirate ship.", playername[killerid],killerid); WriteLog(string); SendClientMessage(killerid, COLOR_RED, "* You punished for killing on the pirate ship."); if (onpirateshipkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on hold areas!"); if (onpirateshipkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on hold areas!"); if (onpirateshipkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on hold areas!", pirateshipkilljailtime); if (onpirateshipkill == 4) SetPlayerHealth(killerid, 0.0); } detected = 1; } if (IsPlayerConnected(killerid)) { if (jailed[killerid] && addtimeforkillinjail != 0) { jailtime[killerid] += addtimeforkillinjail; format(string, sizeof(string), "--- %s (id: %d) punished for killing in the jail: %d minutes.", playername[killerid],killerid,addtimeforkillinjail); WriteLog(string); if (addtimeforkillinjail < 0) format(string, sizeof(string), "~w~%d ~r~minutes!", addtimeforkillinjail); if (addtimeforkillinjail > 0) format(string, sizeof(string), "~w~+%d ~r~minutes! ~n~Do not kill here!", addtimeforkillinjail); GameTextForPlayer(killerid, string, 3000, 5); detected = 1; } if ((detected != 1 || !savemoneyonbadkill) && playercash > 0) SwapMoney(playerid, killerid, playercash); if (antiweaponcheat && PlayerAccess(killerid) < nopunishlevel) { for (new i=0;i<47;i++) if (reason == strval(strtok(forbiddenweapons, idx, ',')) && reason != 0) { cheatdeaths[playerid]++; if (antideathcheat && cheatdeaths[playerid] >= cheatdeathstopunish && PlayerAccess(playerid) < nopunishlevel) { if (ondeathcheat == 1) KickPlayer(playerid, "!AntiCheat!", "Death cheat detected!"); if (ondeathcheat == 2) BanPlayer(playerid, "!AntiCheat!", "Death cheat detected!"); } else { cheatweapons[killerid]++; if (cheatweapons[killerid] >= weaponcheatstopunish) { if (onweaponcheat == 1) KickPlayer(killerid, "!AntiCheat!", "Forbidden weapon detected!"); if (onweaponcheat == 2) BanPlayer(killerid, "!AntiCheat!", "Forbidden weapon detected!"); } } break; } } } } if (dini_Exists(PlayerFile(playername[playerid])) && logged[playerid] == 1) { dini_IntSet(PlayerFile(playername[playerid]), "deaths", dini_Int(PlayerFile(playername[playerid]), "deaths")+1); dini_Unset(PlayerFile(playername[playerid]), "x"); dini_Unset(PlayerFile(playername[playerid]), "y"); dini_Unset(PlayerFile(playername[playerid]), "z"); dini_Unset(PlayerFile(playername[playerid]), "health"); if (strlen(clan[playerid])) format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[playerid])); if (dini_Exists(tmp) && logged[playerid] == 1) dini_IntSet(tmp, "deaths", dini_Int(tmp, "deaths")+1); } respect[playerid] += respectfordeath; respectchange1 += respectfordeath; if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); dini_IntSet(FILE_TOTALSTAT, "deaths", dini_Int(FILE_TOTALSTAT, "deaths")+1); killsinarow[playerid] = 0; KillTimer(antispawnkilltimeout[playerid]); if (respectchange1 != 0) { if (respectchange1 > 0) format(string, sizeof(string), "~g~RESPECT: %d (~w~TOTAL: %d~g~)", respectchange1,respect[playerid]); else format(string, sizeof(string), "~r~RESPECT: %d (~w~TOTAL: %d~r~)", respectchange1,respect[playerid]); GameTextForPlayer(playerid, string, 3000, 5); } if (respectchange2 != 0 && IsPlayerConnected(killerid)) { if (respectchange2 > 0) format(string, sizeof(string), "~g~RESPECT: %d (~w~TOTAL: %d~g~)", respectchange2,respect[killerid]); else format(string, sizeof(string), "~r~RESPECT: %d (~w~TOTAL: %d~r~)", respectchange2,respect[killerid]); GameTextForPlayer(killerid, string, 3000, 5); } return 1; } public OnPlayerText(playerid, text[]) { new string[MAX_STRING]; new tmp[MAX_STRING], tmp2[MAX_STRING]; new color; if (!allowdeadpeoplechating && (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED)) { format(string, sizeof(string), "--- Blocked message from dead %s (id: %d): %s", playername[playerid],playerid,text); WriteLog(string); SendClientMessage(playerid, COLOR_RED, "* You dead and cannot send messages."); return 0; } tmp = dini_Get(PlayerFile(playername[playerid]), "pmprefix"); if (!strlen(tmp)) tmp = queryprefix; if (text[0] == tmp[0] && query[playerid] != INVALID_PLAYER_ID) { if (IsPlayerConnected(query[playerid])) { format(string, sizeof(string), "! PM: %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[query[playerid]],query[playerid],text); WriteLog(string); if (adminsseepms) SendAdminMessage(playercolor[playerid], string); format(string, sizeof(string), "! PM to %s (id: %d): %s", playername[query[playerid]],query[playerid],text); SendClientMessage(playerid, playercolor[playerid], string); if (ignore[query[playerid]][playerid] != 1) { format(string, sizeof(string), "! PM from %s (id: %d): %s", playername[playerid],playerid,text); SendClientMessage(query[playerid], playercolor[playerid], string); } } else { format(string, sizeof(string), "* %d is not an active player.", query[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); } return 0; } if (muted[playerid] == 1) { format(string, sizeof(string), "--- Muted message from %s (id: %d): %s", playername[playerid],playerid,text); WriteLog(string); GameTextForPlayer(playerid, "~r~You are muted and cannot send messages.", 3000, 5); return 0; } if (strlen(clan[playerid])) format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[playerid])); if (dini_Exists(tmp) && logged[playerid] == 1) { tmp2 = dini_Get(tmp2, "clanchatprefix"); if (!strlen(string)) tmp2 = clanchatprefix; if (text[0] == tmp2[0]) { format(string, sizeof(string), "@ CLANCHAT: %s (id: %d) to %s clan: %s", playername[playerid],playerid,clan[playerid],text); WriteLog(string); for (new i=0;i= 1) { format(string, sizeof(string), "# ADMINCHAT: %s (id: %d): %s", playername[playerid],playerid,text); WriteLog(string); format(string, sizeof(string), "# ADMINCHAT: %s (id: %d): %s", playername[playerid],playerid,text); SendAdminMessage(HexToInt(adminchatcolor), string); return 0; } format(string, sizeof(string), "%s (id: %d): %s", playername[playerid],playerid,text); WriteLog(string); if (usestandardchat) return 1; else SendChatMessage(playerid, playercolor[playerid], string); return 0; } public OnPlayerPrivmsg(playerid, targetid, text[]) { new string[MAX_STRING]; if (muted[playerid] == 1 && mutepmsonmuting) { format(string, sizeof(string), "--- Muted private message from %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[targetid],targetid,text); WriteLog(string); GameTextForPlayer(playerid, "~r~You are muted and cannot send messages.", 3000, 5); return 0; } if (!usestandardpms) { if (IsPlayerConnected(targetid)) { format(string, sizeof(string), "! PM: %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[targetid],targetid,text); WriteLog(string); if (adminsseepms && !PlayerAccess(playerid)) SendAdminMessage(playercolor[playerid], string); format(string, sizeof(string), "! PM to %s (id: %d): %s", playername[targetid],targetid,text); SendClientMessage(playerid, playercolor[playerid], string); if (ignore[targetid][playerid] != 1) { format(string, sizeof(string), "! PM from %s (id: %d): %s", playername[playerid],playerid,text); SendClientMessage(targetid, playercolor[playerid], string); } } else { format(string, sizeof(string), "* %d is not an active player.", targetid); SendClientMessage(playerid, COLOR_YELLOW, string); } } else { if (IsPlayerConnected(targetid)) { format(string, sizeof(string), "! PM: %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[targetid],targetid,text); WriteLog(string); if (adminsseepms && !PlayerAccess(playerid)) SendAdminMessage(playercolor[playerid], string); if (ignore[targetid][playerid] == 1) return 0; else return 1; } } return 0; } public OnPlayerCommandText(playerid, cmdtext[]) { if (!IsPlayerConnected(playerid)) return 0; new string[MAX_STRING]; new cmd[MAX_STRING]; new giveplayerid, moneys, idx, weaponid; new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING]; new Float:x, Float:y, Float:z; cmd = strtok(cmdtext, idx); strmid(tmp, cmd, 1, strlen(cmd)); for (new k=0;tmp[k];k++) { if ('a' <= tmp[k] <= 'z' || 'A' <= tmp[k] <= 'Z' || 0 <= tmp[k] <= 9) { if(strcmp(cmd, "/ping", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Pong"); GameTextForPlayer(playerid,"~b~Pong",6000,5); return 1; } if (strcmp(cmd, "/help", true) == 0) { SendClientMessage(playerid, 0xAA3333AA, "Join the forums at http://"); SendClientMessage(playerid, 0x33AA33AA, "This is a reallife & roleplay server"); SendClientMessage(playerid, 0x33AA33AA, "Live your life & get a job (sign up on forums) earn money have fun"); SendClientMessage(playerid, 0xAA3333AA, "Type /commands for a full list of commands."); return 1; } if (strcmp(cmdtext, "/ef", true)==0) { if(IsPlayerInAnyVehicle(playerid)) { new VID; VID = GetPlayerVehicleID(playerid); if(Gas[VID] > 0) { SendClientMessage(playerid, COLOR_WHITE, "You still have fuel!"); return 1; } if(Gas[VID] == 0) { Gas[VID] = 50; GivePlayerMoney(playerid,-500); SendClientMessage(playerid, COLOR_WHITE, "Emergency fuel, find a station!"); } } else { SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!"); } return 1; } if (strcmp(cmdtext, "/bt", true)==0) { if(IsPlayerInAnyVehicle(playerid)) { new VID; VID = GetPlayerVehicleID(playerid); if(Gas[VID] > 125) { SendClientMessage(playerid, COLOR_WHITE, "You already brought this fuel!"); return 1; } if(Gas[VID] > 9) { Gas[VID] = 500; GivePlayerMoney(playerid,-900); SendClientMessage(playerid, COLOR_WHITE, "You have brought a bigger tank."); } } else { SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!"); } return 1; } //{ //SendClientMessage(playerid, COLOR_RED, "You don't have enough money"); //} //return 1; if (strcmp(cmd, "/commands", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Account: /rules /register /login /setpass /stats /resetpos"); SendClientMessage(playerid, COLOR_GREEN,"Chat: /pm (or /msg) /me /(un)ignore /advert "); SendClientMessage(playerid, COLOR_GREEN,"Money: /bank /get /balance /send /transact /hitman /bounty"); SendClientMessage(playerid, COLOR_GREEN,"Fuel: /Refuel /gaslocs /bt (buy bigger tank) /ef (emergancy fuel) "); SendClientMessage(playerid, COLOR_GREEN,"Other: /callcops /calltaxi /intaxi(once in taxi) /taxijob"); SendClientMessage(playerid, COLOR_RED,"Type /commands2 for more commands"); return 1; } if (strcmp(cmd, "/commands2", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Properties: /buy /sell /prop(list,info) /myprops"); SendClientMessage(playerid, COLOR_GREEN,"Other: /spectate(off) /para /skydive /flyto(ls,sf,lv)"); SendClientMessage(playerid, COLOR_GREEN,"Other: /getpos /time /totalstats /report /votekick"); SendClientMessage(playerid, COLOR_GREEN,"Other: /callcops /calltaxi /intaxi(once in taxi) /taxijob"); SendClientMessage(playerid, COLOR_GREEN,"Teleports: /wang /lv /park /dm"); SendClientMessage(playerid, COLOR_YELLOW,"Races: /drift /kart"); SendClientMessage(playerid, COLOR_RED,"Type /clanhelp for gang/clan commands"); return 1; } if (strcmp(cmd, "/clanhelp", true) == 0) { SendClientMessage(playerid, COLOR_WHITE,"Clan: /clan(register,join,quit,invite,kick,setleader,allowinvite)"); SendClientMessage(playerid, COLOR_WHITE,"Clan: /clan(chatprefix,changecolor,stats,bank,get,balance)"); return 1; } if(strcmp(cmdtext,"/health",true)==0) { new Float:PlayerHP; GetPlayerHealth(playerid,PlayerHP); format(string, sizeof(string), "Your health is: %.0f", PlayerHP); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(strcmp(cmdtext, "/calltaxi", true) == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof (pname)); format(string, sizeof(string), " %s Needs a Taxi", pname); SendClientMessage(playerid, COLOR_GREEN, string); // GameTextForAll(string ,3000,5); return 1;} else if(strcmp(cmdtext, "/intaxi", true) == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof (pname)); format(string, sizeof(string), " %s Doesent need taxi any more", pname); SendClientMessage(playerid, COLOR_GREEN, string); // GameTextForAll(string ,3000,5); return 1;} else if(strcmp(cmd, "/taxijob", true) == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof (pname)); format(string, sizeof(string), " %s Is now taxi driver if you need taxi type /taxi", pname); SendClientMessage(playerid, COLOR_GREEN, string); // GameTextForAll(string ,3000,5); SetPlayerColor(playerid, COLOR_YELLOW); return 1; } if (strcmp(cmd, "/po", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /po [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "Officer %s (id: %d) Has asked %s (id: %d)to p.", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "Officer %s (id: %d) Has asked %s (id: %d)to pull over to the side of the road.", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_RED, string); format(string, sizeof(string), "Officer %s (id: %d) has asked you to pull over, please.", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if(strcmp(cmd, "/lv", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1713.4164,1446.8452,10.7722); else SetPlayerInterior(playerid,0); //Needed to do not crash huh? SetPlayerPos(playerid,1682.4164,1446.8452,10.7722); format(string, sizeof(string), "%s (id: %d) Has teleported to lv.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) Has teleported to lv.", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); GivePlayerMoney(playerid,-3000); return 1; } if(strcmp(cmd, "/wang", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-2003.3442,288.9917,34.6972); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-1929.3132,249.4710,40.7176); format(string, sizeof(string), "%s (id: %d) Has teleported to wang.", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); GivePlayerMoney(playerid,-3000); return 1; } if(strcmp(cmd, "/Grove", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2491.2063,-1665.5610,13.3438); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2466.0586,-1669.8325,13.4758); format(string, sizeof(string), "%s (id: %d) Has teleported to grove.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) Has teleported to grove.", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); GivePlayerMoney(playerid,-3000); return 1; } if(strcmp(cmd, "/armyiuserazor", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),218.57,1868.16,13.14); else SetPlayerInterior(playerid,0); SetPlayerInterior(playerid,0); SetPlayerPos(playerid,218.57,1868.16,13.14); SendClientMessage(playerid,COLOR_GREEN,"Army: You Are Now Logged in."); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 31, 500); playercolor[playerid] = 0x33AA33AA; SetPlayerColor(playerid, 0x33AA33AA); return 1; } if(strcmp(cmd, "/911", true) == 0) { SendClientMessage(playerid,COLOR_BLUE,"You have call the police."); ResetPlayerWeapons(playerid); playercolor[playerid] = 0x00FFFFFF; SetPlayerColor(playerid, 0x00FFFFFF); format(string, sizeof(string), "%s (id: %d) needs police help now!", playername[playerid],playerid); SendClientMessageToAll(COLOR_BLUE, string); return 1; } if (strcmp(cmd, "/callcops", true) == 0) { SendClientMessage(playerid,COLOR_BLUE,"You have call the police."); ResetPlayerWeapons(playerid); playercolor[playerid] = 0x00FFFFFF; SetPlayerColor(playerid, 0x00FFFFFF); format(string, sizeof(string), "%s (id: %d) needs police help now!", playername[playerid],playerid); SendClientMessageToAll(COLOR_BLUE, string); return 1; } if(strcmp(cmd, "/rvd545", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2128.25,-2277.42,20.66); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2128.25,-2277.42,20.66); SendClientMessage(playerid,COLOR_WHITE,"MF: You Are Now Logged in"); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 4000); GivePlayerWeapon(playerid, 26, 4000); GivePlayerWeapon(playerid, 32, 400); SetPlayerHealth(playerid,100); playercolor[playerid] = 0xFFFFFFAA; SetPlayerColor(playerid, 0xFFFFFFAA); return 1; } if(strcmp(cmd, "/fbi70uk", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),934.03,1728.76,15.68); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,934.03,1728.76,15.68); SendClientMessage(playerid,COLOR_BLUE,"SWAT/FBI: You Are Now Logged in."); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 25); GivePlayerWeapon(playerid, 29, 400); GivePlayerWeapon(playerid, 32, 400); SetPlayerHealth(playerid,100); playercolor[playerid] = 0x6666FFAA; SetPlayerColor(playerid, 0x6666FFAA); SendClientMessage(playerid,COLOR_BLUE,"TIP: Players marked lightblue need police help."); SendClientMessage(playerid,COLOR_RED,"TIP: Use /suspect [id] || different color (red) to mark criminal"); UnlockPoliceCars(playerid); Police[playerid] = 1; new VID; VID = GetPlayerVehicleID(playerid); Gas[VID] = 1000; return 1; } if(strcmp(cmd, "/house9099", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1276.3887,2522.2524,10.8203); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1276.3887,2522.2524,10.8203); SendClientMessage(playerid,COLOR_ORANGE,"HOUSE ID(01) LOGGED IN"); SendClientMessage(playerid,COLOR_BLUE,"Home sweet home.."); new VID; VID = GetPlayerVehicleID(playerid); Gas[VID] = 100; return 1; } if(strcmp(cmd, "/house4004", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-1446.4948,-1544.9269,102.1984); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-1446.4948,-1544.9269,102.1984); SendClientMessage(playerid,COLOR_ORANGE,"HOUSE ID(02) LOGGED IN"); SendClientMessage(playerid,COLOR_BLUE,"Home sweet home.."); new VID; VID = GetPlayerVehicleID(playerid); Gas[VID] = 100; return 1; } /* if(strcmp(cmd, "/ticket", true) == 0) if(IsPlayerAdmin(playerid))// ||// Level[playerid] == 1 //this is the level that you have defined at the login { new tmp1[256]; new amount; new receiver; tmp = strtok(cmdtext, idx); if(!strlen(tmp1)) { SendPlayerFormattedText(playerid,"Usage: /ticket [playerid]",0); } else { if(!IsPlayerConnected(strval(tmp1))) { SendClientMessage()SendPlayerFormattedTextGameTextForPlayer()(playerid,"Invalid Player ID to ticket.",0); } else { receiver = strval(tmp1); tmp1 = strtok(cmdtext, idx); amount = -1000; if(!amount) { SendPlayerFormattedText(playerid,"Usage: /ticket [playerid]",0); } else { GivePlayerMoney(receiver,amount); new tempstr[256]; format(tempstr, sizeof(tempstr), "You have given a ticket for $%d.",amount); SendPlayerFormattedText(playerid,tempstr,0); format(tempstr, sizeof(tempstr), "You have been given a ticket for $%d",amount); SendPlayerFormattedText(giveplayerid,tempstr,0); } } } return 1; } */ if(strcmp(cmd, "/swat70uk", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),950.40,1711.16,8.73); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,950.40,1711.16,8.73); SendClientMessage(playerid,COLOR_BLUE,"You Are Now Logged in."); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 25); GivePlayerWeapon(playerid, 29, 400); GivePlayerWeapon(playerid, 32, 400); SetPlayerHealth(playerid,100); playercolor[playerid] = 0x6666FFAA; SetPlayerColor(playerid, 0x6666FFAA); SendClientMessage(playerid,COLOR_BLUE,"TIP: Players marked lightblue need police help."); SendClientMessage(playerid,COLOR_RED,"TIP: Use /suspect [id] || different color (red) to mark criminal"); UnlockPoliceCars(playerid); Police[playerid] = 1; return 1; } if(strcmp(cmd, "/lon70uk", true)==0) { if(Police[playerid] != 1) { SendClientMessage(playerid, COLOR_RED, "You are now logged in as an official police officer"); SendClientMessage(playerid, COLOR_GREEN, "Type /lvpd || /lon70roof || /lon70ls ||."); GivePlayerWeapon(playerid, 24, 450); playercolor[playerid] = 0x6666FFAA; SetPlayerColor(playerid, 0x6666FFAA); SetPlayerPos(playerid,2293.2595,2451.6453,10.8203); UnlockPoliceCars(playerid); Police[playerid] = 1; return 1; } } if(strcmp(cmd, "/lvpd", true) == 0) { if(Police[playerid] == 1) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2293.2595,2451.6453,10.8203); SendClientMessage(playerid, COLOR_GREEN, "Welcome To The PD."); return 1; } return 0; } if(strcmp(cmd, "/lon70roof", true) == 0) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2263.7935,2436.9377,46.9766); return 1; } if(strcmp(cmd, "/lon70ls", true) == 0) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1551.2007,-1675.4921,15.7439); return 1; } if(strcmp(cmd, "/tgmloco", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),187.22,-1324.22,81.50); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,187.22,-1324.22,81.50); SendClientMessage(playerid,COLOR_ORANGE,"You Are Now Logged in."); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 33, 2005); GivePlayerWeapon(playerid, 25, 2050); GivePlayerWeapon(playerid, 30, 400); SetPlayerHealth(playerid,100); playercolor[playerid] = 0xB9B900FF; SetPlayerColor(playerid, 0xB9B900FF); return 1; } if(strcmp(cmd, "/redadminftw", true) == 0) { IsPlayerAdmin(playerid); SendClientMessage(playerid,COLOR_RED,"Admin: You Are Now Red."); SetPlayerColor(playerid, COLOR_RED); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 27, 10000); return 1; } if(strcmp(cmd, "/Blueadminftw", true) == 0) { IsPlayerAdmin(playerid); SendClientMessage(playerid,COLOR_RED,"Admin: You Are Now Blue."); SetPlayerColor(playerid, COLOR_BLUE); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 30, 10000); return 1; } if(strcmp(cmd, "/Drift", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2289.8887,1393.3649,42.5641); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2327.1433,1386.7778,42.8203); format(string, sizeof(string), "%s (id: %d) Has entered the drift race.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) has entered the drift race.", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); SendClientMessageToAll(COLOR_YELLOW,"Type /Drift to join"); SendClientMessage(playerid,COLOR_YELLOW,"Type /Countdown to Begin"); GivePlayerMoney(playerid,-500); return 1; } if(strcmp(cmd, "/Park", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1880.7683,-1384.0571,13.4099); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1958.3021,-1457.9878,13.2228); format(string, sizeof(string), "%s (id: %d) Has teleported to the stunt park. (/park)", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) Has teleported to the stunt park (/park).", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); GivePlayerMoney(playerid,-1000); return 1; } if(strcmp(cmd, "/Loco", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2657.1306,-2003.4412,12.9530); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2659.3164,-2010.1752,13.1287); format(string, sizeof(string), "%s (id: %d) Has teleported to loco.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) Has teleported to loco. (/loco)", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); GivePlayerMoney(playerid,-1000); return 1; } if(strcmp(cmd, "/Dm", true) == 0) { SetPlayerPos(playerid,2585.8291,2825.6921,19.9922); format(string, sizeof(string), "%s (id: %d) Has entered the /dm.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) Has entered the /dm.", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); SendClientMessageToAll(COLOR_YELLOW,"Type /Dm to join them!"); GivePlayerWeapon(playerid, 28, 20); GivePlayerMoney(playerid,-10000); return 1; } if(strcmp(cmd, "/kart", true) == 0) { SetPlayerPos(playerid,1276.6871,157.0860,20.3087); format(string, sizeof(string), "%s (id: %d) Has entered the /dm.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "%s (id: %d) Has entered the kart race (/kart to join them).", playername[playerid],playerid); SendClientMessageToAll(COLOR_YELLOW, string); GivePlayerMoney(playerid,-500); return 1; } if (strcmp(cmd, "/laws", true) == 0) { SendClientMessage(playerid, COLOR_GREY,"laws:"); SendClientMessage(playerid, COLOR_GREY,"."); return 1; } if (strcmp(cmd, "/rules", true) == 0) { SendClientMessage(playerid, COLOR_GREY,"Rules:"); SendClientMessage(playerid, COLOR_GREY,"No jacking, no cfing, no deathmatching. "); SendClientMessage(playerid, COLOR_GREY,"Only official Mafias/gangs can war other gangs/mafias but NOT Deathmatch"); SendClientMessage(playerid, COLOR_GREY,"Always obey the admins and police (unless roleplaying chase etc.)"); return 1; } if (strcmp(cmd, "/joinus", true) == 0) { SendClientMessageToAll(COLOR_RED,"Want to be in a police officer? or taxi driver or something else?"); SendClientMessageToAll(COLOR_RED,"Goto http://forum..org"); return 1; } if (strcmp(cmd, "/joinfbi", true) == 0) { SendClientMessageToAll(COLOR_RED,"Want to join the FBI?"); SendClientMessageToAll(COLOR_RED,"Goto http://forum..org"); return 1; } if (strcmp(cmd, "/jointaxi", true) == 0) { SendClientMessageToAll(COLOR_RED,"Want to be a taxi driver?"); SendClientMessageToAll(COLOR_RED,"Goto http://forum..org"); return 1; } if (strcmp(cmd, "/bu", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bu [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_RED, string); // format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", playername[playerid],playerid); // SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/au", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /au [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "%s (id: %d) has requested all units on (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "Officer %s (id: %d) has requested all units on (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_RED, string); // format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", playername[playerid],playerid); // SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/suspect", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /suspect [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "Officer %s (id: %d) has marked %s (id: %d) as a criminal).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "Officer %s (id: %d) has requested all units on wanted suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_RED, string); playercolor[giveplayerid] = 0xCC2222AA; SetPlayerColor(giveplayerid, 0xCC2222AA); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/gotsuspect", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotsuspect [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "Officer %s (id: %d) has marked %s (id: %d) as a criminal).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "Officer %s (id: %d) Has taken down suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_RED, string); playercolor[giveplayerid] = 0xFFFFFFAA; SetPlayerColor(giveplayerid, 0xFFFFFFAA); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/register", true) == 0) { if (!allowregister) { SendClientMessage(playerid, COLOR_RED, "* Register are not allowed on this server!"); return 1; } if (dini_Int(FILE_TOTALSTAT, "users") >= maxusers) { SendClientMessage(playerid, COLOR_RED, "* Sorry, user limit reached and you cannot register!"); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /register [password]"); return 1; } if (20 < strlen(tmp) || strlen(tmp) < 5) { SendClientMessage(playerid, COLOR_YELLOW, "* Password length must be 5-20 symbols."); return 1; } if (!dini_Exists(PlayerFile(playername[playerid]))) { new day, month, year; getdate(year,month,day); dini_Create(PlayerFile(playername[playerid])); format(tmp2, sizeof(tmp2), "%d.%d.%d", day,month,year); dini_Set(PlayerFile(playername[playerid]), "registered", tmp2); dini_IntSet(PlayerFile(playername[playerid]), "password", num_hash(tmp)); if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); tmp3 = dini_Get(FILE_TOTALSTAT, "users"); dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp3)+1); dini_Set(FILE_TOTALSTAT, "lastuser", playername[playerid]); dini_Set(FILE_TOTALSTAT, "lastregdate", tmp2); format(string, sizeof(string), "--- %s (id: %d) created account.", playername[playerid],playerid); WriteLog(string); format(string, sizeof(string), "* Account named %s created! You can login with password %s.", playername[playerid],tmp); SendClientMessage(playerid, COLOR_GREEN, string); } else { format(string, sizeof(string), "* %s already registered.", playername[playerid]); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/login", true) == 0) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /login [password]"); return 1; } if (dini_Exists(PlayerFile(playername[playerid]))) { if (logged[playerid] == 1) SendClientMessage(playerid, COLOR_YELLOW, "* You already logged."); else { tmp2 = dini_Get(PlayerFile(playername[playerid]), "password"); if (num_hash(tmp) != strval(tmp2)) { format(string, sizeof(string), "--- %s (id: %d) typed wrong password.", playername[playerid],playerid); WriteLog(string); GameTextForPlayer(playerid, "~r~Wrong password!", 3000, 5); wrongpasses[playerid]++; if (wrongpasses[playerid] >= wrongpassestokick) KickPlayer(playerid, "!Protection!", "Too many invalid passwords!"); } else { new h, m, s; new day, month, year; gettime(h,m,s); getdate(year,month,day); logged[playerid] = 1; KillTimer(logintimeout[playerid]); format(tmp, sizeof(tmp), "%d.%d.%d [%d:%d:%d]", day,month,year,h,m,s); dini_Set(PlayerFile(playername[playerid]), "lastlogged", tmp); format(string, sizeof(string), "--- %s (id: %d) logged in.", playername[playerid],playerid); WriteLog(string); GameTextForPlayer(playerid, "~g~Logged in!", 3000, 5); } } } else { format(string, sizeof(string), "* %s no such account.", playername[playerid]); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/setpass", true) == 0) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setpass [password]"); return 1; } if (20 < strlen(tmp) || strlen(tmp) < 5) { SendClientMessage(playerid, COLOR_YELLOW, "* Password length must be 5-20 symbols."); return 1; } if (dini_Exists(PlayerFile(playername[playerid]))) { if (logged[playerid] == 1) { dini_IntSet(PlayerFile(playername[playerid]), "password", num_hash(tmp)); format(string, sizeof(string), "--- %s (id: %d) changed his pass to %s.", playername[playerid], playerid, tmp); WriteLog(string); format(string, sizeof(string), "* Password changed to %s, remember it.", tmp); SendClientMessage(playerid, COLOR_GREEN, string); } else SendClientMessage(playerid, COLOR_RED, "* You must be logged in to change your password."); } else { format(string, sizeof(string), "* %s no such account.", playername[playerid]); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/stats", true) == 0) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { if (dini_Exists(PlayerFile(playername[playerid]))) { format(string, sizeof(string), "* Statistic for %s:", playername[playerid]); SendClientMessage(playerid, COLOR_ORANGE, string); for (new i=0;i= 1) { for (new i=0;i= maxclans) { SendClientMessage(playerid, COLOR_RED, "* Sorry, clan limit reached."); return 1; } if (respectrequired && respect[playerid] < respecttocreateclan) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttocreateclan); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanregister [clanname]"); return 1; } for (new n=0;tmp[n];n++) { if ('a' <= tmp[n] <= 'z' || 'A' <= tmp[n] <= 'Z' || 0 <= tmp[n] <= 9) { tmp2 = dini_Get(PlayerFile(playername[playerid]), "clan"); format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp2)); if (dini_Exists(tmp2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You must quit your clan first."); return 1; } format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(tmp2)) { format(string, sizeof(string), "* Clan %s already exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); return 1; } new day, month, year; getdate(year,month,day); dini_Create(tmp2); format(tmp3, sizeof(tmp3), "%d.%d.%d", day,month,year); dini_Set(tmp2, "registered", tmp3); dini_Set(tmp2, "leader", playername[playerid]); tmp3 = dini_Get(tmp2, "members"); dini_IntSet(tmp2, "members", strval(tmp3)+1); dini_Set(PlayerFile(playername[playerid]), "clan", tmp); clan[playerid] = tmp; if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); tmp2 = dini_Get(FILE_TOTALSTAT, "clans"); dini_IntSet(FILE_TOTALSTAT, "clans", strval(tmp2)+1); dini_Set(FILE_TOTALSTAT, "lastclan", tmp); format(tmp3, sizeof(tmp3), "%d.%d.%d", day,month,year); dini_Set(FILE_TOTALSTAT, "lastclanregdate", tmp3); format(string, sizeof(string), "--- %s (id: %d) registered clan %s.", playername[playerid],playerid,tmp); WriteLog(string); format(string, sizeof(string), "* Clan %s successfully registered! You are the leader!", tmp); SendClientMessage(playerid, COLOR_GREEN, string); SendClientMessage(playerid, COLOR_GREEN, "* Now you can invite other players in your clan using /claninvite command."); } else { SendClientMessage(playerid, COLOR_RED, "* Clan name should contain ONLY latin characters and digits!"); return 1; } } return 1; } if (strcmp(cmd, "/clanjoin", true) == 0) { if (!clans) { SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!"); return 1; } if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this."); return 1; } if (!strlen(claninvite[playerid])) { SendClientMessage(playerid, COLOR_RED, "* You wasn't invited in any clan."); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "clan"); format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(tmp)) { SendClientMessage(playerid, COLOR_YELLOW, "* You must quit your clan first."); return 1; } format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(claninvite[playerid])); if (!dini_Exists(tmp)) { format(string, sizeof(string), "* Clan %s not exists!", claninvite[playerid]); SendClientMessage(playerid, COLOR_RED, string); return 1; } clan[playerid] = claninvite[playerid]; claninvite[playerid][0] = 0; dini_Set(PlayerFile(playername[playerid]), "clan", clan[playerid]); tmp2 = dini_Get(tmp, "members"); dini_IntSet(tmp, "members", strval(tmp2)+1); tmp2 = dini_Get(tmp, "color"); if (strlen(tmp2)) { playercolor[playerid] = HexToInt(tmp2); SetPlayerColor(playerid, HexToInt(tmp2)); } for (new i=0;i 0) dini_IntSet(tmp, "members", strval(tmp2)-1); format(string, sizeof(string), "--- %s (id: %d) left clan %s.", playername[playerid],playerid,clan[playerid]); WriteLog(string); format(string, sizeof(string), "* You left clan %s.", clan[playerid]); SendClientMessage(playerid, COLOR_RED, string); playercolor[playerid] = playerColors[playerid]; SetPlayerColor(playerid, playerColors[playerid]); tmp2 = dini_Get(PlayerFile(playername[playerid]), "color"); if (strlen(tmp2)) { playercolor[playerid] = HexToInt(tmp2); SetPlayerColor(playerid, HexToInt(tmp2)); } tmp2 = dini_Get(tmp, "leader"); if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) == 0) { dini_Remove(tmp); for (new i=0;i 0) dini_IntSet(tmp, "members", strval(tmp3)-1); format(string, sizeof(string), "--- %s (id: %d) kicked %s from clan %s.", playername[playerid],playerid,tmp2,clan[playerid]); WriteLog(string); format(string, sizeof(string), "* You kicked %s from your clan.", tmp2); SendClientMessage(playerid, COLOR_RED, string); giveplayerid = GetPlayerId(tmp2); if (giveplayerid != INVALID_PLAYER_ID) { clan[giveplayerid][0] = 0; playercolor[giveplayerid] = playerColors[giveplayerid]; SetPlayerColor(giveplayerid, playerColors[giveplayerid]); tmp3 = dini_Get(PlayerFile(playername[giveplayerid]), "color"); if (strlen(tmp3)) { playercolor[giveplayerid] = HexToInt(tmp3); SetPlayerColor(giveplayerid, HexToInt(tmp3)); } format(string, sizeof(string), "* %s (id: %d) kicked you from clan %s.", playername[playerid],playerid,clan[playerid]); SendClientMessage(giveplayerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/clansetleader", true) == 0) { if (!clans) { SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!"); return 1; } if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this."); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "clan"); format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (!dini_Exists(tmp)) { SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan."); return 1; } tmp2 = dini_Get(tmp, "leader"); if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it."); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp2)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clansetleader [playername]"); return 1; } if (strcmp(playername[playerid], tmp2, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "* You already a leader."); return 1; } tmp3 = dini_Get(PlayerFile(tmp2), "clan"); if (strlen(tmp3) && strcmp(clan[playerid], tmp3, true) != 0) { format(string, sizeof(string), "* %s is not in your clan.", tmp2); SendClientMessage(playerid, COLOR_RED, string); return 1; } dini_Set(tmp, "leader", tmp2); for (new i=0;i 1) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanallowinvite [0-1]"); return 1; } dini_IntSet(tmp, "allowinvite", moneys); if (moneys == 0) { format(string, sizeof(string), "--- %s (id: %d) disallowed members to invite into clan %s.", playername[playerid],playerid,clan[playerid]); WriteLog(string); SendClientMessage(playerid, COLOR_RED, "* Now only you can invite players into clan!"); } else { format(string, sizeof(string), "--- %s (id: %d) allowed members to invite into clan %s.", playername[playerid],playerid,clan[playerid]); WriteLog(string); SendClientMessage(playerid, COLOR_GREEN, "* Now every clan member can invite players into clan!"); } return 1; } if (strcmp(cmd, "/clanchatprefix", true) == 0) { if (!clans) { SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!"); return 1; } if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this."); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "clan"); format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (!dini_Exists(tmp)) { SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan."); return 1; } tmp2 = dini_Get(tmp, "leader"); if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it."); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp2)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanchatprefix [symbol]"); return 1; } dini_Set(tmp, "clanchatprefix", tmp2[0]); for (new i=0;i= 1) { tmp = dini_Get(tmp3, "bank"); format(string, sizeof(string), "* Clan bank: %d.", strval(tmp)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } tmp = dini_Get(tmp3, "color"); if (HexToInt(tmp) != 0) { format(string, sizeof(string), "* Color: %s.", tmp); SendClientMessage(playerid, HexToInt(tmp), string); } tmp = dini_Get(tmp3, "registered"); if (strlen(tmp)) { format(string, sizeof(string), "* Registration date: %s.", tmp); SendClientMessage(playerid, COLOR_BLUE, string); } } else { format(string, sizeof(string), "* Clan %s not exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); return 1; } } return 1; } if (strcmp(cmd, "/clanbank", true) == 0) { if (!clans) { SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!"); return 1; } if (!clanbank) { SendClientMessage(playerid, COLOR_RED, "* Clanbank are not allowed on this server!"); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanbank [amount]"); return 1; } moneys = strval(tmp); tmp = dini_Get(PlayerFile(playername[playerid]), "clan"); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be in a clan to do it."); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } if (moneys > GetPlayerMoney(playerid)) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(tmp2)) { GiveMoney(playerid, -moneys); tmp3 = dini_Get(tmp2, "bank"); if (moneys+strval(tmp3) > MAX_VALUE) moneys = moneys+strval(tmp3)-MAX_VALUE; dini_IntSet(tmp2, "bank", strval(tmp3)+moneys); } else { format(string, sizeof(string), "* Clan %s not exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp2 = dini_Get(tmp2, "bank"); for (new i=0;i strval(tmp3)) moneys = strval(tmp3); if (dini_Exists(tmp2)) { GiveMoney(playerid, moneys); dini_IntSet(tmp2, "bank", strval(tmp3)-moneys); } else { format(string, sizeof(string), "* Clan %s not exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp3 = dini_Get(tmp2, "bank"); for (new i=0;i GetPlayerMoney(playerid)) moneys = GetPlayerMoney(playerid); if (moneys+bank[playerid] > MAX_VALUE) moneys = MAX_VALUE-bank[playerid]; GiveMoney(playerid, -moneys); bank[playerid] += moneys; format(string, sizeof(string), "--- %s (id: %d) deposited $%d, balance is $%d.", playername[playerid],playerid,moneys,bank[playerid]); WriteLog(string); format(string, sizeof(string), "* You have deposited $%d, your current balance is $%d.", moneys,bank[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/get", true) == 0) { if (!enablebank) { SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!"); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /get [amount]"); return 1; } moneys = strval(tmp); if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } if (moneys > bank[playerid]) moneys = bank[playerid]; GiveMoney(playerid, moneys); bank[playerid] -= moneys; format(string, sizeof(string), "--- %s (id: %d) withdrawn $%d, balance is $%d.", playername[playerid],playerid,moneys,bank[playerid]); WriteLog(string); format(string, sizeof(string), "* You have withdrawn $%d, your current balance is $%d.", moneys,bank[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/balance", true) == 0) { if (!enablebank) { SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!"); return 1; } format(string, sizeof(string), "* You have $%d in the bank.", bank[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/send", true) == 0) { if (!send) { SendClientMessage(playerid, COLOR_RED, "* Sending are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (jailed[playerid] == 1) { SendClientMessage(playerid, COLOR_RED, "* You jailed and cannot send money."); return 1; } if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /send [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /send [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { if (moneys > GetPlayerMoney(playerid)) moneys = GetPlayerMoney(playerid); if (moneys > 0 && GetPlayerMoney(playerid) >= moneys) { SwapMoney(playerid, giveplayerid, moneys); format(string, sizeof(string), "--- %s (id: %d) sent $%d to %s (id: %d).", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* You have sent %s (id: %d), $%d.", playername[giveplayerid],giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You have recieved $%d from %s (id: %d).", moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else SendClientMessage(playerid, COLOR_YELLOW, "* Invalid transaction amount."); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/transact", true) == 0) { if (!enablebank) { SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!"); return 1; } if (!transact) { SendClientMessage(playerid, COLOR_RED, "* Transact are not allowed on this server!"); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores."); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /transact [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /transact [playerid] [amount]"); return 1; } moneys = strval(tmp); if (moneys+bank[giveplayerid] > MAX_VALUE) moneys = moneys+bank[giveplayerid]-MAX_VALUE; if (IsPlayerConnected(giveplayerid)) { if (moneys > bank[playerid]) moneys = bank[playerid]; if (moneys > 0 && bank[playerid] >= moneys) { bank[playerid] -= moneys; bank[giveplayerid] += moneys; format(string, sizeof(string), "--- %s (id: %d) transacted $%d to %s (id: %d) bank.", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* You have transacted $%d to %s (id: %d) bank.", moneys,playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You have recieved transaction of $%d from %s (id: %d) in bank.", moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else SendClientMessage(playerid, COLOR_YELLOW, "* Invalid transaction amount."); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/hitman", true) == 0) { if (!enablebounty) { SendClientMessage(playerid, COLOR_RED, "* Bounty are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttosetbounty) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttosetbounty); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /hitman [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /hitman [playerid] [amount]"); return 1; } moneys = strval(tmp); if (moneys > GetPlayerMoney(playerid)) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } bounty[giveplayerid] += moneys; GiveMoney(playerid, -moneys); format(string, sizeof(string), "--- %s (id: %d) put $%d on %s (id: %d) head (total: $%d).", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid, bounty[giveplayerid]); WriteLog(string); format(string, sizeof(string), "* %s has a $%d bounty put on his head from %s (total: $%d).", playername[giveplayerid],moneys,playername[playerid],bounty[giveplayerid]); SendClientMessageToAll(COLOR_ORANGE, string); return 1; } if (strcmp(cmd, "/bounty", true) == 0) { if (!enablebounty) { SendClientMessage(playerid, COLOR_RED, "* Bounty are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bounty [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* Player %s (id: %d) has a $%d bounty on his head.", playername[giveplayerid],giveplayerid,bounty[giveplayerid]); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/bwmelee", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwmelee [weaponid]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_MELEE){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostMelee[weaponid]) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } GivePlayerWeapon(playerid, weaponIDsMelee[weaponid], 1); dini_IntSet(PlayerFile(playername[playerid]), "weapon1", weaponIDsMelee[weaponid]); GiveMoney(playerid, -weaponCostMelee[weaponid]); format(string, sizeof(string), "--- %s (id: %d) purchased %s for $%d.", playername[playerid],playerid,weaponNamesMelee[weaponid],weaponCostMelee[weaponid]); WriteLog(string); format(string, sizeof(string), "* You purchased %s on your spawn for $%d.", weaponNamesMelee[weaponid],weaponCostMelee[weaponid]); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwpistol", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwpistol [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_PISTOLS){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwpistol [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostPistols[weaponid]*moneys) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "ammo2"); if (strval(tmp)+moneys > spawnweaponsammolimit) { SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!"); moneys = spawnweaponsammolimit-strval(tmp); } if (moneys == 0) return 1; GivePlayerWeapon(playerid, weaponIDsPistols[weaponid], moneys); dini_IntSet(PlayerFile(playername[playerid]), "weapon2", weaponIDsPistols[weaponid]); dini_IntSet(PlayerFile(playername[playerid]), "ammo2", strval(tmp)+moneys); GiveMoney(playerid, -weaponCostPistols[weaponid]*moneys); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", playername[playerid],playerid,weaponNamesPistols[weaponid],moneys,weaponCostPistols[weaponid]*moneys); WriteLog(string); format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for $%d.", weaponNamesPistols[weaponid],moneys,weaponCostPistols[weaponid]*moneys); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwshotgun", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwshotgun [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_SHOTGUNS){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwshotgun [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostShotguns[weaponid]*moneys) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "ammo3"); if (strval(tmp)+moneys > spawnweaponsammolimit) { SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!"); moneys = spawnweaponsammolimit-strval(tmp); } if (moneys == 0) return 1; GivePlayerWeapon(playerid, weaponIDsShotguns[weaponid], moneys); dini_IntSet(PlayerFile(playername[playerid]), "weapon3", weaponIDsShotguns[weaponid]); tmp = dini_Get(PlayerFile(playername[playerid]), "ammo3"); dini_IntSet(PlayerFile(playername[playerid]), "ammo3", strval(tmp)+moneys); GiveMoney(playerid, -weaponCostShotguns[weaponid]*moneys); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", playername[playerid],playerid,weaponNamesShotguns[weaponid],moneys,weaponCostShotguns[weaponid]*moneys); WriteLog(string); format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for $%d.", weaponNamesShotguns[weaponid],moneys,weaponCostShotguns[weaponid]*moneys); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwsmg", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwsmg [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_SMGS){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwsmg [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostSMGs[weaponid]*moneys) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "ammo4"); if (strval(tmp)+moneys > spawnweaponsammolimit) { SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!"); moneys = spawnweaponsammolimit-strval(tmp); } if (moneys == 0) return 1; GivePlayerWeapon(playerid, weaponIDsSMGs[weaponid], moneys); dini_IntSet(PlayerFile(playername[playerid]), "weapon4", weaponIDsSMGs[weaponid]); tmp = dini_Get(PlayerFile(playername[playerid]), "ammo4"); dini_IntSet(PlayerFile(playername[playerid]), "ammo4", strval(tmp)+moneys); GiveMoney(playerid, -weaponCostSMGs[weaponid]*moneys); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", playername[playerid],playerid,weaponNamesSMGs[weaponid],moneys,weaponCostSMGs[weaponid]*moneys); WriteLog(string); format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for $%d.", weaponNamesSMGs[weaponid],moneys,weaponCostSMGs[weaponid]*moneys); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwrifle", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_RIFLES){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostRifles[weaponid]*moneys) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "ammo5"); if (strval(tmp)+moneys > spawnweaponsammolimit) { SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!"); moneys = spawnweaponsammolimit-strval(tmp); } if (moneys == 0) return 1; GivePlayerWeapon(playerid, weaponIDsRifles[weaponid], moneys); dini_IntSet(PlayerFile(playername[playerid]), "weapon5", weaponIDsRifles[weaponid]); tmp = dini_Get(PlayerFile(playername[playerid]), "ammo5"); dini_IntSet(PlayerFile(playername[playerid]), "ammo5", strval(tmp)+moneys); GiveMoney(playerid, -weaponCostRifles[weaponid]*moneys); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", playername[playerid],playerid,weaponNamesRifles[weaponid],moneys,weaponCostRifles[weaponid]*moneys); WriteLog(string); format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for $%d.", weaponNamesRifles[weaponid],moneys,weaponCostRifles[weaponid]*moneys); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwrifle2", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle2 [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_RIFLES2){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle2 [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostRifles2[weaponid]*moneys) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "ammo6"); if (strval(tmp)+moneys > spawnweaponsammolimit) { SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!"); moneys = spawnweaponsammolimit-strval(tmp); } if (moneys == 0) return 1; GivePlayerWeapon(playerid, weaponIDsRifles2[weaponid], moneys); dini_IntSet(PlayerFile(playername[playerid]), "weapon6", weaponIDsRifles2[weaponid]); tmp = dini_Get(PlayerFile(playername[playerid]), "ammo6"); dini_IntSet(PlayerFile(playername[playerid]), "ammo6", strval(tmp)+moneys); GiveMoney(playerid, -weaponCostRifles2[weaponid]*moneys); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", playername[playerid],playerid,weaponNamesRifles2[weaponid],moneys,weaponCostRifles2[weaponid]*moneys); WriteLog(string); format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for $%d.", weaponNamesRifles2[weaponid],moneys,weaponCostRifles2[weaponid]*moneys); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwgift", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwgift [weaponid]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_GIFTS){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostGifts[weaponid]) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } GivePlayerWeapon(playerid, weaponIDsGifts[weaponid], 1); dini_IntSet(PlayerFile(playername[playerid]), "weapon7", weaponIDsGifts[weaponid]); GiveMoney(playerid, -weaponCostGifts[weaponid]); format(string, sizeof(string), "--- %s (id: %d) purchased %s for $%d.", playername[playerid],playerid,weaponNamesGifts[weaponid],weaponCostGifts[weaponid]); WriteLog(string); format(string, sizeof(string), "* You purchased %s on your spawn for $%d.", weaponNamesGifts[weaponid],weaponCostGifts[weaponid]); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/bwspray", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnweapons) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons); SendClientMessage(playerid, COLOR_RED, string); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwspray [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); if (weaponid < 0 || weaponid >= WEAP_SPRAYS){ SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwspray [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons."); return 1; } if (GetPlayerMoney(playerid) < weaponCostSprays[weaponid]*moneys) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?"); return 1; } tmp = dini_Get(PlayerFile(playername[playerid]), "ammo8"); if (strval(tmp)+moneys > spawnweaponsammolimit) { SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!"); moneys = spawnweaponsammolimit-strval(tmp); } if (moneys == 0) return 1; GivePlayerWeapon(playerid, weaponIDsSprays[weaponid], moneys); dini_IntSet(PlayerFile(playername[playerid]), "weapon8", weaponIDsSprays[weaponid]); tmp = dini_Get(PlayerFile(playername[playerid]), "ammo8"); dini_IntSet(PlayerFile(playername[playerid]), "ammo8", strval(tmp)+moneys); GiveMoney(playerid, -weaponCostSprays[weaponid]*moneys); format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for $%d.", playername[playerid],playerid,weaponNamesSprays[weaponid],moneys,weaponCostSprays[weaponid]*moneys); WriteLog(string); format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for $%d.", weaponNamesSprays[weaponid],moneys,weaponCostSprays[weaponid]*moneys); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } if (strcmp(cmd, "/weaplist", true) == 0) { if (!spawnweapons) { SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!"); return 1; } SendClientMessage(playerid, COLOR_GREY, "* Available weapons:"); format(string, sizeof(string), "0. %s $%d", weaponNamesMelee[0],weaponCostMelee[0]); for (new i=1;i= MAX_PROPERTIES) { SendClientMessage(playerid, COLOR_YELLOW, "* Invalid property id."); return 1; } SendClientMessage(playerid, COLOR_GREEN, "* Property info:"); if (strlen(propertyowner[moneys])) format(string, sizeof(string), "* %s (id: %d). Owner: %s.", propertyNames[moneys],moneys,propertyowner[moneys]); else format(string, sizeof(string), "* %s (id: %d). Owner: None.", propertyNames[moneys],moneys); SendClientMessage(playerid, COLOR_YELLOW, string); if (propertyBuyAble[moneys] == 0) SendClientMessage(playerid, COLOR_RED, "* This property is unavailable to /buy."); if (propertyReBuyAble[moneys] == 0) SendClientMessage(playerid, COLOR_RED, "* You cannot rebuy this property."); return 1; } if (strcmp(cmd, "/myprops", true) == 0) { SendClientMessage(playerid, COLOR_GREY, "* Owned properties:"); for (new i=0;i= MAX_STRING/3) { SendClientMessage(playerid, COLOR_YELLOW, string); string[0] = 0; } } if (i+1 < MAX_PROPERTIES && strlen(propertyowner[i+1]) && strcmp(propertyowner[i+1], playername[playerid], true) == 0) { format(tmp, sizeof(tmp), "* %d. %s ", i+1,propertyNames[i+1]); strcat(string, tmp); if (strlen(string) >= MAX_STRING/3) { SendClientMessage(playerid, COLOR_YELLOW, string); string[0] = 0; } } else if (i+1 >= MAX_PROPERTIES && strlen(string)) { SendClientMessage(playerid, COLOR_YELLOW, string); string[0] = 0; } i++; if (i+1 < MAX_PROPERTIES && strlen(propertyowner[i+1]) && strcmp(propertyowner[i+1], playername[playerid], true) == 0) { format(tmp, sizeof(tmp), "* %d. %s ", i+1,propertyNames[i+1]); strcat(string, tmp); if (strlen(string) >= MAX_STRING/3) { SendClientMessage(playerid, COLOR_YELLOW, string); string[0] = 0; } } else if (i+1 >= MAX_PROPERTIES && strlen(string)) { SendClientMessage(playerid, COLOR_YELLOW, string); string[0] = 0; } i++; if (i+1 >= MAX_PROPERTIES && strlen(string)) SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmdtext, "/close", true) == 0 || strcmp(cmdtext, "/lock", true) == 0) { if (!locking) { SendClientMessage(playerid, COLOR_RED, "* Locking are not allowed on this server!"); return 1; } if (IsPlayerInAnyVehicle(playerid)) { if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { SendClientMessage(playerid, COLOR_RED, "* Only the driver can lock the car!"); return 1; } for (new i=0;i spectatormaxdist) { format(string, sizeof(string), "* USAGE: /spectate [playerid] [dist 5-%d] [camid 0-2]", spectatormaxdist); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } tmp = strtok(cmdtext, idx); weaponid = strval(tmp); if (!strlen(tmp) || weaponid < 0 || weaponid > 2) { format(string, sizeof(string), "* USAGE: /spectate [playerid] [dist 5-%d] [camid 0-2]", spectatormaxdist); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } if (IsPlayerConnected(giveplayerid)) { if (spectator[giveplayerid][0] != INVALID_PLAYER_ID) { format(string, sizeof(string), "* %s (id: %d) is spectator and cannot be watched.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) { format(string, sizeof(string), "* %s (id: %d) is not spawned.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (giveplayerid == playerid) { SendClientMessage(playerid, COLOR_RED, "* You cannot watch yourself!"); return 1; } if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED && spectator[playerid][0] == INVALID_PLAYER_ID) { GetPlayerPos(playerid, x,y,z); spectlastpos[playerid][0] = x; spectlastpos[playerid][1] = y; spectlastpos[playerid][2] = z; FreezePlayer(playerid); } else spectlastpos[playerid][0] = spectlastpos[playerid][1] = spectlastpos[playerid][2] = 0; spectator[playerid][0] = giveplayerid; spectator[playerid][1] = moneys; spectator[playerid][2] = weaponid; format(string, sizeof(string), "~g~Spectator mode on! ~n~~r~Watching: ~w~%s (id: %d).", playername[giveplayerid],giveplayerid); GameTextForPlayer(playerid, string, 3000, 5); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/spectateoff", true) == 0) { if (spectator[playerid][0] == INVALID_PLAYER_ID) { SendClientMessage(playerid, COLOR_RED, "* You are not spectator."); return 1; } spectator[playerid][1] = 0; SetSpawnInfo(playerid,0,classmodel[lastclass[playerid]],2512.5256,-1672.5090,13.4976,80.9178,0,0,5,1,0,0); SpawnPlayer(playerid); FreezePlayer(playerid, true); return 1; } if (strcmp(cmd, "/para", true) == 0) { if (!parachute) { SendClientMessage(playerid, COLOR_RED, "* Parachute are not allowed on this server!"); return 1; } if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1; if (GetPlayerMoney(playerid) > 499) { GiveMoney(playerid, -500); GivePlayerWeapon(playerid, 46, 1); SendClientMessage(playerid, COLOR_YELLOW, "* Parachute purchased."); format(string, sizeof(string), "--- %s (id: %d) purchased parachute.", playername[playerid],playerid); WriteLog(string); } else SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (strcmp(cmd, "/skydive", true) == 0) { if (!skydive) { SendClientMessage(playerid, COLOR_RED, "* Skydive are not allowed on this server!"); return 1; } if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1; if (jailed[playerid] == 1) { SendClientMessage(playerid, COLOR_RED, "* You jailed and cannot skydive."); return 1; } tmp = strtok(cmdtext, idx); moneys = strval(tmp); if (!strlen(tmp) || 100 > moneys || moneys > maxskydive) { format(string, sizeof(string), "* USAGE: /skydive [100-%d]", maxskydive); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } if (GetPlayerMoney(playerid) > 499+moneys){ GiveMoney(playerid, -500-moneys); GivePlayerWeapon(playerid, 46, 1); GetPlayerPos(playerid, x,y,z); if (allowcarskydive && IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z+moneys); else { RemovePlayerFromVehicle(playerid); SetPlayerPos(playerid, x,y,z+moneys); } format(string, sizeof(string), "--- %s (id: %d) skydived by %d.", playername[playerid],playerid,moneys); WriteLog(string); GameTextForPlayer(playerid, "~r~SKYDIVE!", 3000, 5); } else SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } if (strcmp(cmd, "/flytols", true) == 0) { if (!airports) { SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttoairports) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttoairports); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AIR2 && playerCheckpoint[playerid] != CP_AIR3)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Airport (San Fierro or Las Venturas) to fly to Los Santos."); return 1; } if (GetPlayerMoney(playerid) < airportticket) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } GiveMoney(playerid, -airportticket); RemovePlayerFromVehicle(playerid); SetPlayerPos(playerid, checkpoints[CP_AIR1][0], checkpoints[CP_AIR1][1], checkpoints[CP_AIR1][2]); format(string, sizeof(string), "--- %s (id: %d) flew to Los Santos.", playername[playerid],playerid); WriteLog(string); SendClientMessage(playerid, COLOR_GREEN, "* Welcome to Los Santos!"); return 1; } if (strcmp(cmd, "/flytosf", true) == 0) { if (!airports) { SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttoairports) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttoairports); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AIR1 && playerCheckpoint[playerid] != CP_AIR3)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Airport (Los Santos or Las Venturas) to fly to San Fierro."); return 1; } if (GetPlayerMoney(playerid) < airportticket) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } GiveMoney(playerid, -airportticket); RemovePlayerFromVehicle(playerid); SetPlayerPos(playerid, checkpoints[CP_AIR2][0], checkpoints[CP_AIR2][1], checkpoints[CP_AIR2][2]); format(string, sizeof(string), "--- %s (id: %d) flew to San Fierro.", playername[playerid],playerid); WriteLog(string); SendClientMessage(playerid, COLOR_GREEN, "* Welcome to San Fierro!"); return 1; } if (strcmp(cmd, "/flytolv", true) == 0) { if (!airports) { SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttoairports) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttoairports); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AIR1 && playerCheckpoint[playerid] != CP_AIR2)) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Airport (Los Santos or San Fierro) to fly to Las Venturas."); return 1; } if (GetPlayerMoney(playerid) < airportticket) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } GiveMoney(playerid, -airportticket); RemovePlayerFromVehicle(playerid); SetPlayerPos(playerid, checkpoints[CP_AIR3][0], checkpoints[CP_AIR3][1], checkpoints[CP_AIR3][2]); format(string, sizeof(string), "--- %s (id: %d) flew to Las Venturas.", playername[playerid],playerid); WriteLog(string); SendClientMessage(playerid, COLOR_GREEN, "* Welcome to Las Venturas!"); return 1; } if (strcmp(cmd, "/setspawn", true) == 0) { tmp = dini_Get(FILE_SETTINGS, "spawnchange"); if (!allowspawnchange) { SendClientMessage(playerid, COLOR_RED, "* Spawn change are not allowed on this server!"); return 1; } if (respectrequired && respect[playerid] < respecttospawnchange) { format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnchange); SendClientMessage(playerid, COLOR_RED, string); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setspawn [spawnid]"); return 1; } moneys = strval(tmp); if (moneys < 0 || moneys >= MAX_SPAWNS) { SendClientMessage(playerid, COLOR_RED, "* Invalid location id."); return 1; } if (IsPlayerInCheckpoint(playerid) == 0 || playerCheckpoint[playerid] != CP_SPRES) { SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a Spawn Residence to change your spawn location."); return 1; } if (GetPlayerMoney(playerid) < spawnchangecost) { SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!"); return 1; } GiveMoney(playerid, -spawnchangecost); dini_IntSet(PlayerFile(playername[playerid]), "spawn", moneys); format(string, sizeof(string), "--- %s (id: %d) changed his spawn location to %s (id: %d).", playername[playerid],playerid,SpawnNames[moneys],moneys); WriteLog(string); format(string, sizeof(string), "* You changed your spawn location to %s (id: %d).", SpawnNames[moneys],moneys); SendClientMessage(playerid, COLOR_GREY, string); return 1; } if (strcmp(cmd, "/spawnlist", true) == 0) { SendClientMessage(playerid, COLOR_GREY, "* Available spawn locations:"); for (new i=0;i 0) { SendClientMessage(playerid, COLOR_YELLOW, "* Wait some time after reporting again."); return 1; } strmid(tmp, cmdtext, 7, strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /report [text]"); return 1; } if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this."); return 1; } new h, m, s; new day, month, year; new File:f = fopen(FILE_REPORT, io_append); gettime(h,m,s); getdate(year,month,day); format(string, sizeof(string), "--- %s (id: %d) sent report:%s", playername[playerid],playerid,day,month,year,h,m,s,tmp); WriteLog(string); format(string, sizeof(string), "* Report from %s (id: %d):%s", playername[playerid],playerid,tmp); SendAdminMessage(COLOR_LIGHTBLUE, string); format(string, sizeof(string), "From %s (id: %d) at %d/%d/%d in %d:%d:%d:%s", playername[playerid],playerid,day,month,year,h,m,s,tmp); fwrite(f, string); fwrite(f, "\r\n"); fclose(f); reporttimeout[playerid] = reportingtimeout; SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Your report sent to admins."); return 1; } if (strcmp(cmd, "/vote", true) == 0) { if (!votekick && !voteban) { SendClientMessage(playerid, COLOR_RED, "* Votes are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /vote [playerid]"); return 1; } giveplayerid = strval(tmp); if (playerid == giveplayerid) { SendClientMessageToAll(COLOR_YELLOW, "* You can't vote for yourself!"); return 1; } if (!votes[playerid]) { format(string, sizeof(string), "* Vote for %d is inactive.", giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); return 1; } if (voted[playerid][giveplayerid]) { format(string, sizeof(string), "* You already voted for %s (id: %d).", playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); return 1; } votes[giveplayerid]++; voted[playerid][giveplayerid] = 1; format(string, sizeof(string), "--- %s (id: %d) voted for %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) voted for %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/votekick", true) == 0) { if (!votekick) { SendClientMessage(playerid, COLOR_RED, "* Kick voting are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /votekick [playerid]"); return 1; } giveplayerid = strval(tmp); if (playerid == giveplayerid) { SendClientMessageToAll(COLOR_YELLOW, "* You can't vote for yourself!"); return 1; } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (votes[giveplayerid]) { format(string, sizeof(string), "* Vote to kick %s (id: %d) already active.", playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); return 1; } if (GetPlayers() < votekickminplayers) { SendClientMessage(playerid, COLOR_RED, "* Not enough players to start a vote!"); return 1; } votetime[giveplayerid] = votekicktime; votes[giveplayerid]++; voted[playerid][giveplayerid] = 1; votetype[giveplayerid] = 1; format(string, sizeof(string), "--- %s (id: %d) called a vote to kick %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) called a vote to kick %s (id: %d). You can vote in next %d seconds by typing /vote %d", playername[playerid],playerid,playername[giveplayerid],giveplayerid,votekicktime,giveplayerid); SendClientMessageToAll(COLOR_ORANGE, string); return 1; } if (strcmp(cmd, "/voteban", true) == 0) { if (!voteban) { SendClientMessage(playerid, COLOR_RED, "* Ban voting are not allowed on this server!"); return 1; } tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /voteban [playerid]"); return 1; } giveplayerid = strval(tmp); if (votes[giveplayerid]) { format(string, sizeof(string), "* Vote to ban %s (id: %d) already active.", playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_YELLOW, string); return 1; } if (GetPlayers() < votebanminplayers) { SendClientMessage(playerid, COLOR_RED, "* Not enough players to start a vote!"); return 1; } votetime[giveplayerid] = votebantime; votes[giveplayerid]++; voted[playerid][giveplayerid] = 1; votetype[giveplayerid] = 2; format(string, sizeof(string), "--- %s (id: %d) called a vote to ban %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) called a vote to ban %s (id: %d). You can vote in next %d seconds by typing /vote %d", playername[playerid],playerid,playername[giveplayerid],giveplayerid,votekicktime,giveplayerid); SendClientMessageToAll(COLOR_RED, string); return 1; } if (strcmp(cmd, "/motd", true) == 0) { if (strlen(motdstring1)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring1); if (strlen(motdstring2)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring2); if (strlen(motdstring3)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring3); if (strlen(motdstring4)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring4); return 1; } if (strcmp(cmd, "/creditz", true) == 0) { SendClientMessage(playerid, COLOR_GREY,"* Credits:"); SendClientMessage(playerid, COLOR_GREY,"* Major features developed by ProRaiL."); SendClientMessage(playerid, COLOR_GREY,"* It was based on LVDMod by Sintax, which also was based on default LVDM by Jax."); SendClientMessage(playerid, COLOR_GREY,"* DINI and DUTILS made by DracoBlue."); SendClientMessage(playerid, COLOR_GREY,"* Some vehicle funtions by Sacky."); SendClientMessage(playerid, COLOR_GREY,"* Car locking system idea by StyleWarz."); SendClientMessage(playerid, COLOR_GREY,"* Spectator mode elements from testakross."); SendClientMessage(playerid, COLOR_GREY,"* Thanks to everyone who used/using this gamemode,"); SendClientMessage(playerid, COLOR_GREY,"* reporting about bugs, giving new ideas and all..."); SendClientMessage(playerid, COLOR_GREY,"* Personal thanks to Barmaley for moral support ;)"); return 1; } if (!enableadminscript) return 0; if (strcmp(cmd, "/cmds", true) == 0 && PlayerAccess(playerid) >= 1) { SendClientMessage(playerid, COLOR_GREY,"Available commands:"); switch (PlayerAccess(playerid)) { case 1: { SendClientMessage(playerid, COLOR_ORANGE,"MONEY: /getmoney /getbank "); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /(un)mute /(un)jail"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /disarm /bu /au /po /suspect /gotsuspect"); } case 2: { SendClientMessage(playerid, COLOR_ORANGE,"MONEY: /(give,set,get)money /(set,get)bank /setbounty /setrespect"); SendClientMessage(playerid, COLOR_ORANGE,"PROPERTY: /setpropowner"); SendClientMessage(playerid, COLOR_ORANGE,"CAR: /setcarowner"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /(un)mute /(un)jail /(un)freeze /heal"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /giveweapon /weaponids /(dis)arm /setcolor /setscore"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /tp(to,carto,tocar) /locs /(get,in,from)car"); SendClientMessage(playerid, COLOR_ORANGE,"OTHER: /ann /settime"); } case 3: { SendClientMessage(playerid, COLOR_ORANGE,"ACCOUNT: /globalsave"); SendClientMessage(playerid, COLOR_ORANGE,"CLAN: /(reg,del)clan /(un)setclan /getclan"); SendClientMessage(playerid, COLOR_ORANGE,"MONEY: /(give,set,get)money /(set,get)bank /setbounty /setrespect"); SendClientMessage(playerid, COLOR_ORANGE,"PROPERTY: /setpropowner /prop(re)buyable /loadpropowners"); SendClientMessage(playerid, COLOR_ORANGE,"CAR: /setcarowner /carbuyable /loadcarowners"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /kick /ban /(un)mute /(un)jail /(un)freeze /heal /god /murder"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /giveweapon /weaponids /(dis)arm /setcolor /setscore"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /tp(to,carto,tocar) /locs /(get,in,from)car"); SendClientMessage(playerid, COLOR_ORANGE,"OTHER: /(un)setsettings /getsettings /loadsettings"); SendClientMessage(playerid, COLOR_ORANGE,"OTHER: /ann /settime /resettotalstats"); } case 4: { SendClientMessage(playerid, COLOR_ORANGE,"ACCOUNT: /(reg,del)user /globalsave /(un)setuser /getuser"); SendClientMessage(playerid, COLOR_ORANGE,"CLAN: /(reg,del)clan /(un)setclan /getclan"); SendClientMessage(playerid, COLOR_ORANGE,"MONEY: /(give,set,get)money /(set,get)bank /setbounty /setrespect"); SendClientMessage(playerid, COLOR_ORANGE,"PROPERTY: /setpropowner /prop(re)buyable /loadpropowners"); SendClientMessage(playerid, COLOR_ORANGE,"CAR: /setcarowner /carbuyable /loadcarowners"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /kick /ban /(un)mute /(un)jail /(un)freeze /heal /god /(s)murder"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /giveweapon /weaponids /(dis)arm /setcolor /setscore"); SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /tp(to,carto,tocar) /locs /(get,in,from)car"); SendClientMessage(playerid, COLOR_ORANGE,"OTHER: /(un)setsettings /getsettings /loadsettings"); SendClientMessage(playerid, COLOR_ORANGE,"OTHER: /ann /settime /resettotalstats /gmx"); } } return 1; } if (strcmp(cmd, "/reguser", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /reguser [playername] [password]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp2)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /reguser [playername] [password]"); return 1; } if (20 < strlen(tmp2) || strlen(tmp2) < 5) { SendClientMessage(playerid, COLOR_YELLOW, "* Password length must be 5-20 symbols."); return 1; } if (!dini_Exists(PlayerFile(tmp))) { new day, month, year; getdate(year,month,day); dini_Create(PlayerFile(tmp)); format(tmp2, sizeof(tmp2), "%d.%d.%d", day,month,year); dini_Set(PlayerFile(playername[playerid]), "registered", tmp2); dini_IntSet(PlayerFile(tmp), "password", num_hash(tmp2)); if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); tmp3 = dini_Get(FILE_TOTALSTAT, "users"); dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp3)+1); dini_Set(FILE_TOTALSTAT, "lastuser", tmp); dini_Set(FILE_TOTALSTAT, "lastregdate", tmp2); format(string, sizeof(string), "--- %s (id: %d) created account %s.", playername[playerid],playerid,tmp); WriteLog(string); format(string, sizeof(string), "* Account named %s created. Password: %s.", tmp,tmp2); SendClientMessage(playerid, COLOR_GREEN, string); } else { format(string, sizeof(string), "* Account %s already registered.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/deluser", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /deluser [playername]"); return 1; } if (dini_Exists(PlayerFile(tmp))) { dini_Remove(PlayerFile(tmp)); tmp3 = dini_Get(FILE_TOTALSTAT, "users"); dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp3)-1); format(string, sizeof(string), "--- %s (id: %d) deleted account %s.", playername[playerid],playerid,tmp); WriteLog(string); format(string, sizeof(string), "* Account %s deleted.", tmp); SendClientMessage(playerid, COLOR_RED, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/globalsave", true) == 0 && PlayerAccess(playerid) >= 3) { format(string, sizeof(string), "--- %s (id: %d) requested global save.", playername[playerid],playerid); WriteLog(string); GlobalPlayerSave(); SendClientMessage(playerid, COLOR_GREEN, "* Global save done."); return 1; } if (strcmp(cmd, "/setuser", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setuser [playername] [key] [value]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp2)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setuser [playername] [key] [value]"); return 1; } strmid(tmp3, cmdtext, 11+strlen(tmp)+strlen(tmp2), strlen(cmdtext)); if (!strlen(tmp3)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setuser [playername] [key] [value]"); return 1; } if (dini_Exists(PlayerFile(tmp))) { dini_Set(PlayerFile(tmp), tmp2, tmp3); format(string, sizeof(string), "--- %s (id: %d) sets %s parameters: %s=%s.", playername[playerid],playerid,tmp,tmp2,tmp3); WriteLog(string); format(string, sizeof(string), "* You set parameters of %s: %s=%s.", tmp,tmp2,tmp3); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/unsetuser", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetuser [playername] [key]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetuser [playername] [key]"); return 1; } if (dini_Exists(PlayerFile(tmp))) { dini_Unset(PlayerFile(tmp), tmp2); format(string, sizeof(string), "* You unset parameters of %s: %s.", tmp,tmp2); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/getuser", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getuser [playername] [key]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getuser [playername] [key]"); return 1; } if (dini_Exists(PlayerFile(tmp))) { tmp3 = dini_Get(PlayerFile(tmp), tmp2); format(string, sizeof(string), "* Parameters of %s: %s=%s.", tmp,tmp2,tmp3); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s no such account.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/hash", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /hash [string]"); return 1; } format(string, sizeof(string), "* %s -- %d", tmp,num_hash(tmp)); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } if (strcmp(cmd, "/regclan", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /regclan [clanname]"); return 1; } format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (!dini_Exists(tmp2)) { new day, month, year; getdate(year,month,day); dini_Create(tmp2); if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT); tmp3 = dini_Get(FILE_TOTALSTAT, "clans"); dini_IntSet(FILE_TOTALSTAT, "clans", strval(tmp3)+1); dini_Set(FILE_TOTALSTAT, "lastclan", tmp); format(tmp3, sizeof(tmp2), "%d.%d.%d", day,month,year); dini_Set(tmp2, "registered", tmp3); dini_Set(FILE_TOTALSTAT, "lastclanregdate", tmp3); format(string, sizeof(string), "--- %s (id: %d) created clan %s.", playername[playerid],playerid,tmp); WriteLog(string); format(string, sizeof(string), "* Clan %s created.", tmp); SendClientMessage(playerid, COLOR_GREEN, string); } else { format(string, sizeof(string), "* Clan %s already registered.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/delclan", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /delclan [clanname]"); return 1; } format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(tmp2)) { dini_Remove(tmp2); tmp3 = dini_Get(FILE_TOTALSTAT, "clans"); dini_IntSet(FILE_TOTALSTAT, "clans", strval(tmp3)-1); format(string, sizeof(string), "--- %s (id: %d) deleted clan %s.", playername[playerid],playerid,tmp); WriteLog(string); format(string, sizeof(string), "* Clan %s deleted.", tmp); SendClientMessage(playerid, COLOR_RED, string); } else { format(string, sizeof(string), "* %s no such clan.", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/setclan", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setclan [clanname] [key] [value]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp2)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setclan [clanname] [key] [value]"); return 1; } strmid(tmp3, cmdtext, 11+strlen(tmp)+strlen(tmp2), strlen(cmdtext)); if (!strlen(tmp3)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setclan [clanname] [key] [value]"); return 1; } format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(string)) { dini_Set(string, tmp2, tmp3); format(string, sizeof(string), "--- %s (id: %d) sets clan %s parameters: %s=%s.", playername[playerid],playerid,tmp,tmp2,tmp3); WriteLog(string); format(string, sizeof(string), "* You set parameters of clan %s: %s=%s.", tmp,tmp2,tmp3); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* Clan %s not exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/unsetclan", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetclan [clanname] [key]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetclan [clanname] [key]"); return 1; } format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(string)) { dini_Unset(string, tmp2); format(string, sizeof(string), "* You unset parameters of clan %s: %s.", tmp,tmp2); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* Clan %s not exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/getclan", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getclan [clanname] [key]"); return 1; } tmp2 = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getclan [clanname] [key]"); return 1; } format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp)); if (dini_Exists(string)) { tmp3 = dini_Get(string, tmp2); format(string, sizeof(string), "* Parameters of clan %s: %s=%s.", tmp,tmp2,tmp3); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* Clan %s not exists!", tmp); SendClientMessage(playerid, COLOR_RED, string); } return 1; } if (strcmp(cmd, "/givemoney", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /givemoney [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /givemoney [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GiveMoney(giveplayerid, moneys); format(string, sizeof(string), "--- %s (id: %d) maded $%d for %s (id: %d).", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* You have made money for %s (id: %d), $%d.", playername[giveplayerid],giveplayerid, moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You have granted $%d from %s (id: %d).", moneys, playername[playerid], playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setmoney", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setmoney [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setmoney [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GiveMoney(giveplayerid, -GetPlayerMoney(giveplayerid)+moneys); format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) money to $%d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys); WriteLog(string); format(string, sizeof(string), "* You set money of %s (id: %d) to $%d.", playername[giveplayerid],giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your money is now $%d, set by %s (id: %d).", moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/getmoney", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getmoney [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* Money of %s (id: %d) is $%d.", playername[giveplayerid],giveplayerid,GetPlayerMoney(giveplayerid)); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setbank", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbank [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbank [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { bank[giveplayerid] = moneys; format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) bank balance to $%d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys); WriteLog(string); format(string, sizeof(string), "* You set balance of %s (id: %d) to $%d in bank.", playername[giveplayerid],giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your bank balance is now $%d, set by %s (id: %d).", moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/getbank", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getbank [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* Balance of %s (id: %d) is $%d.", playername[giveplayerid],giveplayerid,bank[giveplayerid]); SendClientMessage(playerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setbounty", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbounty [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbounty [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { bounty[giveplayerid] = moneys; format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) bounty to $%d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys); WriteLog(string); format(string, sizeof(string), "* You set bounty on %s (id: %d) to $%d.", playername[giveplayerid],giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your bounty is now $%d, set by %s (id: %d).", moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setrespect", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setrespect [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setrespect [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { respect[giveplayerid] = moneys; format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) respect to %d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys); WriteLog(string); format(string, sizeof(string), "* You set respect on %s (id: %d) to %d.", playername[giveplayerid],giveplayerid,moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* Your respect is now %d, set by %s (id: %d).", moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setpropowner", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setpropowner [propid] [playername]"); return 1; } moneys = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setpropowner [propid] [playername]"); return 1; } if (!dini_Exists(PlayerFile(tmp))) { format(string, sizeof(string), "--- %s (id: %d) resets property %s (id: %d) owner.", playername[playerid],playerid,propertyNames[moneys],moneys); WriteLog(string); format(string, sizeof(string), "* You reset owner of %s (id: %d).", propertyNames[moneys],moneys); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } valstr(tmp2, moneys); if (!dini_Exists(FILE_PROPS)) dini_Create(FILE_PROPS); dini_Set(FILE_PROPS, tmp2, tmp); propertyowner[moneys] = tmp; format(string, sizeof(string), "--- %s (id: %d) sets property %s (id: %d) owner to %s.", playername[playerid],playerid,propertyNames[moneys],moneys,tmp); WriteLog(string); format(string, sizeof(string), "* You set owner of %s (id: %d) to %s.", propertyNames[moneys],moneys,tmp); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/propbuyable", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /propbuyable [propid] [0-1]"); return 1; } moneys = strval(tmp); if (moneys < 0 || moneys >= MAX_PROPERTIES) { SendClientMessage(playerid, COLOR_YELLOW, "* Invalid property id."); return 1; } tmp = strtok(cmdtext, idx); weaponid = strval(tmp); if (!strlen(tmp) || weaponid < 0 || weaponid > 1) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /propbuyable [propid] [0-1]"); return 1; } propertyBuyAble[moneys] = weaponid; format(string, sizeof(string), "--- %s (id: %d) sets property %s (id: %d) buyable state to %d.", playername[playerid],playerid,propertyNames[moneys],moneys,weaponid); WriteLog(string); if (moneys == 0) { format(string, sizeof(string), "* You made property %s (id: %d) non-buyable.", propertyNames[moneys],moneys); SendClientMessage(playerid, COLOR_RED, string); } else { format(string, sizeof(string), "* You made property %s (id: %d) buyable.", propertyNames[moneys],moneys); SendClientMessage(playerid, COLOR_GREEN, string); } return 1; } if (strcmp(cmd, "/proprebuyable", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /proprebuyable [propid] [0-1]"); return 1; } moneys = strval(tmp); if (moneys < 0 || moneys >= MAX_PROPERTIES) { SendClientMessage(playerid, COLOR_YELLOW, "* Invalid property id."); return 1; } tmp = strtok(cmdtext, idx); weaponid = strval(tmp); if (!strlen(tmp) || weaponid < 0 || weaponid > 1) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /proprebuyable [propid] [0-1]"); return 1; } propertyReBuyAble[moneys] = weaponid; format(string, sizeof(string), "--- %s (id: %d) sets property %s (id: %d) rebuyable state to %d.", playername[playerid],playerid,propertyNames[moneys],moneys,weaponid); WriteLog(string); if (moneys == 0) { format(string, sizeof(string), "* You made property %s (id: %d) non-rebuyable.", propertyNames[moneys],moneys); SendClientMessage(playerid, COLOR_RED, string); } else { format(string, sizeof(string), "* You made property %s (id: %d) rebuyable.", propertyNames[moneys],moneys); SendClientMessage(playerid, COLOR_GREEN, string); } return 1; } if (strcmp(cmd, "/loadpropowners", true) == 0 && PlayerAccess(playerid) >= 3) { format(string, sizeof(string), "--- %s (id: %d) requested to load properties file.", playername[playerid],playerid); WriteLog(string); LoadPropertyOwners(); SendClientMessage(playerid, COLOR_GREEN, "* Properties file loaded."); return 1; } if (strcmp(cmd, "/kick", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /kick [playerid] [reason]"); return 1; } giveplayerid = strval(tmp); strmid(tmp, cmdtext, 6+strlen(tmp), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /kick [playerid] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) KickPlayer(giveplayerid, playername[playerid], tmp); else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/ban", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ban [playerid] [reason]"); return 1; } giveplayerid = strval(tmp); strmid(tmp, cmdtext, 5+strlen(tmp), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ban [playerid] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) BanPlayer(giveplayerid, playername[playerid], tmp); else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/mute", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /mute [playerid] [duration] [reason]"); return 1; } giveplayerid = strval(tmp); tmp2 = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /mute [playerid] [duration] [reason]"); return 1; } moneys = strval(tmp2); strmid(tmp, cmdtext, 7+strlen(tmp)+strlen(tmp2), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /mute [playerid] [duration] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) MutePlayer(giveplayerid, playername[playerid], tmp, moneys); else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/unmute", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unmute [playerid] [reason]"); return 1; } giveplayerid = strval(tmp); strmid(tmp, cmdtext, 8+strlen(tmp), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unmute [playerid] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) MutePlayer(giveplayerid, playername[playerid], tmp, 0, true); else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/jail", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /jail [playerid] [duration] [reason]"); return 1; } giveplayerid = strval(tmp); tmp2 = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /jail [playerid] [duration] [reason]"); return 1; } moneys = strval(tmp2); strmid(tmp, cmdtext, 7+strlen(tmp)+strlen(tmp2), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /jail [playerid] [duration] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) JailPlayer(giveplayerid, playername[playerid], tmp, moneys); else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/unjail", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unjail [playerid] [reason]"); return 1; } giveplayerid = strval(tmp); strmid(tmp, cmdtext, 8+strlen(tmp), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unjail [playerid] [reason]"); return 1; } if (IsPlayerConnected(giveplayerid)) JailPlayer(giveplayerid, playername[playerid], tmp, 0, true); else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/freeze", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /freeze [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { FreezePlayer(giveplayerid); format(string, sizeof(string), "--- %s (id: %d) freezes %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) frozen.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You frozen by %s (id: %d).", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); GameTextForPlayer(giveplayerid, "~w~Frozen!", 3000, 5); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/unfreeze", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unfreeze [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { FreezePlayer(giveplayerid, true); format(string, sizeof(string), "--- %s (id: %d) unfreezes %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) unfrozen.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You unfrozen by %s (id: %d).", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); GameTextForPlayer(giveplayerid, "~y~Unfrozen!", 3000, 5); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/heal", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /heal [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { SetPlayerHealth(giveplayerid, 100.0); god[playerid] = 0; format(string, sizeof(string), "--- %s (id: %d) healed %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) healed.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You healed by %s (id: %d).", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); GameTextForPlayer(giveplayerid, "~g~Healed!", 3000, 5); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/god", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /god [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { god[giveplayerid] = 1; SetPlayerHealth(giveplayerid, 99999); format(string, sizeof(string), "--- %s (id: %d) invincibled %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) is now invincible.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) made you invincible.", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); GameTextForPlayer(giveplayerid, "~w~GODMODE!", 3000, 5); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/murder", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /murder [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { SetPlayerHealth(giveplayerid, 0.0); god[giveplayerid] = 0; format(string, sizeof(string), "--- %s (id: %d) murdered %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* %s (id: %d) murdered %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); SendClientMessageToAll(COLOR_RED, string); GameTextForPlayer(giveplayerid, "~r~Oh dear you're dead!", 3000, 5); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/smurder", true) == 0 && PlayerAccess(playerid) >= 4) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /smurder [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { SetPlayerHealth(giveplayerid, 0.0); god[giveplayerid] = 0; format(string, sizeof(string), "--- %s (id: %d) silently murdered %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* Silent death for %s (id: %d)!", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_ORANGE, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/giveweapon", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /giveweapon [playerid] [weaponid] [ammo]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /giveweapon [playerid] [weaponid] [ammo]"); return 1; } weaponid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /giveweapon [playerid] [weaponid] [ammo]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GivePlayerWeapon(giveplayerid, weaponid, moneys); format(string, sizeof(string), "--- %s (id: %d) gave weapon (id: %d) (ammo: %d) to %s (id: %d).", playername[playerid],playerid,weaponid,moneys,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* You given weapon (id: %d) (ammo: %d) to %s (id: %d).", weaponid,moneys,playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You have granted weapon (id: %d) (ammo: %d) from %s (id: %d).", weaponid,moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/weaponids", true) == 0 && PlayerAccess(playerid) >= 2) { SendClientMessage(playerid, COLOR_GREY,"* 0. Unarmed *** 1. Brass Knuckles *** 2. Golf Club *** 3. Night Stick *** 4. Knife"); SendClientMessage(playerid, COLOR_GREY,"* 5. Bat *** 6. Shovel *** 7. Pool Cue *** 8. Katana *** 9. Chainsaw"); SendClientMessage(playerid, COLOR_GREY,"* 10. Dildo1 *** 11. Dildo2 *** 12. Dildo3 *** 13. Dildo4 *** 14. Flowers *** 15. Cane"); SendClientMessage(playerid, COLOR_GREY,"* 16. Grenades *** 17. Tear Gas *** 18. Molotovs *** 22. Pistol *** 23. Silenced Pistol"); SendClientMessage(playerid, COLOR_GREY,"* 24. Desert Eagle *** 25. Shotgun *** 26. Sawn-off *** 27. Combat Shotgun *** 28. Micro Uzi"); SendClientMessage(playerid, COLOR_GREY,"* 29. MP5 *** 30. AK47 *** 31. M4 *** 32. Tec9 *** 33. Rifle *** 34. Sniper Rifle *** 35. RPG"); SendClientMessage(playerid, COLOR_GREY,"* 36. Missile Launcher *** 37. Flame Thrower *** 38. Minigun *** 39. Satchel Charges"); SendClientMessage(playerid, COLOR_GREY,"* 40. Detonator *** 41. Spray *** 42. Fire Extinguisher *** 43. Camera"); SendClientMessage(playerid, COLOR_GREY,"* 44. Nightvision Goggles *** 45. Thermal Goggles *** 46. Parachute"); return 1; } if (strcmp(cmd, "/arm", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /arm [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon1"); if (strval(tmp) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), 1); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon2"); tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo2"); if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2)); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon3"); tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo3"); if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2)); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon4"); tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo4"); if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2)); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon5"); tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo5"); if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2)); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon6"); tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo6"); if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2)); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon7"); if (strval(tmp) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), 1); tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon8"); tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo8"); if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2)); format(string, sizeof(string), "--- %s (id: %d) gave %s (id: %d) his spawn weapons.", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* Gave spawn weapons to %s (id: %d).", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) gave you your spawn weapons.", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/disarm", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /disarm [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { ResetPlayerWeapons(giveplayerid); format(string, sizeof(string), "--- %s (id: %d) removed weapons from %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* Removed all weapons from %s (id: %d).", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) removed all your weapons.", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setcolor", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [color]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [color]"); return 1; } if (IsPlayerConnected(giveplayerid)) { SetPlayerColor(giveplayerid, HexToInt(tmp)); playercolor[giveplayerid] = HexToInt(tmp); format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) color to %s.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,tmp); WriteLog(string); format(string, sizeof(string), "* You set %s (id: %d) color to %s.", playername[giveplayerid],giveplayerid,tmp); SendClientMessage(playerid, COLOR_GREEN, string); format(string, sizeof(string), "* %s (id: %d) sets your color to %s.", playername[playerid],playerid,tmp); SendClientMessage(giveplayerid, COLOR_GREEN, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setscore", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [score]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [score]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { SetPlayerScore(giveplayerid, moneys); format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) score to %d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys); WriteLog(string); format(string, sizeof(string), "* You set %s (id: %d) score to %d.", playername[giveplayerid],giveplayerid,moneys); SendClientMessage(playerid, COLOR_GREEN, string); format(string, sizeof(string), "* %s (id: %d) sets your score to %d.", playername[playerid],playerid,moneys); SendClientMessage(giveplayerid, COLOR_GREEN, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/tp", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tp [playerid] [locid]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tp [playerid] [locid]"); return 1; } moneys = strval(tmp); if (moneys < 0 || moneys >= MAX_LOCS) { SendClientMessage(playerid, COLOR_YELLOW, "* Invalid location id."); return 1; } if (IsPlayerConnected(giveplayerid)) { SetPlayerInterior(giveplayerid, 0); if (IsPlayerInAnyVehicle(giveplayerid)) SetVehiclePos(GetPlayerVehicleID(giveplayerid), TLocs[moneys][0],TLocs[moneys][1],TLocs[moneys][2]); else SetPlayerPos(giveplayerid, TLocs[moneys][0],TLocs[moneys][1],TLocs[moneys][2]); format(string, sizeof(string), "--- %s (id: %d) teleported %s (id: %d) to %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid,TLocNames[moneys],moneys); WriteLog(string); format(string, sizeof(string), "* You teleported %s (id: %d) to %s (id: %d).", playername[giveplayerid],giveplayerid,TLocNames[moneys],moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You teleported to %s (id: %d) by %s (id: %d).", TLocNames[moneys],moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/tpto", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpto [playerid] [playerid]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpto [playerid] [playerid]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid) && IsPlayerConnected(moneys)) { GetPlayerPos(moneys, x,y,z); SetPlayerInterior(giveplayerid, 0); if (IsPlayerInAnyVehicle(giveplayerid)) SetVehiclePos(GetPlayerVehicleID(giveplayerid), x,y,z); else SetPlayerPos(giveplayerid, x,y,z); format(string, sizeof(string), "--- %s (id: %d) teleported %s (id: %d) to %s (id: %d)", playername[playerid],playerid,playername[giveplayerid],giveplayerid,playername[moneys],moneys); WriteLog(string); format(string, sizeof(string), "* You teleported %s (id: %d) to %s (id: %d).", playername[giveplayerid],giveplayerid,playername[moneys],moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You teleported to %s (id: %d) by %s (id: %d).", playername[moneys],moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(moneys)) { format(string, sizeof(string), "* %d is not an active player.", moneys); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/warp", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpto [playerid] [playerid]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpto [playerid] [playerid]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid) && IsPlayerConnected(moneys)) { GetPlayerPos(moneys, x,y,z); SetPlayerInterior(giveplayerid, 0); if (IsPlayerInAnyVehicle(giveplayerid)) SetVehiclePos(GetPlayerVehicleID(giveplayerid), x,y,z); else SetPlayerPos(giveplayerid, x,y,z); format(string, sizeof(string), "--- %s (id: %d) teleported %s (id: %d) to %s (id: %d)", playername[playerid],playerid,playername[giveplayerid],giveplayerid,playername[moneys],moneys); WriteLog(string); format(string, sizeof(string), "* You teleported %s (id: %d) to %s (id: %d).", playername[giveplayerid],giveplayerid,playername[moneys],moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You teleported to %s (id: %d) by %s (id: %d).", playername[moneys],moneys,playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } if (!IsPlayerConnected(moneys)) { format(string, sizeof(string), "* %d is not an active player.", moneys); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } // AddPlayerClass(-691.6066,939.3797,13.6328,265.6362,7,,0,0,0,0,0,0); // SPAWNADMIN /* if (strcmp(cmd, "/home", true) == 0 && PlayerAccess(playerid) >= 1) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-691.6066,939.3797,13.6328,265.6362); else SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-691.6066,939.3797,13.6328,265.6362); format(string, sizeof(string), "%s (id: %d) Has teleported to his house.", playername[playerid],playerid); SendClientMessageToAll(COLOR_RED, string); GivePlayerMoney(playerid,30000); return 1; } */ if (strcmp(cmd, "/locs", true) == 0 && PlayerAccess(playerid) >= 2) { SendClientMessage(playerid, COLOR_GREY, "* Available teleport locations:"); for (new i=0;i= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /fromcar [playerid]"); return 1; } giveplayerid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { if (IsPlayerInAnyVehicle(playerid)) { RemovePlayerFromVehicle(giveplayerid); format(string, sizeof(string), "--- %s (id: %d) removed %s (id: %d) from car.", playername[playerid],playerid,playername[giveplayerid],giveplayerid); WriteLog(string); format(string, sizeof(string), "* You removed %s (id: %d) from car.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* %s (id: %d) removed you from car.", playername[playerid],playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); } else { format(string, sizeof(string), "* %s (id: %d) is on foot.", playername[giveplayerid],giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } } else { format(string, sizeof(string), "* %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } if (strcmp(cmd, "/setsettings", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setsettings [key] [value]"); return 1; } strmid(tmp2, cmdtext, 14+strlen(tmp), strlen(cmdtext)); if (!strlen(tmp2)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setsettings [key] [value]"); return 1; } dini_Set(FILE_SETTINGS, tmp, tmp2); format(string, sizeof(string), "--- %s (id: %d) changes server settings: %s=%s.", playername[playerid],playerid,tmp,tmp2); WriteLog(string); format(string, sizeof(string), "* You change server settings: %s=%s.", tmp,tmp2); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/unsetsettings", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetsettings [key]"); return 1; } dini_Unset(FILE_SETTINGS, tmp); format(string, sizeof(string), "* You unset server settings: %s.", tmp); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/getsettings", true) == 0 && PlayerAccess(playerid) >= 3) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getsettings [key]"); return 1; } tmp2 = dini_Get(FILE_SETTINGS, tmp); format(string, sizeof(string), "* Settings is: %s=%s.", tmp,tmp2); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if (strcmp(cmd, "/loadsettings", true) == 0 && PlayerAccess(playerid) >= 3) { format(string, sizeof(string), "--- %s (id: %d) requested to load settings file.", playername[playerid],playerid); WriteLog(string); LoadSettings(); SendClientMessage(playerid, COLOR_GREEN, "* Settings file loaded."); return 1; } if (strcmp(cmd, "/ann", true) == 0 && PlayerAccess(playerid) >= 1) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ann [time] [text]"); return 1; } moneys = strval(tmp); strmid(tmp, cmdtext, 10+strlen(tmp), strlen(cmdtext)); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ann [time] [text]"); return 1; } format(string, sizeof(string), "--- %s (id: %d) announced:%s for a %d seconds.", playername[playerid],playerid,tmp,moneys); WriteLog(string); GameTextForAll(tmp, moneys*1000, 10); return 1; } if (strcmp(cmd, "/settime", true) == 0 && PlayerAccess(playerid) >= 2) { tmp = strtok(cmdtext, idx); moneys = strval(tmp); if (!strlen(tmp) || moneys < 0 || moneys > 23) { SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /settime [0-23]"); return 1; } worldTime = moneys; SetWorldTime(moneys); format(string, sizeof(string), "--- %s (id: %d) sets world time to %d:00.", playername[playerid],playerid,moneys); WriteLog(string); format(string, sizeof(string), "* World time set to %d:00 by %s (id: %d).", moneys,playername[playerid],playerid); SendClientMessageToAll(COLOR_LIGHTBLUE, string); return 1; } if (strcmp(cmd, "/resettotalstats", true) == 0 && PlayerAccess(playerid) >= 3) { format(string, sizeof(string), "--- %s (id: %d) requested to reset total statistic.", playername[playerid],playerid); WriteLog(string); tmp = dini_Get(FILE_TOTALSTAT, "users"); dini_Remove(FILE_TOTALSTAT); dini_Create(FILE_TOTALSTAT); dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp)); SendClientMessage(playerid, COLOR_ORANGE, "* Resetting total statistic."); return 1; } if (strcmp(cmd, "/gmx", true) == 0 && PlayerAccess(playerid) >= 4) { format(string, sizeof(string), "--- %s (id: %d) requested gamemode exit.", playername[playerid],playerid); WriteLog(string); GameTextForAll("~r~Freeroam gamemode exiting...", 5000, 5); OnGameModeExit(); return 1; } if(strcmp(cmd,"/refuel",true)==0) { if(IsPlayerInCheckpoint(playerid)) { if(GetPlayerMoney(playerid) >= 100) { SendClientMessage(playerid,COLOR_GREY,"Re-Fueling your vehicle"); SendClientMessage(playerid,COLOR_GREY,"Emergency fuel type /ef for extra fuel type /bt"); Filling[playerid] = 1; GivePlayerMoney(playerid,-100); } } return 1; } } else return 0; } return 0; } public OnPlayerEnterCheckpoint(playerid) { new string[MAX_STRING]; switch (getCheckpointType(playerid)) { case CP_STATION1: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"To get more fuel in your vehicle type /refuel"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION2: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION3: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION4: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION5: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION6: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION7: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION8: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION9: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION10: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION11: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION12: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION13: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION14: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } else { SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel.."); } case CP_STATION15: if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle"); } case CP_BANK, CP_BANK2: { if (enablebank) { SendClientMessage(playerid, COLOR_YELLOW, "* You are at an ATM. To store money use /bank, to withdraw"); SendClientMessage(playerid, COLOR_YELLOW, "* money use /get, and /balance to see your balance."); SendClientMessage(playerid, COLOR_YELLOW, "* Also you can /transact money to another player's bank."); if (strlen(clan[playerid])) SendClientMessage(playerid, COLOR_YELLOW, "* More of it, you can use clan bank: /clanbank /clanget /clanbalance."); } else SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server."); } case CP_ROOF: { if (rooftop) { SendClientMessage(playerid, COLOR_YELLOW, "* You can hold the roof area to gain money."); if (antirooftopkill) SendClientMessage(playerid, COLOR_RED, "* If you kill another player here you will be punished!"); } else SendClientMessage(playerid, COLOR_RED, "* Roof holding are not allowed on this server."); } case CP_PORT: { if (portship) { SendClientMessage(playerid, COLOR_YELLOW, "* You can hold the cargo ship area to gain money."); if (antiportshipkill) SendClientMessage(playerid, COLOR_RED, "* If you kill another player here you will be punished!"); } else SendClientMessage(playerid, COLOR_RED, "* Cargo ship holding are not allowed on this server."); } case CP_PIRATE: { if (pirateship) { SendClientMessage(playerid, COLOR_YELLOW, "* You can hold the pirate ship area to gain money."); if (antipirateshipkill) SendClientMessage(playerid, COLOR_RED, "* If you kill another player here you will be punished!"); } else SendClientMessage(playerid, COLOR_RED, "* Pirate ship holding are not allowed on this server."); } case CP_AMMU, CP_AMMU2: { if (spawnweapons) { SendClientMessage(playerid, COLOR_GREEN, "* You can purchase weapons here so that you have them every time you spawn."); SendClientMessage(playerid, COLOR_YELLOW, "* Type /bw(melee,pistol,shotgun,smg,rifle,rifle2,gift,spray) and /weaplist for a list of weapons."); } else SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server."); } case CP_SPRES: { if (allowspawnchange) { format(string, sizeof(string), "* You can change here you default spawn location for $%d.", spawnchangecost); SendClientMessage(playerid, COLOR_ORANGE, string); SendClientMessage(playerid, COLOR_YELLOW, "* Type /setspawn to change location and /spawnlist to see available locations."); } else SendClientMessage(playerid, COLOR_RED, "* Spawn change are not allowed on this server."); } case CP_AIR1: { if (airports) { format(string, sizeof(string), "* You can fly to another airport from here for $%d.", airportticket); SendClientMessage(playerid, COLOR_WHITE, string); SendClientMessage(playerid, COLOR_YELLOW, "* Type /flytosf or /flytolv to fly to San Fierro or Las Venturas."); } else SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server."); } case CP_AIR2: { if (airports) { format(string, sizeof(string), "* You can fly to another airport from here for $%d.", airportticket); SendClientMessage(playerid, COLOR_WHITE, string); SendClientMessage(playerid, COLOR_YELLOW, "* Type /flytols or /flytolv to fly to Los Santos or Las Venturas."); } else SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server."); } case CP_AIR3: { if (airports) { format(string, sizeof(string), "* You can fly to another airport from here for $%d.", airportticket); SendClientMessage(playerid, COLOR_WHITE, string); SendClientMessage(playerid, COLOR_YELLOW, "* Type /flytols or /flytosf to fly to Los Santos or San Fierro."); } else SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server."); } } if (getCheckpointType(playerid) >= P_OFFSET) { format(string, sizeof(string), "* You can buy the %s for $%d with /buy.", propertyNames[playerCheckpoint[playerid]-P_OFFSET], propertyValues[playerCheckpoint[playerid]-P_OFFSET]); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "* You will earn $%d regularly.", propertyEarnings[playerCheckpoint[playerid]-P_OFFSET]); SendClientMessage(playerid, COLOR_YELLOW, string); if (strlen(propertyowner[playerCheckpoint[playerid]-P_OFFSET])) { if (strcmp(propertyowner[playerCheckpoint[playerid]-P_OFFSET], playername[playerid], true) == 0) SendClientMessage(playerid, COLOR_GREEN, "* You own this property and can /sell it."); else { format(string, sizeof(string), "* This property is currently owned by %s.", propertyowner[playerCheckpoint[playerid]-P_OFFSET]); SendClientMessage(playerid, COLOR_RED, string); } } } } public OnGameModeInit() { for(new c=0;c