/* Autor: [GA]Predator Start Date: 6/11/2007 Finish Date: - Version: 0.1 License: - Caution: Not change credits or code GameMode: Los Santos RolePlay */ //=========================[Includes]=========================================== #include #include #include #include #include #include #include #include //=========================[Defines]============================================ ///========================[Colors]========================================== #define COLOR_GRAD1 0xB4B5B7AA #define COLOR_GRAD2 0xBFC0C2AA #define COLOR_GRAD3 0xCBCCCEAA #define COLOR_GRAD4 0xD8D8D8AA #define COLOR_GRAD5 0xE3E3E3AA #define COLOR_GRAD6 0xF0F0F0AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_FADE1 0xE6E6E6AA #define COLOR_FADE2 0xC8C8C8AA #define COLOR_FADE3 0xAAAAAAAA #define COLOR_FADE4 0x8C8C8CAA #define COLOR_FADE5 0x6E6E6EAA #define COLOR_PURPLE 0xC2A2DAAA #define COLOR_DBLUE 0x2641FEAA #define COLOR_ALLDEPT 0xFF8282AA #define COLOR_ORANGE 0xFF9900AA #define COLOR_GOLD 0xB8860BAA #define COLOR_SYSTEM 0xEFEFF7AA //========================[Teams]=========================================== #define TEAM_COP 1 #define TEAM_RUMAFIA 2 #define TEAM_Taxi 3 #define TEAM_ZIVI 4 #define TEAM_ITMAFIA 5 //=========================[Others]========================================= #define PayDay_Amount 10000 #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #define ADMIN_SPEC_TYPE_NONE 0 #define ADMIN_SPEC_TYPE_PLAYER 1 #define ADMIN_SPEC_TYPE_VEHICLE 2 #define TICKET_PRICE 100 // $100 //=========================[New]================================================ new PLAYERLIST_authed[MAX_PLAYERS]; new Menu:Weapons; new gdebug = 1; new shifthour; new ghour = 0; new gminute = 0; new gsecond = 0; new timeshift = 0; new BigEar[MAX_PLAYERS]; new gTeam[MAX_PLAYERS]; new exp[MAX_PLAYERS]; new Mute[MAX_PLAYERS]; new gSpectateID[MAX_PLAYERS]; new gSpectateType[MAX_PLAYERS]; new PlayerTickets[MAX_PLAYERS][6]; new bool:PlayerIn[MAX_PLAYERS]; new PlayerMatchs[MAX_PLAYERS]; new Menu:gMenu0[256]; new Menu:gMenue0[256]; //=========================[Forwards]=========================================== forward ABroadCast(color,const string[],level); forward ProxDetectorS(Float:radi, playerid, targetid); forward GameModeExitFunc(); forward SyncUp(); forward clock(); forward IsAtLocalToHeal(playerid); forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); forward SystemMsg(playerid,msg[]); forward SendAdminMessage(color, string[]); forward PayDay(); forward TimeUpdate(); forward GameModeInitExitFunc(); forward BroadCast(color,const string[]); forward FixHour(hour); forward SyncTime(); forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5); forward GetPlayerID (string[]); forward IsStringAName (string[]); forward LotteryStart(); //=========================[Admin Spec STRTOK]================================== adminspec_strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } //=========================[Main]=============================================== main() { print("----------------------------------"); print("///////////////////////////////"); print("*******************************"); print("* *"); print("* *------Los Santos RolePlay----------* *"); print("* by: [GA]Predator *"); print("*******************************"); print("///////////////////////////////"); print("----------------------------------"); } //=========================[OnGameModeInit]===================================== public OnGameModeInit() { // Don't use these lines if it's a filterscript UsePlayerPedAnims(); SetGameModeText("LS RolePlay v0.1"); AllowInteriorWeapons(1); AllowAdminTeleport(1); gettime(ghour, gminute, gsecond); FixHour(ghour); ghour = shifthour; //========================[AddStaticVehicle]==================================== AddStaticVehicleEx(596,-1381.9910,457.0832,6.9837,0.1452, 44, 86, 60000);/*Patriot cruiser*/ AddStaticVehicleEx(596,1558.392000,-1710.859000,5.466783,1.0, -1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,1569.639000,-1710.859000,5.466783,1.0, -1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,-2139.1995,-2393.7671,30.3452,140.7012, 0, 0, 60000);/*CopCruiser*/ AddStaticVehicleEx(425,-1279.8262,493.3734,18.0309,219.1345, -1, -1, 60000);/*Hunter*/ AddStaticVehicleEx(425,-1291.0063,492.3819,18.0305,223.8306, -1, -1, 60000);/*Hunter*/ AddStaticVehicleEx(596,1601.308000,-1621.916000,13.056540,90.0, -1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,1535.8275,-1678.0283,13.1680,359.9876, -1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,1561.860000,-1694.905000,6.139762,222.0,-1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(470,-1375.1555,457.5534,6.9837,359.8331,-1, -1, 60000);/*Patriot*/ AddStaticVehicleEx(467,1067.1295,-295.5681,73.7826,179.6040, 90, -1, 60000);/*Hitman Oceanic*/ AddStaticVehicleEx(467,1077.3829,-295.1148,73.7812,180.2754, 90, -1, 60000);/*Hitman Oceanic*/ AddStaticVehicleEx(596,614.8,-588.5,17.4,240.0, -1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,635.1,-561.5,16.5,180.0, -1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,-2177.5759,-2362.5042,30.4296,141.0939, 0, 0, 60000);/*CopCruiser*/ AddStaticVehicleEx(490,1539.392000,-1646.262000,6.274928,180.0, -1, -1, 60000);/*FBI Rancher*/ AddStaticVehicleEx(490,1531.254000,-1647.431000,6.274976,200.0, -1, -1, 60000);/*FBI Rancher*/ AddStaticVehicleEx(470,-1363.1493,457.1042,6.9836,359.6740, -1, -1, 60000);/*Patriot*/ AddStaticVehicleEx(470,-1355.5931,456.7297,6.9836,0.0286, -1, -1, 60000);/*Patriot*/ AddStaticVehicleEx(596,1535.8459,-1668.7560,13.2653,359.7447,-1, -1, 60000);/*CopCruiser*/ AddStaticVehicleEx(407,-2550.1443,610.7148,14.3281,90.6597, -1, -1, 60000);/*FireTruck*/ AddStaticVehicleEx(596,-2181.2766,-2375.6953,30.3405,231.7148, 0, 0, 60000);/*CopCruiser*/ AddStaticVehicleEx(596,1545.7845,-1684.4004,5.6342,271.1593, 89, 1, 60000);/*General Car*/ AddStaticVehicleEx(596,1530.1611,-1676.0326,5.4563,231.7766, 89, 1, 60000);/*General Car*/ AddStaticVehicleEx(407,-2551.8792,587.1581,14.3281,90.4374,-1, -1, 60000);/*FireTruck*/ AddStaticVehicleEx(497, 1517.8,-1656.1,13.7,0.0, -1, -1, 60000);/*Police Maveric*/ AddStaticVehicleEx(416,-2637.0630,617.3499,14.3281,90.1464, -1, -1, 60000);/*Ambulance*/ AddStaticVehicleEx(416,-2661.4282,617.3460,14.3288,89.2072, -1, -1, 60000);/*Ambulance*/ AddStaticVehicleEx(416,-2662.4568,595.3354,14.3281,273.2716, -1, -1, 60000);/*Ambulance*/ AddStaticVehicleEx(431,1172.5,-1795.5,13.1,0.0, -1, -1, 60000);//64/*Bus*/ AddStaticVehicleEx(431,1182.1,-1795.9,13.1,0.0, -1, -1, 60000);//65/*Bus*/ AddStaticVehicleEx(430,-1443.4342,427.0862,-0.6994,268.8489,-1, -1, 60000);/*NG BOAT*/ AddStaticVehicleEx(430,-1442.0721,390.6206,-0.4339,270.1023,-1, -1, 60000);/*NG BOAT*/ AddStaticVehicleEx(467,1071.9189,-294.9166,73.7250,178.9444,90, -1, 60000);//68/*Hitman Oceanic*/ AddStaticVehicleEx(405,-2082.3562,-117.3896,34.9299,177.0056,17, 17, 60000);//69 Driving School /*Sentinel*/ AddStaticVehicleEx(405,-2072.5933,-117.4564,34.9383,178.0982,17, 17, 60000);//Driving School/*Sentinel*/ AddStaticVehicleEx(405,-2062.4253,-117.6652,34.9347,180.8394,17, 17, 60000);//Driving School/*Sentinel*/ AddStaticVehicleEx(434,551.7929,-1285.5260,16.9303,0.4147,-1, -1, 60000);//Rent car/*Hotknife*/ AddStaticVehicleEx(568,536.9888,-1286.5275,16.9993,359.1704,-1, -1, 60000); //Rent car/*Bandito*/ AddStaticVehicleEx(434,544.1793,-1286.1422,16.9492,7.3116,-1, -1, 60000);//Rent car/*Hotknife*/ AddStaticVehicleEx(434,-1949.9493,258.1949,35.1922,70.7581,-1, -1, 60000); //Rent car/*Hotknife*/ AddStaticVehicleEx(568,-1948.1650,264.8094,35.1930,72.6982,-1, -1, 60000); //Rent car/*Bandito*/ AddStaticVehicleEx(434,-1947.0601,270.3815,35.1954,66.0783,-1, -1, 60000); //Rent car/*Hotknife*/ AddStaticVehicleEx(456,2795.2,-2417.8,13.4,90.8,-1,-1,60000);//Component Truck/*Yankee*/ AddStaticVehicleEx(456,2783.9,-2417.9,13.4,90.8,-1,-1,60000);//Component Truck/*Yankee*/ AddStaticVehicleEx(440,2794.1,-2455.9,13.4,90.8,-1,-1,60000);//Component Truck/*Rumpo*/ AddStaticVehicleEx(440,2782.9,-2455.6,13.4,90.8,-1,-1,60000);//Component Truck/*Rumpo*/ AddStaticVehicleEx(420,-1986.4958,115.9394,27.3324,0.1277,-1, -1, 60000);//Taxi/*Taxi*/ AddStaticVehicleEx(487,-2703.3201,624.0250,14.1766,180.2649, 1, 3, 60000);//Medic Chopper/*Maverick*/ AddStaticVehicleEx(420,-1986.5049,129.1749,27.3299,359.6938,-1, -1, 60000);//Taxi/*Taxi*/ AddStaticVehicleEx(420,-1986.4310,150.1195,27.3299,0.0329,-1, -1, 60000);//Taxi //CAR ID 85/*Taxi*/ AddStaticVehicleEx(452,720.1,-1694.0,-0.4,179.4,-1,-1,60000);//Fishboat/*Speeder*/ AddStaticVehicleEx(452,721.2,-1629.4,-0.4,180.9,-1,-1,60000);//Fishboat/*Speeder*/ AddStaticVehicleEx(452,739.5,-1670.5,-0.6,177.5,-1,-1,60000);//Fishboat/*Speeder*/ AddStaticVehicleEx(452,-1474.4949,693.0169,0.1996,0.0751,-1,-1,60000);//Fishboat SF/*Speeder*/ AddStaticVehicleEx(452,-1720.0717,1439.6177,-0.4913,357.6789,-1,-1,60000);//Fishboat SF/*Speeder*/ AddStaticVehicleEx(520,-1430.4078,508.1596,18.9400,269.6329,44,86,60000);//NG Plane id 91 AddStaticVehicleEx(520,-1419.9038,493.5340,18.9350,269.6848,44,86,60000);//NG Plane id 92 AddStaticVehicleEx(520,-1398.6207,507.7513,18.9328,269.8143,44,86,60000); //NG Plane id 93 AddStaticVehicleEx(420,-1986.6089,163.8508,27.4837,359.5881,-1,-1,60000);//Taxi AddStaticVehicleEx(487,1088.1736,-294.8004,73.7886,134.9237, 0, 1, 60000); //Hitman Chopper AddStaticVehicleEx(488,-2044.1797,479.9963,35.1399,180.0648,-1,-1,60000); // newschopper AddStaticVehicleEx(582,-2022.6146,458.6767,35.1414,0.7133,-1,-1,60000); // newsvan AddStaticVehicleEx(582,-2031.3779,459.0133,35.1362,359.7429,-1,-1,60000); // newsvan AddStaticVehicleEx(593,382.5172,2536.9561,16.5338,179.7261,-1,-1,60000);//Flyschool AddStaticVehicleEx(513,348.3660,2536.9792,16.7418,178.8195,-1,-1,60000);//Flyschool AddStaticVehicleEx(487,365.4068,2537.0327,16.6645,181.9959,-1,-1,60000);//Flyschool AddStaticVehicleEx(593,-1429.2843,-505.8203,13.7824,205.7709,-1,-1,60000);//Airport SF AddStaticVehicleEx(593,-1462.4779,-524.2803,13.7832,204.8137,-1,-1,60000);//Airport SF AddStaticVehicleEx(593,1907.7614,-2624.4097,13.5416,53.1810,-1,-1,60000);//Airport LS AddStaticVehicleEx(593,1887.0736,-2627.6543,13.5394,52.6116,-1,-1,60000);//Airport LS AddStaticVehicleEx(513,-1354.3270,-466.5467,13.7827,162.0134,-1,-1,60000);//Airport SF AddStaticVehicleEx(513,-1390.3510,-482.7985,13.7883,250.3124,-1,-1,60000);//Airport SF AddStaticVehicleEx(513,1835.3215,-2624.1938,13.5405,56.0569,-1,-1,60000);//Airport LS AddStaticVehicleEx(513,1813.2893,-2625.6296,13.5394,53.2858,-1,-1,60000);//Airport LS AddStaticVehicleEx(571,2286.2141,-2354.5000,12.8306,225.8705,-1,-1,60000); // kart AddStaticVehicleEx(571,2279.9412,-2348.4141,12.8312,225.8585,-1,-1,60000); // kart AddStaticVehicleEx(571,2291.7932,-2345.5356,12.8305,227.3060,-1,-1,60000); // kart AddStaticVehicleEx(571,2287.5615,-2341.6433,12.8306,226.5350,-1,-1,60000); // kart AddStaticVehicleEx(571,2299.6785,-2338.3186,12.8307,224.3563,-1,-1,60000); // kart AddStaticVehicleEx(571,2295.3887,-2334.9448,12.8307,227.9102,-1,-1,60000); // kart AddStaticVehicleEx(560,1662.3564,-2324.6292,-3.0612,270.6094,9,39,60000); // Sultan AddStaticVehicleEx(560,1649.7272,-2324.8494,-3.0604,270.0831,9,39,60000); // Sultan AddStaticVehicleEx(562,1646.8011,-2313.7078,-3.1032,90.6876,35,1,6000); // elegy AddStaticVehicleEx(562,1641.0297,-2313.7839,-3.1134,90.5563,35,1,6000); // elegy AddStaticVehicleEx(420,1780.0959,-1932.9994,13.1662,179.0410,6,1,6000); // taxi AddStaticVehicleEx(420,1783.9469,-1932.9420,13.1661,1.5891,6,1,6000); // taxi AddStaticVehicleEx(420,1789.7711,-1933.1135,13.1668,0.0327,6,1,6000); // taxi AddStaticVehicleEx(445,1242.2391,-805.9954,84.0156,179.5366,0,0,6000); // Admiral AddStaticVehicleEx(405,1249.1576,-805.2897,84.0156,179.7218,0,0,6000); // sentinel AddStaticVehicleEx(487,1290.9125,-786.8452,96.6376,182.2887,0,0,6000); // maverick CreateVehicle(494,-1401.0436,-210.0052,1042.9913,1.6623,1,0,60000); //hotring 116 CreateVehicle(494,-1400.4019,-219.9365,1043.0348,5.3554,1,3,60000); //hotring CreateVehicle(494,-1394.4932,-207.7917,1042.9963,3.6872,0,6,60000); //hotring CreateVehicle(494,-1393.7854,-217.9354,1043.0325,2.9556,1,2,60000); //hotring CreateVehicle(468,-1445.6392,-592.3033,1055.7831,90.2133,-1,-1,60000); //bike 120 CreateVehicle(468,-1433.1708,-592.4930,1055.6533,92.4067,-1,-1,60000); //bike CreateVehicle(468,-1448.5325,-584.4943,1055.4949,95.5400,-1,-1,60000); //bike CreateVehicle(468,-1434.8973,-585.1266,1055.2488,91.1533,-1,-1,60000); //bike CreateVehicle(468,-1449.2814,1610.7823,1052.5313,272.9406,-1,-1,60000); // bike 124 CreateVehicle(468,-1453.8767,1611.2418,1052.5313,89.0355,-1,-1,60000); // bike CreateVehicle(468,-1454.4746,1614.3342,1052.5313,86.8422,-1,-1,60000); // bike CreateVehicle(468,-1449.5795,1614.0684,1052.5313,269.2039,-1,-1,60000); // bike //========================[AddPlayerClass]====================================== AddPlayerClass(280,1568.4672,-1693.9225,5.8906,182.4565,6,0,25,100,28 ,200); // cop AddPlayerClass(281,1568.4672,-1693.9225,5.8906,182.4565,6,0,25,100,28 ,200); // cop AddPlayerClass(282,1568.4672,-1693.9225,5.8906,182.4565,6,0,25,100,28 ,200); // cop AddPlayerClass(164,1282.8873,-816.8701,84.1261,179.5134,4,0,31,200,28,200); // russische mafia AddPlayerClass(165,1282.8873,-816.8701,84.1261,179.5134,4,0,31,200,28,200); // russische mafia AddPlayerClass(166,1282.8873,-816.8701,84.1261,179.5134,4,0,31,200,28,200); // russische mafia AddPlayerClass(255,1793.2297,-1914.5317,13.3952,335.2144,5,0,30,200,28,200); // taxi fahrer AddPlayerClass(7,1642.8331,-2332.5037,-2.6797,51.1829,24,50,30,200,28,200); // zivi AddPlayerClass(60,1642.8331,-2332.5037,-2.6797,51.1829,24,50,30,200,28,200); // zivi AddPlayerClass(170,1642.8331,-2332.5037,-2.6797,51.1829,24,50,30,200,28,200); // zivi AddPlayerClass(120,1101.6492,-299.8464,73.9922,88.2183,23,100,33,15,28,200); // mafia AddPlayerClass(117,1101.6492,-299.8464,73.9922,88.2183,23,100,33,15,28,200); // mafia AddPlayerClass(113,1101.6492,-299.8464,73.9922,88.2183,23,100,33,15,28,200); // mafia //========================[Pickups]============================================ AddStaticPickup(1273,2,1496.706298,-688.842834,95.240135);//Pickup Id 0; //========================[Create Object]======================================= //========================[Timer]=============================================== SetTimer("LotteryStart", 300000, 1); return 1; } //=======================[OnPlayerInteriorChange]=============================== public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { // IF ANYONE IS SPECTATING THIS PLAYER, WE'LL ALSO HAVE // TO CHANGE THEIR INTERIOR ID TO MATCH new x = 0; while(x!=MAX_PLAYERS) { if( IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && gSpectateID[x] == playerid && gSpectateType[x] == ADMIN_SPEC_TYPE_PLAYER ) { SetPlayerInterior(x,newinteriorid); } x++; } } //=========================[OnGameModeExit]===================================== public OnGameModeExit() { return 1; } //=========================[OnPlayerRequestClass]=============================== public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, -3738.5388,1617.1871,62.4362); SetPlayerCameraPos(playerid, -3738.5388,1621.1871,62.4362); SetPlayerCameraLookAt(playerid, -3738.5388,1617.1871,62.4362); SetPlayerFacingAngle(playerid,0.0); if(classid == 0 || classid == 1 || classid == 2){ gTeam[playerid] = TEAM_COP; GameTextForPlayer(playerid, "~w~Cops", 500, 6);} else if(classid == 3 || classid == 4 || classid == 5){ gTeam[playerid] = TEAM_RUMAFIA; GameTextForPlayer(playerid, "Russische Mafia", 500, 6);} else if(classid == 6 ){ gTeam[playerid] = TEAM_Taxi; GameTextForPlayer(playerid, "~r~ Taxi Fahrer", 500, 6);} else if(classid == 7 || classid == 8 || classid == 9){ gTeam[playerid] = TEAM_ZIVI; GameTextForPlayer(playerid, "~g~Zivilist", 500, 6);} else if(classid == 10 || classid == 11 || classid == 12){ gTeam[playerid] = TEAM_ITMAFIA; GameTextForPlayer(playerid, "~p~Italienische Mafia", 500, 6);} return 1; } //=========================[OnPlayerRequestSpawn]=============================== public OnPlayerRequestSpawn(playerid) { SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_COP) SetPlayerColor(playerid, 0xD8D8D8AA); else if(gTeam[playerid] == TEAM_RUMAFIA) SetPlayerColor(playerid, 0x00FF00FF); else if(gTeam[playerid] == TEAM_Taxi) SetPlayerColor(playerid, 0xF200F2FF); else if(gTeam[playerid] == TEAM_ZIVI) SetPlayerColor(playerid, 0xFFFF00AA); else if(gTeam[playerid] == TEAM_ITMAFIA) SetPlayerColor(playerid, 0x00FFFFFF); return 1; } //=========================[SystemMsg]========================================== public SystemMsg(playerid,msg[]) { if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) { SendClientMessage(playerid,COLOR_SYSTEM,msg); } return 1; } //=========================[OnPlayerConnect]==================================== public OnPlayerConnect(playerid) { clock(); new PlayerName[30], str[256]; GetPlayerName(playerid, PlayerName, 30); format(str, 256, "%s has joined the server", PlayerName); SendClientMessageToAll(COLOR_GRAD1, str); format(str, sizeof(str), "%s.dudb.sav", PlayerName); if (!udb_Exists(PlayerName2(playerid))) { SendClientMessage(playerid, COLOR_GREEN, "Willkommen zum German Los Santos RolePlay!"); SendClientMessage(playerid, COLOR_GRAD2, "Tippe /help um die Commands zu sehen und /admins um die Admins zu sehen, die gerade Online sind"); SendClientMessage(playerid, COLOR_GRAD3, "Tippe /register um einen Account zu erstellen oder /help für Hilfe zum Game Mode"); SendClientMessage(playerid, COLOR_YELLOW, "Tippe /credits um die Credits von den Game Mode scriptern zu sehen"); return 1; } else { PLAYERLIST_authed[playerid]=false; SendClientMessage(playerid, COLOR_GREEN, "Willkommen!"); SendClientMessage(playerid, COLOR_YELLOW, "Dieser Nickname ist registriert!"); SendClientMessage(playerid, COLOR_WHITE, "Du kannst dich mit /login einloggen"); return 1; } } //=========================[PlayerName2]======================================== stock PlayerName2(playerid) { new name[255]; GetPlayerName(playerid, name, 255); return name; } //=========================[OnPlayerDisconnect]================================= public OnPlayerDisconnect(playerid, reason) { new PlayerName[30], str[256]; switch (reason) { case 0: { GetPlayerName(playerid, PlayerName, 30); format(str, 256, "%s has left the server (Timeout)", PlayerName); SendClientMessageToAll(COLOR_GRAD1, str); } case 1: { GetPlayerName(playerid, PlayerName, 30); format(str, 256, "%s has left the server (Leaving)", PlayerName); SendClientMessageToAll(COLOR_GRAD1, str); } case 2: { GetPlayerName(playerid, PlayerName, 30); format(str, 256, "%s has left the server (Kicked /Banned)", PlayerName); SendClientMessageToAll(COLOR_GRAD1, str); } } if (PLAYERLIST_authed[playerid]) { // Was loggedin, so save the data! dUserSetINT(PlayerName2(playerid)).("money",GetPlayerMoney(playerid)); } PLAYERLIST_authed[playerid]=false; return false; } /* * /register password * */ dcmd_register(playerid,params[]) { // The command shouldn't work if we already are authed if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Du bist bereits registriert."); // The command shouldn't work if an account with this // nick already exists if (udb_Exists(PlayerName2(playerid))) return SystemMsg(playerid,"Diesen Account gibs schon, bitte benutze '/login password'."); // Did he forgot the password? if (strlen(params)==0) return SystemMsg(playerid,"Richtige Benutzung: '/register password'"); // We save the money to the accstate if (udb_Create(PlayerName2(playerid),params)) return SystemMsg(playerid,"Account erfolgreich erstellt. Logg dich jetzt mit '/login password' ein."); return true; } /* * /login password * */ dcmd_login(playerid,params[]) { // The command shouldn't work if we already are authed if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Du bist bereits Eingeloggt."); // The command shouldn't work if an account with this // nick does not exists if (!udb_Exists(PlayerName2(playerid))) return SystemMsg(playerid,"Diesen Account gibs nicht. Bitte benutze '/register password'."); // Did he forgot the password? if (strlen(params)==0) return SystemMsg(playerid,"Richtige Benutzung: '/login password'"); if (udb_CheckLogin(PlayerName2(playerid),params)) { // Login was correct // Following thing is the same like the missing SetPlayerCommand GivePlayerMoney(playerid,dUserINT(PlayerName2(playerid)).("money")-GetPlayerMoney(playerid)); PLAYERLIST_authed[playerid]=true; return SystemMsg(playerid,"Erfolgreich eingeloggt!"); } // Login was incorrect return SystemMsg(playerid,"Login fehlgeschlagen!"); } //================================[OnPlayerSpawn]=============================== public OnPlayerSpawn(playerid) { if(GetPlayerMoney(playerid)<1000) { GivePlayerMoney(playerid, 6000); } SetPlayerCheckpoint(playerid, -3897.0706,1661.6644,12.2917, 2.0); return 1; } //==============================[Lotto]========================================= public LotteryStart() { new rand1, rand2, rand3, rand4, rand5, rand6; rand1 = random(49); rand2 = random(49); rand3 = random(49); rand4 = random(49); rand5 = random(49); rand6 = random(49); new string[256]; format(string, sizeof(string), "Die Lotto Zahlen: %d, %d, %d, %d, %d, %d", rand1, rand2, rand3, rand4, rand5, rand6); SendClientMessageToAll(COLOR_GREEN, string); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && PlayerIn[i]) { for(new j = 0; j < 6; j++) { if(PlayerTickets[i][j] == rand1 || PlayerTickets[i][j] == rand2 || PlayerTickets[i][j] == rand3 || PlayerTickets[i][j] == rand4 || PlayerTickets[i][j] == rand5 || PlayerTickets[i][j] == rand6) { PlayerMatchs[i]++; } PlayerTickets[i][j]=0; } PlayerIn[i]=false; if(PlayerMatchs[i] > 0) { format(string, sizeof(string), "Du hast %d Richtige.Du hast %d$ Gewonnen!!!", PlayerMatchs[i], PlayerMatchs[i]*100); SendClientMessage(i, COLOR_LIGHTBLUE, string); GivePlayerMoney(i,PlayerMatchs[i]*100); PlayerMatchs[i]=0; } } } } //=========================[Weapon Menu]======================================== public OnPlayerSelectedMenuRow(playerid, row) { new Menu:Current = GetPlayerMenu(playerid); if (Current == gMenu0[255]) { switch(row) { case 0: { DestroyCurrentMenu(playerid); OnInfo(playerid,0); TogglePlayerControllable(playerid,1); } case 1: { DestroyCurrentMenu(playerid); TogglePlayerControllable(playerid,1); if (OnEnter(playerid,0)==1){ ShowMenuForPlayer(gMenue0[255],playerid); SetPlayerInterior(playerid,2); SetPlayerPos(playerid,2451.77, -1699.80,1013.51); }} case 2: { DestroyCurrentMenu(playerid); TogglePlayerControllable(playerid,1); if (OnBuy(playerid,0)==1){ ShowMenuForPlayer(gMenue0[255],playerid); SetPlayerInterior(playerid,2); SetPlayerPos(playerid,2451.77, -1699.80,1013.51); }} case 3: { DestroyCurrentMenu(playerid); TogglePlayerControllable(playerid,1); if (OnRent(playerid,0)==1){ ShowMenuForPlayer(gMenue0[255],playerid); SetPlayerInterior(playerid,2); SetPlayerPos(playerid,2451.77, -1699.80,1013.51); }} case 4: { DestroyCurrentMenu(playerid); SellHouse(playerid,0); TogglePlayerControllable(playerid,1); } case 5: { DestroyCurrentMenu(playerid); LockHouse(playerid,0); TogglePlayerControllable(playerid,1); }}} if (Current == gMenue0[255]) { switch(row) { case 0: { new Float:Chealth; GetPlayerHealth(playerid,Chealth); SetPlayerHealth(playerid,Chealth+25); ShowMenuForPlayer(gMenue0[255],playerid);} case 1: { new Float:Carmour; GetPlayerArmour(playerid,Carmour); SetPlayerArmour(playerid,Carmour+2); ShowMenuForPlayer(gMenue0[255],playerid);} case 2: { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1496.706298,-688.842834,95.240135);}}} } return 0; } //========================[OnPlayerDeath]======================================= public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); if (killerid == INVALID_PLAYER_ID) { } else { if (gTeam[killerid] != gTeam[playerid]) { // Valid kill exp[killerid] ++; SetPlayerScore(killerid, exp[killerid]); } else { //Team Killer! GameTextForPlayer(killerid, "~g~Das war einer von deinen Leuten..", 1000, 1); } } return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerPrivmsg(playerid, recieverid, text[]) { new string[256]; new playername[MAX_PLAYER_NAME]; new recievername[MAX_PLAYER_NAME]; GetPlayerName(recieverid, recievername, sizeof(recievername)); GetPlayerName(playerid, playername, sizeof(playername)); for (new a = 0; a < MAX_PLAYERS; a++) { if (IsPlayerConnected(a) && IsPlayerAdmin(a) && a != playerid && a != recieverid) { format(string, sizeof(string), "%s to %s: %s", playername, recievername, text); SendClientMessage(a, 0xFFFF00AA, string); } } return 1; } //========================[OnPlayerCommandText]================================= public OnPlayerCommandText(playerid, cmdtext[]) { new giveplayer[MAX_PLAYER_NAME]; new tmp[256]; new sendername[MAX_PLAYER_NAME]; new string[256]; new cmd[256]; new idx; new giveplayerid; new moneys; new playermoney; new specplayerid; cmd = strtok(cmdtext, idx); dcmd(login,5,cmdtext); // because login has 5 characters dcmd(register,8,cmdtext); // because register has 8 characters ///========================[Admin Spec]========================================= if(strcmp(cmd, "/spec", true) == 0) { new tmp2[128]; tmp2 = adminspec_strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [playerid]"); return 1; } specplayerid = strval(tmp); if(!IsPlayerConnected(specplayerid)) { SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active."); return 1; } TogglePlayerSpectating(playerid, 1); PlayerSpectatePlayer(playerid, specplayerid); SetPlayerInterior(playerid,GetPlayerInterior(specplayerid)); gSpectateID[playerid] = specplayerid; gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER; return 1; } if(strcmp(cmd, "/specoff", true) == 0) { TogglePlayerSpectating(playerid, 0); gSpectateID[playerid] = INVALID_PLAYER_ID; gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE; return 1; } //=========================[Polizei Commands]=================================== if(strcmp(cmd, "/rechtspd", true) == 0) { new pid = strval(tmp); SendClientMessage(playerid,COLOR_GOLD,"Aufforderung versendet!"); if (IsPlayerConnected(pid)) { GameTextForPlayer(giveplayerid,"Polizei! Fahren Sie rechts ran",5000,5); } return 1; } //=========================[Eject Spieler vom Auto]============================= if(strcmp(cmd,"/eject",true)==0){ new ejtmp[256]; new playername[MAX_PLAYER_NAME]; new vehicleid; new pid; new playerstate = GetPlayerState(playerid); new rest[256]; GetPlayerName(playerid,playername,sizeof(playername)); ejtmp = strtok(cmdtext,idx); if(!IsPlayerInAnyVehicle(playerid)){ SendClientMessage(playerid,COLOR_ORANGE,"Du bist in keinem Auto "); return 1; } if(playerstate == PLAYER_STATE_PASSENGER){ SendClientMessage(playerid,COLOR_ORANGE,"Fehler...."); return 1; } if(playerstate != PLAYER_STATE_DRIVER){ SendClientMessage(playerid,COLOR_ORANGE,"Du musst der Fahrer sein"); return 1; } vehicleid = GetPlayerVehicleID(playerid); if(!strlen(rest)){ SendClientMessage(playerid,COLOR_WHITE,"[USAGE]: /eject [playerid]"); return 1; } pid = strval(ejtmp); if(!IsPlayerConnected(pid)){ SendClientMessage(playerid,COLOR_ORANGE,"Spieler nicht gefunden"); return 1; } if (pid == playerid) { SendClientMessage(playerid,COLOR_ORANGE,"Du kannst dich nicht selber aus dem Fahrzeug kicken"); return 1; } if(!IsPlayerInVehicle(pid,vehicleid)){ SendClientMessage(playerid,COLOR_ORANGE,"Spieler ist nicht im Fahrzeug"); return 1; } RemovePlayerFromVehicle(pid); format(string,sizeof(string),"Du wurdest aus %s's Auto gekickt",playername); SendClientMessage(playerid,COLOR_ORANGE,string); return 1; } //=========================[Lotto]============================================== if(strcmp(cmd, "/buyticket", true) == 0) { new no1[256], no2[256], no3[256], no4[256], no5[256], no6[256]; no1 = strtok(cmdtext, idx); no2 = strtok(cmdtext, idx); no3 = strtok(cmdtext, idx); no4 = strtok(cmdtext, idx); no5 = strtok(cmdtext, idx); no6 = strtok(cmdtext, idx); if(!strlen(no1) || !strlen(no2) || !strlen(no3) || !strlen(no4) || !strlen(no5) || !strlen(no6)) { return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buyticket [1] [2] [3] [4] [5] [6]"); } if(GetPlayerMoney(playerid) >= TICKET_PRICE) { GivePlayerMoney(playerid, -1*TICKET_PRICE); PlayerIn[playerid]=true; PlayerTickets[playerid][0]=strval(no1); PlayerTickets[playerid][1]=strval(no2); PlayerTickets[playerid][2]=strval(no3); PlayerTickets[playerid][3]=strval(no4); PlayerTickets[playerid][4]=strval(no5); PlayerTickets[playerid][5]=strval(no6); format(string, sizeof(string), "Deine Lottozahlen: %d, %d, %d, %d, %d, %d", strval(no1), strval(no2), strval(no3), strval(no4), strval(no5), strval(no6)); return SendClientMessage(playerid, COLOR_WHITE, string); } else { format(string, sizeof(string), "Du kannst dir ein Lotto Ticket (%d $) nicht Leisten", TICKET_PRICE); return SendClientMessage(playerid, COLOR_RED, string); } //return 1; } //=========================[Report Commands]===================================== if (strcmp(cmd, "/report", true) == 0) { new string2[256]; new str[256],len=9; if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_BLUE,"Server: Tippe /report [ID] [GRUND]"); return 1; } len=len+strlen(tmp); new pid=strval(tmp); if(!IsPlayerConnected(pid)) { format(string,sizeof(string),"Server: invalid player-id '%d'",pid); SendClientMessage(playerid,COLOR_BLUE,string); return 1; } tmp=strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_BLUE,"Server: Tippe /report [ID] [GRUND]"); return 1; } strmid(str,cmdtext,len,sizeof(str)); GetPlayerName(playerid,string,sizeof(string));GetPlayerName(pid,string2,sizeof(string2)); printf("BERICHT: von '%s' ID%d über '%s' ID%d",string,playerid,string2,pid); printf("GRUND: %s",str); for(new loop=0;loop>"); fwrite(f,Text2Tmp); fclose(f); print("Bug Reported to Text File"); SendClientMessage(playerid, COLOR_WHITE, "The Bug has been written to the Bug file"); return 1; } //==========================[Lock & Unlock command]============================= if (strcmp(cmd, "/lock", true) == 0) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) { for(new i=0;i 0 && playermoney >= moneys) { GivePlayerMoney(playerid, (0 - moneys)); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), " Du has %s(player: %d), $%d gesendet.", giveplayer,giveplayerid, moneys); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_GRAD1, string); format(string, sizeof(string), " Du hast $%d von %s(player: %d) erhalten.", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_GRAD1, string); format(string, sizeof(string), "%s paid $%d to %s", sendername, moneys, giveplayer); if(moneys >= 1000000) { ABroadCast(COLOR_YELLOW,string,1); } PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0); format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } else { SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount."); } } else { SendClientMessage(playerid, COLOR_GRAD1, " Du bist zu weit weg."); } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } return 1; } //========================[Id]================================================== if(strcmp(cmd, "/id", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /id [PartOfName]"); return 1; } new target; if(IsStringAName(tmp)) { target = GetPlayerID(tmp); } else { target = strval(tmp); } new sstring[256]; GetPlayerName(target, giveplayer, sizeof(giveplayer)); format(sstring, sizeof(sstring), "ID: (%d) %s",target,giveplayer); SendClientMessage(playerid, COLOR_GRAD1, sstring); return 1; } //========================[Wisper]============================================== if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)isper [playerid/PartOfName] [whisper text]"); return 1; } if(IsStringAName(tmp)) { giveplayerid = GetPlayerID(tmp); } else { giveplayerid = strval(tmp); } if (IsPlayerConnected(giveplayerid)) { if (ProxDetectorS(5.0, playerid, giveplayerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); if(giveplayerid == playerid) { format(string, sizeof(string), "* %s sagt irgendwas...", sendername); ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)isper [playerid/PartOfName] [whisper text]"); return 1; } format(string, sizeof(string), "%s whispers %s", sendername, result); SendClientMessage(playerid, COLOR_YELLOW, string); SendClientMessage(giveplayerid, COLOR_YELLOW, string); printf("%s: %s", sendername, result); return 1; } else { SendClientMessage(playerid, COLOR_GRAD1, " Your too far away."); } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } return 1; } //========================[local]=============================================== if(strcmp(cmd, "/local", true) == 0 || strcmp(cmd, "/l", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/l)ocal [local chat]"); return 1; } format(string, sizeof(string), "%s Says %s", sendername, result); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); printf("%s", string); return 1; } //========================[Shout]=============================================== if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/s)hout [local chat]"); return 1; } format(string, sizeof(string), "%s Shouts: %s!!", sendername, result); ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2); printf("%s", string); return 1; } //========================[Advertise]=========================================== if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]"); return 1; } format(string, sizeof(string), "Werbung: %s, Kontaktiere: %s ", result, sendername); SendClientMessage(playerid,COLOR_GREEN,string); printf("%s", string); return 1; } //============================[Me]============================================== if(strcmp(cmd, "/me", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [action]"); return 1; } format(string, sizeof(string), "* %s %s", sendername, result); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); return 1; } //============================[Heal]============================================ if(strcmp(cmd, "/heal", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsAtLocalToHeal(playerid)) { if(GetPlayerMoney(playerid) < 250) { SendClientMessage(playerid, COLOR_WHITE, "Das heilen kostet 250$ Du hast nicht genug Geld!"); } else { SetPlayerHealth(playerid,100.0); PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); format(string, sizeof(string), "Du wurdest geheilt"); SendClientMessage(playerid, COLOR_GREEN,string); } return 1; } } } //=========================[Akill]============================================== if(strcmp(cmd, "/akill", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /akill [playerid/PartOfName]"); return 1; } new playa; new Float:shealth; if(IsStringAName(tmp)) { playa = GetPlayerID(tmp); } else { playa = strval(tmp); } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerAdmin(playerid)) { SetPlayerHealth(playa, shealth-200); } else { SendClientMessage(playerid, COLOR_GRAD1, "you are not authorized to use that command!"); } return 1; } //=========================[Slap================================================ if(strcmp(cmd, "/slap", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [playerid]"); return 1; } new playa; new Float:shealth; new Float:slx, Float:sly, Float:slz; if(IsStringAName(tmp)) { playa = GetPlayerID(tmp); } else { playa = strval(tmp); } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerAdmin(playerid)) { GetPlayerHealth(playa, shealth); SetPlayerHealth(playa, shealth-5); GetPlayerPos(playa, slx, sly, slz); SetPlayerPos(playa, slx, sly, slz+5); format(string, sizeof(string), "AdmCmd: %s was slapped by %s",giveplayer ,sendername); SendClientMessageToAll(COLOR_RED, string); RemovePlayerFromVehicle(playa); } else { SendClientMessage(playerid, COLOR_GRAD1, "you are not authorized to use that command!"); } return 1; } //=========================[Admins]============================================= if(strcmp(cmd, "/admins", true) == 0) { new PlayerName[24]; new count = 0; SendClientMessage(playerid, COLOR_YELLOW, "Online Admins:"); for(new i=0; i= 3){printf("DEBUG ProxDetectorS()");} new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; } //=========================[ItAtLocalToHeal]==================================== public IsAtLocalToHeal(playerid) { if(IsPlayerConnected(playerid)) { if(PlayerToPoint(4.0,playerid,-3897.0706,1661.6644,12.2917)) {//In Bar near to ammuNation in LV return 1; } } return 0; } //=========================[IsStringAName]====================================== public IsStringAName(string[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { new testname[MAX_PLAYER_NAME]; GetPlayerName(i, testname, sizeof(testname)); if(strcmp(testname, string, true, strlen(string)) == 0) { return 1; } } } return 0; } //=========================[GetPlayerID]======================================== public GetPlayerID(string[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { new testname[MAX_PLAYER_NAME]; GetPlayerName(i, testname, sizeof(testname)); if(strcmp(testname, string, true, strlen(string)) == 0) { return i; } } } return INVALID_PLAYER_ID; } //=========================[TeamChat]=========================================== public OnPlayerText(playerid,text[]) { if(Mute[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Your Muted..."); return 0; } if(text[0] == '!') { new name[24], string[256]; GetPlayerName(playerid, name, 24); format(string, sizeof(string), "*Teamchat %s: %s", name, text[1]); printf("%s", string); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string); } } return 0; } return 1; } //===========================[ProxyDetectorS]=================================== public ProxDetectorS(Float:radi, playerid, targetid) { if (gdebug >= 3){printf("DEBUG ProxDetectorS()");} new Float:posx, Float:posy, Float:posz; new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); //radi = 2.0; //Trigger Radius GetPlayerPos(targetid, posx, posy, posz); tempposx = (oldposx -posx); tempposy = (oldposy -posy); tempposz = (oldposz -posz); //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; } //============================[ProxDetector]==================================== public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) { if (gdebug >= 3){printf("DEBUG ProxDetector()");} new Float:posx, Float:posy, Float:posz; new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); //radi = 2.0; //Trigger Radius for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { if(!BigEar[i]) { GetPlayerPos(i, posx, posy, posz); tempposx = (oldposx -posx); tempposy = (oldposy -posy); tempposz = (oldposz -posz); //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz); if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) { SendClientMessage(i, col1, string); } else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) { SendClientMessage(i, col2, string); } else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) { SendClientMessage(i, col3, string); } else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) { SendClientMessage(i, col4, string); } else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { SendClientMessage(i, col5, string); } } else { SendClientMessage(i, col1, string); } } } return 1; } //============================[GameModeInitExitFunc]============================ public GameModeInitExitFunc() { if (gdebug >= 1){printf("DEBUG GameModeInitExitFunc()");} new string[128]; format(string, sizeof(string), "server restarting..."); for(new i = 0; i <= MAX_PLAYERS; i++) SetTimer("GameModeExitFunc", 4000, 0); return 1; } //==============================[BroadCast]===================================== public BroadCast(color,const string[]) { printf("%s", string); SendClientMessageToAll(color, string); return 1; } //=============================[FixHour]======================================== public FixHour(hour) { //if (gdebug >= 2){printf("DEBUG FixHour(%d)",hour);} hour = timeshift+hour; if (hour < 0) { hour = hour+24; } else if (hour > 23) { hour = hour-24; } shifthour = hour; return 1; } //=========================[AdminChat]========================================== public SendAdminMessage(color, string[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && IsPlayerAdmin(i)) { SendClientMessage(i, color, string); } } }