Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include "../include/gl_common.inc"
- #include <streamer>
- #include <YSI\y_ini>
- #define TEAM_GROVE 1
- #define TEAM_BALLAS 2
- #define TEAM_POLICE 3
- #define TEAM_GROVE_COLOR 0x00FF00AA
- #define TEAM_BALLAS_COLOR 0xFF00FFAA
- #define TEAM_POLICE_COLOR 0x0000FFAA
- #define OCCUPATION_GANGSTER 1
- #define OCCUPATION_STREETCOP 2
- #define OCCUPATION_BIKERCOP 3
- #define OCCUPATION_SWAT 4
- #define OCCUPATION_AIRSUPPORT 5
- #define DIALOG_NOTENOUGHMONEY 1
- #define DIALOG_RULES 2
- #define DIALOG_REGISTER 3
- #define DIALOG_LOGIN 4
- #define SHOP_CARSHOP 5
- #define SHOP_JETPACKANDPARACHUTESHOP 6
- #define SHOP_AIRCRAFTSHOP 7
- #define SHOP_HEAVYWEAPONSSHOP 8
- new total_vehicles_from_files=0;
- new Team[MAX_PLAYERS], Occupation[MAX_PLAYERS];
- new Shop[4], CarSpawner[4];
- new CarSpawnerCar[MAX_VEHICLES];
- new NextCarSpawnerCar;
- new CarShopCar[MAX_PLAYERS], AircraftShopVehicle[MAX_PLAYERS];
- new iniplayermoney, iniplayerscore;
- new iniplayerpassword[100];
- new rulesnotaccepted;
- new Class[MAX_PLAYERS];
- new CarSpawnsLeft[MAX_PLAYERS];
- new Registered;
- main()
- {
- print("\n----------------------------------");
- print(" Sydcul's roleplay");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Sydcul's roleplay");
- SendRconCommand("mapname Los Santos");
- AddPlayerClass(105, 2512.0581, -1672.3823, 13.4813, 66.2349, WEAPON_KNIFE, 1, WEAPON_COLT45, 200, WEAPON_TEC9, 400); //0 - Grove 1
- AddPlayerClass(106, 2512.0581, -1672.3823, 13.4813, 66.2349, WEAPON_KNIFE, 1, WEAPON_COLT45, 200, WEAPON_TEC9, 400); //1 - Grove 2
- AddPlayerClass(107, 2512.0581, -1672.3823, 13.4813, 66.2349, WEAPON_KNIFE, 1, WEAPON_COLT45, 200, WEAPON_TEC9, 400); //2 - Grove 3
- AddPlayerClass(102, 2172.8787, -1672.7426, 15.0859, 286.4139, WEAPON_BAT, 1, WEAPON_COLT45, 200, WEAPON_UZI, 400); //3 - Ballas 1
- AddPlayerClass(103, 2172.8787, -1672.7426, 15.0859, 286.4139, WEAPON_BAT, 1, WEAPON_COLT45, 200, WEAPON_UZI, 400); //4 - Ballas 2
- AddPlayerClass(104, 2172.8787, -1672.7426, 15.0859, 286.4139, WEAPON_BAT, 1, WEAPON_COLT45, 200, WEAPON_UZI, 400); //5 - Ballas 3
- AddPlayerClass(280, 1549.5518, -1675.3184, 15.0135,90.7510, WEAPON_NITESTICK, 1, WEAPON_COLT45, 200, WEAPON_SHOTGUN, 20); //6 - Street cop
- AddPlayerClass(284, 1549.5518, -1675.3184, 15.0135,90.7510, WEAPON_NITESTICK, 1, WEAPON_COLT45, 200, WEAPON_UZI, 400); //7 - Biker cop
- AddPlayerClass(285, 1549.5518, -1675.3184, 15.0135,90.7510, WEAPON_NITESTICK, 1, WEAPON_MP5, 400, WEAPON_SHOTGSPA, 20); //8 - SWAT
- AddPlayerClass(71,1579.9401,-1635.3022,13.5609,117.3636, WEAPON_NITESTICK, 1, WEAPON_COLT45, 200, WEAPON_SHOTGUN, 20); // 9 - Air support
- total_vehicles_from_files += LoadStaticVehiclesFromFile("sydculsroleplay/vehicles.txt");
- return 1;
- }
- public OnGameModeExit() {
- for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
- {
- new playername[MAX_PLAYER_NAME+1], filename[28+MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(filename, sizeof(filename), "sydculsroleplay/players/%s.ini", playername);
- new INI:iniFile = INI_Open(filename);
- INI_SetTag(iniFile, "playerdata");
- INI_WriteInt(iniFile, "money", GetPlayerMoney(playerid));
- INI_WriteInt(iniFile, "score", GetPlayerScore(playerid));
- INI_Close(iniFile);
- }
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 2121.7322, -1623.2563, 26.8368);
- SetPlayerFacingAngle(playerid, 60.2360);
- SetPlayerCameraPos(playerid, 2111.9089 ,-1623.7340, 24.2307);
- SetPlayerCameraLookAt(playerid, 2121.7322, -1623.2563, 26.8368);
- switch(classid)
- {
- case 0,1,2:
- {
- GameTextForPlayer(playerid, "~g~GROVE~w~", 3000, 5);
- Team[playerid] = TEAM_GROVE;
- Occupation[playerid] = OCCUPATION_GANGSTER;
- Class[playerid] = classid;
- }
- case 3,4,5:
- {
- GameTextForPlayer(playerid, "~p~BALLAS~w~", 3000, 5);
- Team[playerid] = TEAM_BALLAS;
- Occupation[playerid] = OCCUPATION_GANGSTER;
- Class[playerid] = classid;
- }
- case 6:
- {
- GameTextForPlayer(playerid, "~b~STREET COP~w~", 3000, 5);
- Team[playerid] = TEAM_POLICE;
- Occupation[playerid] = OCCUPATION_STREETCOP;
- Class[playerid] = classid;
- }
- case 7:
- {
- GameTextForPlayer(playerid, "~b~BIKER COP~w~", 3000, 5);
- Team[playerid] = TEAM_POLICE;
- Occupation[playerid] = OCCUPATION_BIKERCOP;
- Class[playerid] = classid;
- }
- case 8:
- {
- GameTextForPlayer(playerid, "~b~SWAT~w~", 3000, 5);
- Team[playerid] = TEAM_POLICE;
- Occupation[playerid] = OCCUPATION_SWAT;
- Class[playerid] = classid;
- }
- case 9:
- {
- GameTextForPlayer(playerid, "~b~AIR SUPPORT~w~", 3000, 5);
- Team[playerid] = TEAM_POLICE;
- Occupation[playerid] = OCCUPATION_AIRSUPPORT;
- Class[playerid] = classid;
- }
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- switch(Class[playerid])
- {
- case 6:
- {
- new playerscore;
- playerscore = GetPlayerScore(playerid);
- if (playerscore<10) {
- GameTextForPlayer(playerid, "~r~This class is available when you have a score of at least 10~w~", 3000, 5);
- return 0;
- }
- }
- case 7:
- {
- new playerscore;
- playerscore = GetPlayerScore(playerid);
- if (playerscore<15) {
- GameTextForPlayer(playerid, "~r~This class is available when you have a score of at least 15~w~", 3000, 5);
- return 0;
- }
- }
- case 8:
- {
- new playerscore;
- playerscore = GetPlayerScore(playerid);
- if (playerscore<30) {
- GameTextForPlayer(playerid, "~r~This class is available when you have a score of at least 30~w~", 3000, 5);
- return 0;
- }
- }
- case 9:
- {
- new playerscore;
- playerscore = GetPlayerScore(playerid);
- if (playerscore<20) {
- GameTextForPlayer(playerid, "~r~This class is available when you have a score of at least 20~w~", 3000, 5);
- return 0;
- }
- }
- }
- return 1;
- }
- SetPlayerToTeamColor(playerid)
- {
- if (Team[playerid] == TEAM_GROVE)
- {
- SetPlayerColor(playerid, TEAM_GROVE_COLOR);
- }
- if (Team[playerid] == TEAM_BALLAS)
- {
- SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
- }
- if (Team[playerid] == TEAM_POLICE)
- {
- SetPlayerColor(playerid, TEAM_POLICE_COLOR);
- }
- }
- forward ini_playerdata(name[], value[]);
- public ini_playerdata(name[], value[])
- {
- INI_Int("money", iniplayermoney);
- INI_Int("score", iniplayerscore);
- return 1;
- }
- forward ini_logindata(name[], value[]);
- public ini_logindata(name[], value[])
- {
- INI_String("password", iniplayerpassword, sizeof(iniplayerpassword));
- Registered = 1;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Registered = 0;
- new playername[MAX_PLAYER_NAME+1], filename[28+MAX_PLAYER_NAME];
- rulesnotaccepted = 0;
- GetPlayerName(playerid, playername, sizeof(playername));
- format(filename, sizeof(filename), "sydculsroleplay/players/%s.ini", playername);
- if(!fexist(filename))
- {
- ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Welcome!", "Welcome to Sydcul's roleplay!\nYou can do pretty much everything you want here, but there are some rules!\n\n1. No cheating/hacking\n2. No spawnkilling/trolling\n3. Behave like a normal human being and use your brains!\n\nDo you accept these rules?", "No", "Yes");
- } else {
- INI_ParseFile(filename, "ini_%s");
- if (Registered == 0) {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "To prevent other people using your account, you will have to password protect it.\nPlease enter the password you want to use:", "Login", "Cancel");
- } else {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Please enter your password:", "Login", "Cancel");
- }
- GivePlayerMoney(playerid, iniplayermoney);
- SetPlayerScore(playerid, iniplayerscore);
- }
- CarShopCar[playerid] = -1;
- AircraftShopVehicle[playerid] = -1;
- CarSpawnsLeft[playerid] = 3;
- SendDeathMessage(INVALID_PLAYER_ID, playerid, 200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if (rulesnotaccepted==0) {
- new playername[MAX_PLAYER_NAME+1], filename[28+MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(filename, sizeof(filename), "sydculsroleplay/players/%s.ini", playername);
- new INI:iniFile = INI_Open(filename);
- INI_SetTag(iniFile, "playerdata");
- INI_WriteInt(iniFile, "money", GetPlayerMoney(playerid));
- INI_WriteInt(iniFile, "score", GetPlayerScore(playerid));
- INI_Close(iniFile);
- }
- SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerToTeamColor(playerid);
- SetPlayerMapIcon(playerid, 0, 2512.0581,-1672.3823,13.4813, 62, 0, MAPICON_GLOBAL); //Grove
- SetPlayerMapIcon(playerid, 1, 2172.8787,-1672.7426,15.0859, 59, 0, MAPICON_GLOBAL); //Ballas
- SetPlayerMapIcon(playerid, 2, 1549.5518,-1675.3184,15.0135, 30, 0, MAPICON_GLOBAL); //Police
- Shop[0] = CreateDynamicCP(1772.1460,-1929.1642,13.5534, 2, -1, -1, -1, 100); //Car shop
- SetPlayerMapIcon(playerid, 3, 1772.1460,-1929.1642,13.5534, 55, 0, MAPICON_GLOBAL);
- Shop[1] = CreateDynamicCP(1954.6067,-2188.5210,13.5469, 2, -1, -1, -1, 100); //Jetpack and parachute shop
- SetPlayerMapIcon(playerid, 4, 1954.6067,-2188.5210,13.5469, 5, 0, MAPICON_GLOBAL);
- Shop[2] = CreateDynamicCP(1683.3267,-2638.3318,13.5469, 2, -1, -1, -1, 100); //Aircraft shop
- SetPlayerMapIcon(playerid, 5, 1683.3267,-2638.3318,13.5469, 5, 0, MAPICON_GLOBAL);
- Shop[3] = CreateDynamicCP(2444.6648,-1975.5310,13.5469, 2, -1, -1, -1, 100); //Heavy weapons shop
- SetPlayerMapIcon(playerid, 6, 2444.6648,-1975.5310,13.5469, 18, 0, MAPICON_GLOBAL);
- CarSpawner[0] = CreateDynamicCP(2524.7244,-1668.8529,15.0670, 2, -1, -1, -1, 100); //Grove carspawner
- CarSpawner[1] = CreateDynamicCP(2175.3210,-1667.7389,15.0859, 2, -1, -1, -1, 100); //Ballas carspawner
- CarSpawner[2] = CreateDynamicCP(1547.9329,-1669.3354,13.5673, 2, -1, -1, -1, 100); //Police carspawner
- CarSpawner[3] = CreateDynamicCP(1550.7395,-1615.7549,13.3828, 2, -1, -1, -1, 100); //Police helispawner
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid == INVALID_PLAYER_ID) {
- SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
- SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
- } else if(Team[killerid] == Team[playerid]) {
- GivePlayerMoney(playerid, 100);
- SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
- GivePlayerMoney(killerid, -50);
- SendDeathMessage(killerid,playerid,reason);
- } else {
- SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- GivePlayerMoney(killerid, 100);
- }
- CarSpawnsLeft[playerid] = 3;
- return 1;
- }
- public OnPlayerEnterDynamicCP(playerid, checkpointid)
- {
- if(checkpointid == Shop[0]) //Car shop
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- ShowPlayerDialog(playerid, SHOP_CARSHOP, DIALOG_STYLE_LIST, "Car shop", "Infernus ($250)\nTurismo ($350)", "Buy", "Cancel");
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use this shop!");
- }
- }
- if(checkpointid == Shop[1]) //Jetpack and parachute shop
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- ShowPlayerDialog(playerid, SHOP_JETPACKANDPARACHUTESHOP, DIALOG_STYLE_LIST, "Jetpack and parachute shop", "Jetpack ($300)\nParachute ($50)", "Buy", "Cancel");
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use this shop!");
- }
- }
- if(checkpointid == Shop[2]) //Aircraft shop
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- ShowPlayerDialog(playerid, SHOP_AIRCRAFTSHOP, DIALOG_STYLE_LIST, "Aircraft shop", "Hydra ($500)\nHunter ($600)", "Buy", "Cancel");
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use this shop!");
- }
- }
- if(checkpointid == Shop[3]) //Heavy weapons shop
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- ShowPlayerDialog(playerid, SHOP_HEAVYWEAPONSSHOP, DIALOG_STYLE_LIST, "Heavy weapons shop", "Minigun ($800)\nRPG ($400)\nFlamethrower ($200)", "Buy", "Cancel");
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use this shop!");
- }
- }
- if(checkpointid == CarSpawner[0]) //Grove carspawner
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- if (Team[playerid] == TEAM_GROVE)
- {
- if(CarSpawnsLeft[playerid] > 0) {
- switch(Occupation[playerid])
- {
- case OCCUPATION_GANGSTER:
- {
- CarSpawnerCar[NextCarSpawnerCar] = CreateVehicle(492,2509.0259,-1665.4360,13.2234,35.5265,-1,-1,-1);
- NextCarSpawnerCar = NextCarSpawnerCar++;
- CarSpawnsLeft[playerid] = CarSpawnsLeft[playerid]-1;
- }
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You don't have any carspawns left for your current life.");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your team!");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use the carspawner!");
- }
- }
- if(checkpointid == CarSpawner[1]) //Ballas carspawner
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- if (Team[playerid] == TEAM_BALLAS)
- {
- if(CarSpawnsLeft[playerid] > 0) {
- switch(Occupation[playerid])
- {
- case OCCUPATION_GANGSTER:
- {
- CarSpawnerCar[NextCarSpawnerCar] = CreateVehicle(566,2183.5686,-1662.7076,14.6684,244.4174,-1,-1,-1);
- NextCarSpawnerCar = NextCarSpawnerCar++;
- CarSpawnsLeft[playerid] = CarSpawnsLeft[playerid]-1;
- }
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You don't have any carspawns left for your current life.");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your team!");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use the carspawner!");
- }
- }
- if(checkpointid == CarSpawner[2]) //Police carspawner
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- if (Team[playerid] == TEAM_POLICE)
- {
- if(CarSpawnsLeft[playerid] > 0) {
- switch(Occupation[playerid])
- {
- case OCCUPATION_STREETCOP:
- {
- CarSpawnerCar[NextCarSpawnerCar] = CreateVehicle(596,1535.8418,-1673.7173,13.1032,179.2815,-1,-1,-1);
- NextCarSpawnerCar = NextCarSpawnerCar++;
- CarSpawnsLeft[playerid] = CarSpawnsLeft[playerid]-1;
- }
- case OCCUPATION_BIKERCOP:
- {
- CarSpawnerCar[NextCarSpawnerCar] = CreateVehicle(523,1535.8418,-1673.7173,13.1032,179.2815,-1,-1,-1);
- NextCarSpawnerCar = NextCarSpawnerCar++;
- CarSpawnsLeft[playerid] = CarSpawnsLeft[playerid]-1;
- }
- case OCCUPATION_SWAT:
- {
- CarSpawnerCar[NextCarSpawnerCar] = CreateVehicle(427,1535.8418,-1673.7173,13.1032,179.2815,-1,-1,-1);
- NextCarSpawnerCar = NextCarSpawnerCar++;
- CarSpawnsLeft[playerid] = CarSpawnsLeft[playerid]-1;
- }
- case OCCUPATION_AIRSUPPORT:
- {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your occupation!");
- }
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You don't have any carspawns left for your current life.");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your team!");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use the carspawner!");
- }
- }
- if(checkpointid == CarSpawner[3]) //Police helispawner
- {
- if (!IsPlayerInAnyVehicle(playerid)) {
- if (Team[playerid] == TEAM_POLICE)
- {
- if(CarSpawnsLeft[playerid] > 0) {
- switch(Occupation[playerid])
- {
- case OCCUPATION_AIRSUPPORT:
- {
- CarSpawnerCar[NextCarSpawnerCar] = CreateVehicle(497,1559.4893,-1610.9672,13.5597,91.0091,-1,-1,-1);
- NextCarSpawnerCar = NextCarSpawnerCar++;
- CarSpawnsLeft[playerid] = CarSpawnsLeft[playerid]-1;
- }
- case OCCUPATION_STREETCOP:
- {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your occupation!");
- }
- case OCCUPATION_BIKERCOP:
- {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your occupation!");
- }
- case OCCUPATION_SWAT:
- {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your occupation!");
- }
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You don't have any carspawns left for your current life.");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must use the carspawner for your team!");
- }
- } else {
- SendClientMessage(playerid, 0xFF0000AA, "You must be on foot to use the carspawner!");
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == SHOP_CARSHOP)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 250) {
- if (CarShopCar[playerid] != -1) {
- DestroyVehicle(CarShopCar[playerid]);
- CarShopCar[playerid] = -1;
- }
- CarShopCar[playerid] = CreateVehicle(411,1776.6417,-1929.3938,13.1665,0.6010,-1,-1,-1);
- GivePlayerMoney(playerid, -250);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- if(listitem == 1)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 350) {
- if (CarShopCar[playerid] != -1) {
- DestroyVehicle(CarShopCar[playerid]);
- CarShopCar[playerid] = -1;
- }
- CarShopCar[playerid] = CreateVehicle(451,1776.6417,-1929.3938,13.1665,0.6010,-1,-1,-1);
- GivePlayerMoney(playerid, -350);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- }
- return 1;
- }
- if(dialogid == SHOP_JETPACKANDPARACHUTESHOP)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 300) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
- GivePlayerMoney(playerid, -300);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- if(listitem == 1)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 50) {
- GivePlayerWeapon(playerid, 46, 1);
- GivePlayerMoney(playerid, -50);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- }
- return 1;
- }
- if(dialogid == SHOP_AIRCRAFTSHOP)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 500) {
- if (AircraftShopVehicle[playerid] != -1) {
- DestroyVehicle(AircraftShopVehicle[playerid]);
- AircraftShopVehicle[playerid] = -1;
- }
- AircraftShopVehicle[playerid] = CreateVehicle(520,1681.7134,-2612.5090,14.2579,2.3501,-1,-1,-1);
- GivePlayerMoney(playerid, -500);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- if(listitem == 1)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 600) {
- if (AircraftShopVehicle[playerid] != -1) {
- DestroyVehicle(AircraftShopVehicle[playerid]);
- AircraftShopVehicle[playerid] = -1;
- }
- AircraftShopVehicle[playerid] = CreateVehicle(425,1681.7134,-2612.5090,14.2579,2.3501,-1,-1,-1);
- GivePlayerMoney(playerid, -600);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- return 1;
- }
- }
- if(dialogid == SHOP_HEAVYWEAPONSSHOP)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 800) {
- GivePlayerWeapon(playerid, 38, 150);
- GivePlayerMoney(playerid, -800);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- if(listitem == 1)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 400) {
- GivePlayerWeapon(playerid, 35, 10);
- GivePlayerMoney(playerid, -400);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- if(listitem == 2)
- {
- new playermoney;
- playermoney = GetPlayerMoney(playerid);
- if (playermoney >= 400) {
- GivePlayerWeapon(playerid, 37, 150);
- GivePlayerMoney(playerid, -200);
- } else {
- ShowPlayerDialog(playerid, DIALOG_NOTENOUGHMONEY, DIALOG_STYLE_MSGBOX, "Notice", "You don't have enough money to but this item!", "Close", "");
- }
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_RULES)
- {
- if(response)
- {
- rulesnotaccepted = 1;
- SendClientMessage(playerid, 0xFF0000AA, "You must read and accept the rules to play on Grove vs Ballas!");
- Kick(playerid);
- }
- return 1;
- }
- if(dialogid == DIALOG_REGISTER)
- {
- if(response)
- {
- new playername[MAX_PLAYER_NAME+1], filename[28+MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(filename, sizeof(filename), "sydculsroleplay/players/%s.ini", playername);
- new INI:iniFile = INI_Open(filename);
- INI_SetTag(iniFile, "logindata");
- INI_WriteString(iniFile, "password", inputtext);
- INI_Close(iniFile);
- } else {
- Kick(playerid);
- }
- return 1;
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if(response)
- {
- new playername[MAX_PLAYER_NAME+1], filename[28+MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(filename, sizeof(filename), "sydculsroleplay/players/%s.ini", playername);
- INI_ParseFile(filename, "ini_%s");
- } else {
- Kick(playerid);
- }
- return 1;
- }
- return 0;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
- {
- if (vehicleid == CarShopCar[playerid]) {
- DestroyVehicle(CarShopCar[playerid]);
- CarShopCar[playerid] = -1;
- }
- if (vehicleid == AircraftShopVehicle[playerid]) {
- DestroyVehicle(AircraftShopVehicle[playerid]);
- AircraftShopVehicle[playerid] = -1;
- }
- for(new vehicle; vehicle < MAX_VEHICLES; vehicle++)
- {
- if (vehicleid == CarSpawnerCar[vehicle]) {
- DestroyVehicle(CarSpawnerCar[vehicle]);
- }
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/suicide", cmdtext, true, 8) == 0)
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
- {
- if(GetVehicleModel(vehicleid) == 592)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 577)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 511)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 512)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 593)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 520)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 553)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 476)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 519)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 460)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 513)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 548)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 425)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 417)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 487)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 488)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 497)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 563)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 447)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- if(GetVehicleModel(vehicleid) == 469)
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment