#include #include #include #define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1 #define COLOR_SYSTEM 0xA9A9A9AA #define COLOR_INVALID 0xA52A2AAA #define COLOR_RED 0xFF0000AA #define COLOR_BLUE 0x4169FFAA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_GREEN 0x008000AA #define COLOR_LGREEN 0x7CFC00AA #define COLOR_DGREEN 0x6B8E23AA #define COLOR_PURPLE 0x800080AA #define COLOR_ORANGE 0xFFA500AA #define COLOR_RORANGE 0xFF4500AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BROWN 0xA52A2AAA #define COLOR_INVISIBLE 0xFFFFFF00 #define noadmin "(Server) You don't have any acces to admin commands" #define CP_BANK 0 #define CP_PIRATE 1 #define CP_AMMU 2 #define CP_DRAGON 3 #define CP_SEXSHOP 4 #define CP_BAR 5 #define CP_CALIGULA 6 #define CP_ZIP 7 #define CP_BINCO 8 #define CP_TATOO 9 #define CP_BOTIQUE 10 #define CP_LVAIR 11 #define CP_CPC 12 #define CP_TRUCKD 13 #define CP_SUMO 14 #define CP_GREENWOOD 15 #define CP_QUARRY 16 #define CP_CAMEALOT 17 #define CP_AUTOB 18 #define CP_PARKING 19 #define CP_FBC1 20 #define CP_ROYALC 21 #define CP_CASINO 22 #define CP_CPD 23 #define CP_TNONE 24 #define CP_TESTSTART 25 #define CP_TEST1 26 #define CP_TEST2 27 #define CP_TEST3 28 #define CP_TEST4 29 #define CP_TEST5 30 #define CP_TEST6 31 #define CP_TEST7 32 #define CP_TEST8 33 #define CP_TEST9 34 #define CP_TEST10 35 #define CP_TESTF 36 #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_LVAIR 8 #define P_CPC 9 #define P_TRUCKD 10 #define P_SUMO 11 #define P_GREENWOOD 12 #define P_QUARRY 13 #define P_CAMEALOT 14 #define P_AUTOB 15 #define P_PARKING 16 #define P_FBC1 17 #define P_ROYALC 18 #define P_CASINO 19 #define P_CPD 20 #define P_OFFSET 3 #define MAX_POINTS 24 #define TEAM_PWOMAN 0 #define TEAM_CLOWN 1 #define TEAM_MEDIC 2 #define TEAM_FIREMAN 3 #define TEAM_COP 4 #define TEAM_SWAT 5 #define TEAM_FBI 6 #define TEAM_ARMY 7 #define TEAM_CIVILIAN 8 new TestCheck[MAX_PLAYERS]; new playerCheckpoint[MAX_PLAYERS]; new Float:checkCoords[MAX_POINTS][4] = { {-36.5483,-57.9948, -17.2655,-49.2967}, //BANK {1894.6128,1445.3431, 2084.9739,1637.8186}, //PIRATE {284.0546,-86.4384, 302.9315,-56.6674}, //AMMUNATION {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 {1670.3534,1433.6586, 1721.6515,1492.0321}, //LV AIRPORT {1672.6245,1280.4144, 1746.8168,1248.3345}, //CAR PARK CONSTRUCTION {1622.0048,946.2776, 1687.8610,1045.4517}, //TRUCK DEPOT {1364.6929,1014.2826, 1410.3323,1060.7664}, //sumo company {1030.9193,1134.5171, 1070.4039,896.2406}, //green wood collegy {853.9720,848.1232, 791.3205,878.2614}, //quarry {2110.1616,1057.9301, 2262.2852,1194.5929}, //came a lot {2149.9255,1367.0885, 2248.7131,1410.7067}, //auto bahn {2242.1484,1538.5122, 2361.3853,1411.5387}, //parking {2443.7358,1946.0526, 2505.8694,1987.7587}, //final build construction 1 {2067.6843,1383.6536, 2152.8381,1515.7961}, //royal casino {1608.6100,2279.5664, 1708.8969,2245.4634}, //casino {2390.5981,1193.4138, 2431.5034,1081.3516} //CityPlanningDepartament }; new Float:checkpoints[MAX_POINTS][3] = { {-22.2549,-55.6575,1003.5469}, {2000.3132,1538.6012,13.5859}, {291.0004,-84.5168,1001.5156}, {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}, {1688.5035,1455.6910,10.7677}, {1706.7073,1262.6144,10.2405}, {1630.5184,971.9011,10.3887}, {1378.0800,1019.9922,10.3782}, {1043.8160,1014.3798,10.5687}, {822.3329,856.8933,11.4759}, {2182.6565,1116.9578,12.2226}, {2200.9426,1390.9441,10.3899}, {2301.1936,1522.0481,10.5658}, {2463.4988,1964.8777,10.5816}, {2088.1130,1450.3864,10.5519}, {1659.8761,2257.6746,10.5509}, {2420.6616,1121.7511,10.5475} }; new checkpointType[MAX_POINTS] = { CP_BANK, CP_PIRATE, CP_AMMU, CP_DRAGON, CP_SEXSHOP, CP_BAR, CP_CALIGULA, CP_ZIP, CP_BINCO, CP_TATOO, CP_BOTIQUE, CP_LVAIR, CP_CPC, CP_TRUCKD, CP_SUMO, CP_GREENWOOD, CP_QUARRY, CP_CAMEALOT, CP_AUTOB, CP_PARKING, CP_FBC1, CP_ROYALC, CP_CASINO, CP_CPD }; #define MAX_PROPERTIES 21 new propertyNames[MAX_PROPERTIES][32] = { "Four Dragons", "Sex Shop", "Shithole Bar", "Caligula", "Zip Shop", "Binco Shop", "Tatoo Parlor", "Botique", "LasVenturas Airport", "CarPark Construction", "TruckDepot", "Sumo Company", "Greenwood Collegy", "Quarry", "Came-a-lot", "Auto Bahn", "Parking", "FinalBuildConstruction", "Royal Casino", "Casino", "City Planning Departament" }; new propertyValues[MAX_PROPERTIES] = { 2000000, 1200000, 800000, 3500000, 1600000, 1100000, 750000, 500000, 4750000, 1400000, 1250000, 700000, 2200000, 3000000, 2800000, 1000000, 400000, 800000, 1400000, 1200000, 2300000 }; new propertyEarnings[MAX_PROPERTIES] = { 13500, 7630, 5340, 17600, 9005, 7000, 1000, 500, 23040,// am de setat aici , sa nu uiti cristi 10000, 8000, 750, 15000, 19000, 18000, 5000, 200, 1200, 8500, 7000, 14000 }; new propertyOwner[MAX_PROPERTIES] = {999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999}; new PLAYERLIST_authed[MAX_PLAYERS]; new internet[MAX_PLAYERS]; new gTeam[MAX_PLAYERS]; new TestCountDown[MAX_PLAYERS]; new DriverLicense[MAX_PLAYERS]; new InTest[MAX_PLAYERS]; new TestOcupied; main() { print("\n----------------------------------"); print(" RealLife RPG v0.1"); print(" Mod by: [m]yTh"); print("----------------------------------\n"); } public checkpointUpdate() { for(new i=0; i= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) { return 1; } return 0; } public getCheckpointType(playerID) { return checkpointType[playerCheckpoint[playerID]]; } public PropertyScoreUpdate() { new owners[MAX_PROPERTIES]; new payments[MAX_PROPERTIES]; for(new i=0; i < MAX_PROPERTIES; i++) owners[i]=999; for(new i=0; i < MAX_PROPERTIES; i++) { if(propertyOwner[i] < 999) { for(new j=0; j < MAX_PROPERTIES; j++) { if(owners[j]==propertyOwner[i]) { payments[j]+=propertyEarnings[i]; j = MAX_PROPERTIES; } else if (owners[j]==999) { owners[j]=propertyOwner[i]; payments[j]+=propertyEarnings[i]; j = MAX_PROPERTIES; } } } } for(new i=0; i < MAX_PROPERTIES; i++) { if(owners[i] < 999 && IsPlayerConnected(owners[i])) { new string[256]; GivePlayerMoney(owners[i], payments[i]); format(string, sizeof(string), "You earned $%d from your properties.", payments[i]); SendClientMessage(owners[i], COLOR_GREEN, string); } } } public SystemMsg(playerid,msg[]) { if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) { SendClientMessage(playerid,COLOR_SYSTEM,msg); } return 1; } public PlayerName(playerid) { new name[255]; GetPlayerName(playerid, name, 255); return name; } /* * /register password * */ dcmd_register(playerid,params[]) { // The command shouldn't work if we already are authed if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed."); // The command shouldn't work if an account with this // nick already exists if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'."); // Did he forgot the password? if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'"); // We save the money to the accstate if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now."); 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,"Already authed."); // The command shouldn't work if an account with this // nick does not exists if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'."); // Did he forgot the password? if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'"); if (udb_CheckLogin(PlayerName(playerid),params)) { // Login was correct // Following thing is the same like the missing SetPlayerCommand GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid)); PLAYERLIST_authed[playerid]=true; SetPlayerInterior(playerid,0); SetPlayerPos(playerid, 1675.6902,1447.9316,10.7867); return SystemMsg(playerid,"Successfully authed!"); } else { // Login was incorrect return SystemMsg(playerid,"Login failed!"); } return true; } public PayCheck() { for(new i=0; i 149999){ GivePlayerMoney(i, -150000); SendClientMessage(i, COLOR_SYSTEM, "Internet: -150.000$"); } if(GetPlayerMoney(i) < 150000){ internet[i] = 0; SendClientMessage(i, COLOR_SYSTEM, "Internet: Disconnected");} } }}} public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamForClass(playerid, classid); SetPlayerPos(playerid, -1832.5068,17.6917,1061.1436); SetPlayerCameraPos(playerid, -1831.1571,15.1606,1061.1436); SetPlayerCameraLookAt(playerid, -1832.5068,17.6917,1061.1436); SetPlayerInterior(playerid, 14); SetPlayerFacingAngle(playerid, 203.3515); switch (classid) { case 0: { GameTextForPlayer(playerid, "~w~President Woman", 1000, 3); } case 1: { GameTextForPlayer(playerid, "~r~~h~Clown", 1000, 3); } case 2,3,4: { GameTextForPlayer(playerid, "~g~~h~~h~Medic", 1000, 3); } case 5,6,7: { GameTextForPlayer(playerid, "~r~Fireman", 1000, 3); } case 8,9,10,11,12: { GameTextForPlayer(playerid, "~b~~h~Police", 1000, 3); } case 13: { GameTextForPlayer(playerid, "~b~S.W.A.T", 1000, 3); } case 14: { GameTextForPlayer(playerid, "~y~~h~FBI", 1000, 3); } case 15: { GameTextForPlayer(playerid, "~g~Army", 1000, 3); } } if(gTeam[playerid] == TEAM_CIVILIAN){ GameTextForPlayer(playerid, "~w~Civilian", 1000, 3); } return 1; } public OnGameModeExit() { return 1; } public SetPlayerTeamForClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = TEAM_PWOMAN; } else if(classid == 1){ gTeam[playerid] = TEAM_CLOWN; } else if(classid == 2 || classid == 3 || classid == 4){ gTeam[playerid] = TEAM_MEDIC; } else if(classid == 5 || classid == 6 || classid == 7){ gTeam[playerid] = TEAM_FIREMAN; } else if(classid == 8 || classid == 9 || classid == 10 || classid == 11 || classid == 12){ gTeam[playerid] = TEAM_COP; } else if(classid == 13){ gTeam[playerid] = TEAM_SWAT; } else if(classid == 14){ gTeam[playerid] = TEAM_FBI; } else if(classid == 15){ gTeam[playerid] = TEAM_ARMY; } else if(classid > 15 && classid < 289){ gTeam[playerid] = TEAM_CIVILIAN; } } public OnPlayerConnect(playerid) { GameTextForPlayer(playerid, "~g~~h~~h~Real Life ~w~RPG ~n~ ~y~~h~Mod created by ~p~~h~~h~[m]yTh", 3000, 6); PLAYERLIST_authed[playerid]=false; return false; } public OnPlayerDisconnect(playerid) { if (PLAYERLIST_authed[playerid]) { // Was loggedin, so save the data! dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid)); } PLAYERLIST_authed[playerid]=false; return false; } public OnPlayerSpawn(playerid) { if (PLAYERLIST_authed[playerid]) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid, 1675.6902,1447.9316,10.7867); new pname[24]; GetPlayerName(playerid, pname, 24); if(strcmp(pname, "[m]yTh", true) == 0){ SetPlayerPos(playerid,1992.5662,2761.2993,10.8203); SetPlayerInterior(playerid,0); GameTextForPlayer(playerid, "~w~[m]yTh ~p~~h~~h~house", 3000, 6);} } else if (!PLAYERLIST_authed[playerid]) { SendClientMessage(playerid,COLOR_INVALID,"(Server) You arent logged in, type /login or /register"); SetPlayerPos(playerid,-2158.72,641.29,1052.38); SetPlayerInterior(playerid, 1); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason); return 1; } public OnVehicleSpawn(vehicleid) { printf("OnVehicleSpawn(%d)", vehicleid); return 1; } public OnVehicleDeath(vehicleid, killerid) { printf("OnVehicleDeath(%d, %d)", vehicleid, killerid); return 1; } public OnPlayerText(playerid) { printf("OnPlayerText(%d)", playerid); return 1; } public OnPlayerCommandText(playerid,cmdtext[]) { dcmd(login,5,cmdtext); // because login has 5 characters dcmd(register,8,cmdtext); // because register has 8 characters if (PLAYERLIST_authed[playerid]) {//daca e logat if(strcmp(cmdtext, "/help", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " Welcome to "); SendClientMessage(playerid, COLOR_YELLOW, " RolePlay LasVenturas "); SendClientMessage(playerid, COLOR_YELLOW, " v0.1 "); SendClientMessage(playerid, COLOR_YELLOW, " "); SendClientMessage(playerid, COLOR_YELLOW, "If you don't know how to play this mode watch here , is very simple"); SendClientMessage(playerid, COLOR_YELLOW, "First you can do some mission or loan money and next buy some properties"); SendClientMessage(playerid, COLOR_YELLOW, "You can buy properties but you can buy a whole bussines"); SendClientMessage(playerid, COLOR_YELLOW, "There are a lot of ways to do money ,you don't need to beg or kill for it"); SendClientMessage(playerid, COLOR_YELLOW, "The wanted system will jail you if you do illegal actions, Good Play!"); SendClientMessage(playerid, COLOR_DGREEN, "Type /commands for commands and respect the /rules and game /laws"); } if(strcmp(cmdtext, "/rules", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " RolePlay LasVenturas "); SendClientMessage(playerid, COLOR_BROWN, " RULES "); SendClientMessage(playerid, COLOR_YELLOW, " "); SendClientMessage(playerid, COLOR_BROWN, "As I say in /help , its easy to do money, do not use money or other cheats"); SendClientMessage(playerid, COLOR_YELLOW, "Respect the RolePlayGame and respect other people and him will respect you"); SendClientMessage(playerid, COLOR_YELLOW, "Dont abuse the commands or bugs or you will be banned, you can report it"); SendClientMessage(playerid, COLOR_YELLOW, "Bugs report, if you found a bug report it to admin or to yahoo id: cristi_buc93"); SendClientMessage(playerid, COLOR_YELLOW, "Do not buy someone's property without their permission"); SendClientMessage(playerid, COLOR_DGREEN, "And I say it again, DO NOT USE CHEATS !!!"); SendClientMessage(playerid, COLOR_YELLOW, "Good Play!"); } if(strcmp(cmdtext, "/laws", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " RolePlay LasVenturas "); SendClientMessage(playerid, COLOR_BROWN, " Game Laws "); SendClientMessage(playerid, COLOR_YELLOW, " "); SendClientMessage(playerid, COLOR_BROWN, "Do not kill someone or you will be jailed, you can report killer to admin"); SendClientMessage(playerid, COLOR_YELLOW, "Do not steal someone car, you can sent a sms to taxi to take you"); SendClientMessage(playerid, COLOR_YELLOW, "To can drive you need license, you need to get your /driverlicense"); SendClientMessage(playerid, COLOR_YELLOW, "For other cars you need /pilotlicense , /motorlicense or /boatlicense"); SendClientMessage(playerid, COLOR_YELLOW, "Drive safety and dont ram other player cars, rammer can be reported to police"); SendClientMessage(playerid, COLOR_DGREEN, "And dont forgot to loan money from CityPlanningDepartament"); SendClientMessage(playerid, COLOR_YELLOW, "You dont need to beg, loan or do mission for money"); } if(strcmp(cmdtext, "/commands", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " RolePlay LasVenturas "); SendClientMessage(playerid, COLOR_GREEN, " Game Commands "); SendClientMessage(playerid, COLOR_YELLOW, " "); SendClientMessage(playerid, COLOR_WHITE, "Account: /login [password] , /register [password]"); SendClientMessage(playerid, COLOR_YELLOW, "Info: /help , /rules , /laws"); SendClientMessage(playerid, COLOR_YELLOW, "License:"); SendClientMessage(playerid, COLOR_YELLOW, "Other: "); SendClientMessage(playerid, COLOR_YELLOW, "Offert's:"); SendClientMessage(playerid, COLOR_DGREEN, "Bank:"); SendClientMessage(playerid, COLOR_YELLOW, "More commands soon!"); } if(strcmp(cmdtext, "/internet", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " Internet Offer Info "); SendClientMessage(playerid, COLOR_GREEN, " (type /cnet or /dnet) "); SendClientMessage(playerid, COLOR_YELLOW, " "); if(internet[playerid] == 0){ SendClientMessage(playerid, COLOR_YELLOW, "CityPlanningDepartament offer you internet for 500.000$"); SendClientMessage(playerid, COLOR_YELLOW, "You will pay 150.000$ regulary, but if you dont have enought money"); SendClientMessage(playerid, COLOR_YELLOW, "You will be disconnected. Type /cnet to connect, 500.000$ connect"); } else if(internet[playerid] == 1){ SendClientMessage(playerid, COLOR_YELLOW, "CityPlanningDepartament Internet Offer"); SendClientMessage(playerid, COLOR_YELLOW, "You have more commands to use with internet"); SendClientMessage(playerid, COLOR_YELLOW, "If you want to disconnect type /dnet"); SendClientMessage(playerid, COLOR_YELLOW, "NewCommands:"); } } if(strcmp(cmdtext, "/cnet", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " Internet Offer Info "); SendClientMessage(playerid, COLOR_YELLOW, " Connecting "); if(internet[playerid] == 0){ if(GetPlayerMoney(playerid) > 499999){ SendClientMessage(playerid, COLOR_YELLOW, "Now you are connected to internet"); new string[256]; new pname[256]; GetPlayerName(playerid, pname, 256); format(string,sizeof(string),"~g~%s ~y~~h~~h~connected to internet", pname); GameTextForAll(string, 3000, 6); } else if(GetPlayerMoney(playerid) < 500000){ SendClientMessage(playerid, COLOR_INVALID, "(Server) You dont have enough money to connect to internet"); } } else if(internet[playerid] == 1){ SendClientMessage(playerid, COLOR_YELLOW, "You all ready connected to internet"); SendClientMessage(playerid, COLOR_YELLOW, "--------------------------------------------"); SendClientMessage(playerid, COLOR_YELLOW, "You have more commands to use with internet"); SendClientMessage(playerid, COLOR_YELLOW, "If you want to disconnect type /dnet"); SendClientMessage(playerid, COLOR_YELLOW, "NewCommands:"); } } if(strcmp(cmdtext, "/dnet", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, " Internet Offer Info "); SendClientMessage(playerid, COLOR_YELLOW, " Disconnecting "); if(internet[playerid] == 1){ SendClientMessage(playerid, COLOR_YELLOW, "You are now disconnected from internet"); new string[256]; new pname[256]; GetPlayerName(playerid, pname, 256); format(string,sizeof(string),"~r~%s ~y~~h~~h~disconnected from internet", pname); GameTextForAll(string, 3000, 6); } else if(internet[playerid] == 0){ SendClientMessage(playerid, COLOR_YELLOW, "You are not connected to internet"); } } if(strcmp(cmdtext, "/buy", true) == 0) { new property=999; //new playerCheckpoint[MAX_PLAYERS]; new giveplayer[MAX_PLAYERS]; if(IsPlayerInCheckpoint(playerid)) { switch (playerCheckpoint[playerid]) { case CP_DRAGON:{ property = P_DRAGON; } case CP_SEXSHOP:{ property = P_SEXSHOP; } case CP_BAR:{ property = P_BAR; } case CP_CALIGULA:{ property = P_CALIGULA; } case CP_ZIP:{ property = P_ZIP; } case CP_BINCO:{ property = P_BINCO; } case CP_TATOO:{ property = P_TATOO; } case CP_BOTIQUE:{ property = P_BOTIQUE; } case CP_LVAIR:{ property = P_LVAIR; } case CP_CPC:{ property = P_CPC; } case CP_TRUCKD:{ property = P_TRUCKD; } case CP_SUMO:{ property = P_SUMO; } case CP_GREENWOOD:{ property = P_GREENWOOD; } case CP_QUARRY:{ property = P_QUARRY; } case CP_CAMEALOT:{ property = P_CAMEALOT; } case CP_AUTOB:{ property = P_AUTOB; } case CP_PARKING:{ property = P_PARKING; } case CP_FBC1:{ property = P_FBC1; } case CP_ROYALC:{ property = P_ROYALC; } case CP_CASINO:{ property = P_CASINO; } case CP_CPD:{ property = P_CPD; } } if(property==999) { SendClientMessage(playerid, COLOR_YELLOW, "[PROP] You need to be in a property checkpoint to /buy it."); return 1; } // property--; if(GetPlayerMoney(playerid) < propertyValues[property]) { SendClientMessage(playerid, COLOR_INVALID, "[PROP] You don't have enough money to buy this property."); return 1; } if(propertyOwner[property]==playerid) { SendClientMessage(playerid, COLOR_INVALID, "[PROP] You already own this property."); return 1; } if(propertyOwner[property] < 999) { new string[256]; GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); GivePlayerMoney(propertyOwner[property], propertyValues[property]); format (string, sizeof(string), "[PROP] Your property, the %s, has been bought out by %s (id: %d).",propertyNames[property],giveplayer,playerid); SendClientMessage(propertyOwner[property], COLOR_RED, string); } GivePlayerMoney(playerid, 0-propertyValues[property]); propertyOwner[property]=playerid; new string[256]; format(string, sizeof(string), "[PROP] You have purchased the %s!", propertyNames[property]); SendClientMessage(playerid, COLOR_GREEN, string); } else { SendClientMessage(playerid, COLOR_YELLOW, "[PROP] You need to be in a property checkpoint to /buy it."); return 1; } return 1; } dcmd(adminsay,8,cmdtext); //dcmd(kick,4,cmdtext); if(strcmp(cmdtext, "/driverlicense", true) == 0) { if(InTest[playerid] == 1){ SendClientMessage(playerid, COLOR_INVALID, "[Info] You are allready in test"); } if(DriverLicense[playerid] == 1){ SendClientMessage(playerid, COLOR_INVALID, "[Info] You have allready the license"); } if(TestOcupied == 1){ SendClientMessage(playerid, COLOR_INVALID, "[Info] Someone is doing this test"); } else if(InTest[playerid] == 0 || DriverLicense[playerid] == 0 || TestOcupied == 0){ SendClientMessage(playerid, COLOR_YELLOW,"[Info] You can start the test, follow the checkpoints"); SetPlayerPos(playerid, 709.5930,1202.8737,13.1765); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 720.0862,1192.0665,13.1717, 3.0); TestCheck[playerid] = CP_TESTSTART; } } } else if (!PLAYERLIST_authed[playerid]) {//daca nu e logat SendClientMessage(playerid,COLOR_INVALID,"(Server) Your arent logged in , type /login"); } return 1; } dcmd_adminsay(const playerid,const params[]) { if(IsPlayerAdmin(playerid)){ new string[256]; new pname[256]; GetPlayerName(playerid, pname, 256); format(string, sizeof(string), "(Admin:%s) %s",pname,params); SendClientMessageToAll(COLOR_RORANGE, string); } else if(!IsPlayerAdmin(playerid)){ SendClientMessage(playerid, COLOR_BROWN, noadmin); } return true; } /* dcmd_kick(const playerid,const params[]) { new string2[256]; new pname[256]; new aname[256]; kickedid = params; GetPlayerName(kickedid, pname, 256); GetPlayerName(playerid, aname, 256); format(string2, sizeof(string2), "Admin %s kicked %s(id:%d)",aname,pname,params); SendClientMessageToAll(COLOR_BROWN, string2); Kick(kickedid); kickedid = 999; return true; }*/ public OnPlayerInfoChange(playerid) { printf("OnPlayerInfoChange(%d)"); return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger); return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate); return 1; } public OnPlayerEnterCheckpoint(playerid) { new string[256]; new ownplayer[256]; if(getCheckpointType(playerid)>= P_OFFSET) { format(string, sizeof(string), "[PROP] 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), "[PROP] You will earn $%d regularly.", propertyEarnings[playerCheckpoint[playerid]-P_OFFSET]); SendClientMessage(playerid, COLOR_YELLOW, string); if(propertyOwner[playerCheckpoint[playerid]-P_OFFSET]<999) { GetPlayerName(propertyOwner[playerCheckpoint[playerid]-P_OFFSET], ownplayer, sizeof(ownplayer)); format(string, sizeof(string), "[PROP] This property is currently owned by %s.", ownplayer); SendClientMessage(playerid, COLOR_RED, string); } } switch (TestCheck[playerid]) { case CP_TESTSTART: { if(IsPlayerInVehicle(playerid, 0)){ TestCountDown[playerid] = 1; SetTimer("CountDown",10000,0); DisablePlayerCheckpoint(playerid); TestCheck[playerid] = CP_TNONE; DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_YELLOW, "[Info] Get in car and wait for countdown"); SendClientMessage(playerid, COLOR_YELLOW, "[Info] You have 60 seconds to finnish the test or you lose"); } else if(!IsPlayerInVehicle(playerid, 0)){ SendClientMessage(playerid, COLOR_INVALID, "[Info] Get in car"); } } case CP_TEST1: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 503.4422,1124.6527,13.8432, 5.0); TestCheck[playerid] = CP_TEST2; } case CP_TEST2: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 449.2877,1161.7749,8.3736, 5.0); TestCheck[playerid] = CP_TEST3; } case CP_TEST3: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 226.7989,977.8892,28.0028, 5.0); TestCheck[playerid] = CP_TEST4; } case CP_TEST4: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 340.4018,1360.4813,7.7528, 5.0); TestCheck[playerid] = CP_TEST5; } case CP_TEST5: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 623.4115,1374.3521,11.7081, 5.0); TestCheck[playerid] = CP_TEST6; } case CP_TEST6: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 427.4626,1321.3295,14.4833, 5.0); } case CP_TEST7: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 336.0108,1361.1046,7.7344, 5.0); TestCheck[playerid] = CP_TEST8; } case CP_TEST8: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 230.1980,977.7343,27.9811, 5.0); TestCheck[playerid] = CP_TEST9; } case CP_TEST9: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 451.0081,1164.2603,8.3540, 5.0); TestCheck[playerid] = CP_TEST10; } case CP_TEST10: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 718.5392,1192.5576,13.1709, 5.0); TestCheck[playerid] = CP_TESTF; } case CP_TESTF: { TestCheck[playerid] = CP_TNONE; DisablePlayerCheckpoint(playerid); LicenseGet(playerid); } } return 1; } /* new TestCheck[MAX_PLAYERS]; new Float:testCoords[12][3] = { {720.0862,1192.0665,13.1717}, // test check start {712.0303,1150.8950,18.5105}, //cp1 {503.4422,1124.6527,13.8432},//cp2 {449.2877,1161.7749,8.3736},//cp3 {226.7989,977.8892,28.0028},//cp4 {340.4018,1360.4813,7.7528},//cp5 {623.4115,1374.3521,11.7081},//cp6 {427.4626,1321.3295,14.4833},//cp7 {336.0108,1361.1046,7.7344},//cp8 {230.1980,977.7343,27.9811},//cp9 {451.0081,1164.2603,8.3540},//cp10 {718.5392,1192.5576,13.1709}//cp finnish }; */ public LicenseGet(playerid){ new vehicleid = GetPlayerVehicleID(playerid); SendClientMessage(playerid, COLOR_YELLOW, "[Info] You completed the test, here is your driver license"); SetVehicleToRespawn(vehicleid); DriverLicense[playerid] = 1; InTest[playerid] = 0; TestOcupied = 0; KillTimer(playerid); SpawnPlayer(playerid); } public LicenseLost(playerid){ new vehicleid = GetPlayerVehicleID(playerid); SendClientMessage(playerid, COLOR_INVALID, "[Info] You losed the test"); SetVehicleToRespawn(vehicleid); DriverLicense[playerid] = 0; InTest[playerid] = 0; TestOcupied = 0; KillTimer(playerid); SpawnPlayer(playerid); } public CountDown(){ for(new i=0; i AddStaticVehicle(535,1997.4600,2762.3098,10.5513,179.4449,0,0); // AbysCar AddStaticVehicle(522,660.0554,1719.1187,6.5642,12.7699,8,82); // AddStaticVehicle(567,711.4207,1947.5208,5.4056,179.3810,90,96); // AddStaticVehicle(567,1031.8435,1920.3726,11.3369,89.4978,97,96); // AddStaticVehicle(567,1112.3754,1747.8737,10.6923,270.9278,102,114); // AddStaticVehicle(567,1641.6802,1299.2113,10.6869,271.4891,97,96); // AddStaticVehicle(567,2135.8757,1408.4512,10.6867,180.4562,90,96); // AddStaticVehicle(567,2262.2639,1469.2202,14.9177,91.1919,99,81); // AddStaticVehicle(567,2461.7380,1345.5385,10.6975,0.9317,114,1); // AddStaticVehicle(567,2804.4365,1332.5348,10.6283,271.7682,88,64); // AddStaticVehicle(560,2805.1685,1361.4004,10.4548,270.2340,17,1); // AddStaticVehicle(506,2853.5378,1361.4677,10.5149,269.6648,7,7); // AddStaticVehicle(567,2633.9832,2205.7061,10.6868,180.0076,93,64); // AddStaticVehicle(567,2119.9751,2049.3127,10.5423,180.1963,93,64); // AddStaticVehicle(567,2785.0261,-1835.0374,9.6874,226.9852,93,64); // AddStaticVehicle(567,2787.8975,-1876.2583,9.6966,0.5804,99,81); // AddStaticVehicle(411,2771.2993,-1841.5620,9.4870,20.7678,116,1); // AddStaticVehicle(420,1713.9319,1467.8354,10.5219,342.8006,6,1); // taxi return 1; }