Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------------------------------------------
- // ...:::||| Sahara Desert Roleplay |||:::...
- // Created by : Bruzer18
- // Custom RP Script from Scratch.
- // Script's State : BETA - Not finished.
- //------------------------------------------------------------------------------
- /*
- NOTE TO USERS!
- Please read this, the /duty command and this script has a player to point function, so just search for it
- a nd take the code off that makes the comment line green, Enjoy!
- */
- //--------------
- #include <a_samp>
- #include <core>
- #include <float>
- #include <dudb>
- //--------------
- static gTeam[MAX_PLAYERS]; // Tracks the team assignment for each player
- // New Variables//
- new gPlayerClass[MAX_PLAYERS];
- new logged[MAX_PLAYERS];
- new adminlevel[MAX_PLAYERS];
- new money[MAX_PLAYERS];
- new gNews[MAX_PLAYERS];
- new playername[MAX_PLAYER_NAME];
- new realchat = 1;
- // Forward Variables.
- forward Float:GetDistanceBetweenPlayers(p1,p2);
- forward SetupPlayerForClassSelection(playerid);
- forward OOCNews(color,const string[]);
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- forward OOCOff(color,const string[]);
- //Color Defines
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_GROVE 0x00FF00FF
- #define COLOR_RED 0xAA3333AA
- #define COLOR_LIGHTRED 0xFF6347AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_LIGHTGREEN 0x9ACD32AA
- #define COLOR_YELLOW2 0xF5DEB3AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_DBLUE 0x2641FEAA
- #define COLOR_NEWS 0x458E1DAA
- #define TEAM_GREEN_COLOR 0xFFFFFFAA
- #define TEAM_JOB_COLOR 0xFFB6C1AA
- #define TEAM_HIT_COLOR 0xFFFFFF00
- #define TEAM_BLUE_COLOR 0x8D8DFF00
- #define TEAM_RADIO_COLOR 0xF2D068FF
- #define COLOR_ADD 0x63FF60AA
- #define TEAM_GROVE_COLOR 0x00D900C8
- #define TEAM_VAGOS_COLOR 0xFFC801C8
- #define TEAM_BALLAS_COLOR 0xD900D3C8
- #define TEAM_AZTECAS_COLOR 0x01FCFFC8
- #define TEAM_CYAN_COLOR 0xFF8282AA
- #define TEAM_ORANGE_COLOR 0xFF830000
- #define TEAM_COR_COLOR 0x39393900
- #define TEAM_BAR_COLOR 0x00D90000
- #define TEAM_TAT_COLOR 0xBDCB9200
- #define TEAM_CUN_COLOR 0xD900D300
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define TEAM_STR_COLOR 0x01FCFF00
- //Locked Skins!
- #define Tim
- //Team Defines
- #define TEAM_PD 0
- #define TEAM_FBI 1
- #define TEAM_MEDIC 2
- #define TEAM_GunDealers 3
- #define TEAM_DrugDealers 4
- #define TEAM_Taxi 5
- #define TEAM_Mayor 6
- #define TEAM_Hitman 7
- #define TEAM_NEWS 8
- #define TEAM_DMV 9
- #define TEAM_MS 10
- // Teams etc.
- // Possible things to add : Lock cars for players.
- //------------------------------------------------------------------------------
- main()
- {
- print("\n----------------------------------");
- print(" SaharaDesertRoleplay-By Bruzer18\n");
- print("----------------------------------\n");
- }
- //------------------------------------------------------------------------------
- public OnGameModeInit()
- {
- SetGameModeText("Sahara Desert Roleplay");
- SetTeamCount(10);
- ShowNameTags(1);
- ShowPlayerMarkers(0);
- SetWorldTime(18);
- // OnGameModeInit Code
- //=======================Skins==========================/
- AddPlayerClass(288,-1393.3452,2640.5430,55.9414,87.8658,0,0,0,0,0,0); // NewPoliceSpawn - Done
- AddPlayerClass(286,1527.3807,-1467.2283,9.5000,180.1942,0,0,0,0,0,0); // FBI sspawn - Done
- AddPlayerClass(276,-1515.0388,2521.4788,55.8559,359.5050,0,0,0,0,0,0); // New medic spawnzor. - DONE
- AddPlayerClass(66,-1465.4756,2610.4966,55.8359,183.7966,0,0,0,0,0,0); // Civilians - Done - El Quebadreos - 4
- AddPlayerClass(170,-252.3558,2599.2471,62.8582,269.6274,0,0,0,0,0,0); // Civilian 2- Done - LasPayasadas Spawnzor. - 5
- AddPlayerClass(61,-235.2902,2655.2957,62.6431,179.2515,0,0,0,0,0,0); // New New new Taxi Spawn. - Done
- AddPlayerClass(295,1476.4916,-1770.9729,18.7958,2.6588,0,0,0,0,0,0); // Mayor Spawn. - Not done
- AddPlayerClass(294,-431.3105,2238.4915,42.4297,180.5773,0,0,0,0,0,0); // Newhitman spawn - Done
- AddPlayerClass(227,1774.7866,-1310.0735,13.7023,91.5220,0,0,0,0,0,0); // News Spawn - Not done
- AddPlayerClass(283,-322.6225,2675.5945,63.6797,272.1808,0,0,0,0,0,0); // Otherpd- PD number 2. - Done
- AddPlayerClass(108,-1299.2592,2526.8677,88.4700,86.7574,0,0,0,0,0,0); // MS-13 NEW SPAWN GANGSTRA NISS ZOR - Done
- //========================= DMV ====================================//
- // Need to add!
- //----------------------------- LSPD --------------------------------------//
- AddStaticVehicleEx(523,-1411.1091,2659.0962,55.2545,90.4419,0,0, 30000); // Policecar1
- AddStaticVehicleEx(523,-1410.5569,2657.0508,55.2624,91.4589,0,0, 30000); // Policecar2
- AddStaticVehicleEx(523,-1409.9266,2654.6917,55.2602,86.9239,0,0, 30000); // Policecar3
- AddStaticVehicleEx(523,-1410.6949,2651.3867,55.2589,95.4991,0,0, 30000); // Policecar4
- AddStaticVehicleEx(598,-1399.2152,2659.7461,55.4351,91.2148,0,1, 30000); // Policecar5
- AddStaticVehicleEx(598,-1399.1454,2656.4504,55.4352,91.2148,0,1, 30000); // Policecar6
- AddStaticVehicleEx(598,-1399.4120,2653.3772,55.4330,91.2148,0,1, 30000); // Policecar7
- AddStaticVehicleEx(598,-1399.3422,2650.0913,55.4330,91.2148,0,1, 30000); // Policecar8
- AddStaticVehicleEx(598,-1399.2764,2646.9919,55.4330,91.2148,0,1, 30000); // Policecar9
- AddStaticVehicleEx(598,-1399.2085,2643.7832,55.4331,91.2148,0,1, 30000); // Policecar10
- AddStaticVehicleEx(599,-1400.1302,2637.6816,55.8801,90.3100,0,1, 30000); // Policecar11
- AddStaticVehicleEx(599,-1400.0814,2628.6323,55.8798,90.3100,0,1, 30000); // Policecar12
- //-------------------------- FBI ---------------------------------------------//
- AddStaticVehicleEx(490,-528.4824,2604.0898,53.5409,270.9850,0,0, 30000); // FbiCar13
- AddStaticVehicleEx(490,-528.6441,2609.3335,53.5419,268.8361,0,0, 30000); // FbiCar14
- AddStaticVehicleEx(490,-528.9174,2614.4636,53.5417,269.1524,0,0, 30000); // FbiCar15
- AddStaticVehicleEx(490,-528.6020,2619.5801,53.5423,268.9906,0,0, 30000); // FbiCar16
- AddStaticVehicleEx(490,-529.2902,2579.1995,53.5423,269.0871,0,0, 30000); // FbiCar17
- AddStaticVehicleEx(490,-528.7330,2574.0530,53.5435,269.2231,0,0, 30000); // FbiCar18
- AddStaticVehicleEx(490,-528.8759,2569.0752,53.5417,271.2657,0,0, 30000); // FbiCar19
- AddStaticVehicleEx(490,-529.4525,2563.9207,53.5428,269.9338,0,0, 30000); // FbiCar20
- AddStaticVehicleEx(601,-540.1744,2551.5132,53.1729,267.5495,1,1, 30000); // FbiCar21
- AddStaticVehicleEx(601,-540.5685,2558.5129,53.1735,267.6572,1,1, 30000); // FbiCar22
- AddStaticVehicleEx(528,-539.0366,2568.2280,53.4592,268.7965,0,0, 30000); // FbiCar23
- AddStaticVehicleEx(528,-539.8325,2578.3586,53.4570,267.0146,0,0, 30000); // FbiCar24
- //-------------------------- Ambulance --------------------------------------//
- AddStaticVehicleEx(416,-1497.3162,2526.6487,55.8366,359.3360,1,3, 30000); // Ambulance25.
- AddStaticVehicleEx(416,-1503.3296,2526.7188,55.7959,359.3360,1,3, 30000); // Ambulance26
- AddStaticVehicleEx(416,-1509.3666,2526.6494,55.7550,359.3360,1,3, 30000); // Ambulance27
- //-------------------------- Firemans Car -----------------------------------//
- AddStaticVehicleEx(407,-1528.0355,2525.2686,56.0084,359.3404,3,1, 30000); // Firecar28
- AddStaticVehicleEx(407,-1522.3387,2525.5190,55.9534,359.6186,3,1, 30000); // Firecar29
- //-------------------------- Hitmens car -----------------------------------//
- AddStaticVehicle(466,-399.1115,2252.5276,42.0695,286.0395,0,1); // Hitman car 1
- AddStaticVehicle(466,-372.4579,2234.0366,42.2259,104.1763,0,1); // Hitman car 2
- AddStaticVehicle(466,-391.0760,2221.4490,42.1714,284.1979,0,1); // Hitman car 3
- //------------------------- Random Cars --------------------------------------//
- AddStaticVehicle(492,-1287.0267,2513.8567,86.8602,0.3305,6,6); //
- AddStaticVehicle(445,-1317.6320,2528.5605,87.5045,178.7644,6,6); //
- AddStaticVehicle(467,-1333.2609,2527.4119,86.8274,178.2959,6,6); //
- AddStaticVehicle(466,-1312.5665,2553.6953,87.1588,119.2086,6,6); //
- AddStaticVehicle(528,-274.8153,2655.9656,62.6800,266.8616,0,0); //
- AddStaticVehicle(598,-301.4103,2685.7856,62.3990,0.8923,102,1); //
- AddStaticVehicle(599,-278.2669,2665.7261,62.7955,87.0967,119,119); //
- AddStaticVehicle(598,-285.2113,2666.5386,62.3726,90.6353,119,119); //
- AddStaticVehicle(598,-320.6234,2685.0706,62.4049,135.5070,102,102); //
- AddStaticVehicle(598,-319.1672,2680.7256,62.3759,127.0067,102,102); //
- AddStaticVehicle(598,-397.4390,2719.3088,61.9013,52.6765,102,102); //
- AddStaticVehicle(413,-324.0685,2658.9619,63.5290,89.6692,0,0); //
- AddStaticVehicle(420,-201.3834,2641.7266,62.9679,258.7786,4,4); //
- AddStaticVehicle(440,-209.4124,2642.4355,63.1904,270.3766,4,4); //
- AddStaticVehicle(420,-216.8323,2642.7295,62.7390,92.2922,4,4); //
- AddStaticVehicle(420,-223.8579,2642.6421,62.6548,101.9817,4,4); //
- AddStaticVehicle(440,-230.9708,2642.1746,62.8915,97.7684,4,4); //
- AddStaticVehicle(559,-726.3906,2744.9546,46.8775,183.6546,0,0); //
- AddStaticVehicle(459,-733.0714,2744.8555,47.2798,179.6990,0,0); //
- AddStaticVehicle(576,-723.2308,2738.3599,47.6038,201.3414,28,28); //
- AddStaticVehicle(535,-745.5001,2749.9595,47.0131,358.5888,50,70); //
- //------------------------------------------------------------------------//
- //Pickupz//
- AddStaticPickup(1277, 2, 1568.7919,-1691.1198,5.8906); // Icon for police.
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, COLOR_WHITE, "***************************************************");
- SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Sahara Desert Roleplay, Enjoy your stay!");
- SendClientMessage(playerid, COLOR_YELLOW, " ");
- SendClientMessage(playerid, COLOR_YELLOW, "This Script was made by Bruzer18!.");
- SendClientMessage(playerid, COLOR_YELLOW, "Please /login if you have an account, if not /register.");
- SendClientMessage(playerid, COLOR_YELLOW, "You will be kicked if you spawn without logging in!.");
- SendClientMessage(playerid, COLOR_WHITE, "****************************************************");
- logged[playerid] = 0;
- SetPlayerColor(playerid, COLOR_GREY); // Set the player's color to inactive
- return 1;
- }
- //------------------------------------------------------------------------------
- /*PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
- {
- new Float:oldpos[3], Float:temppos[3];
- GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
- temppos[0] = (oldpos[0] -X);
- temppos[1] = (oldpos[1] -Y);
- temppos[2] = (oldpos[2] -Z);
- if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
- {
- return true;
- }
- return false;
- }
- */
- public Float:GetDistanceBetweenPlayers(p1,p2)
- {
- new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
- if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
- {
- return -1.00;
- }
- GetPlayerPos(p1,x1,y1,z1);
- GetPlayerPos(p2,x2,y2,z2);
- return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
- }
- //------------------------------------------------------------------------------
- public OnPlayerSpawn(playerid)
- {
- // Custom Faction locked skins.
- // Tutorial : How to use the locked skins.
- // Add the skin ID you want to be locked ( EX : 286 ) Then Put the name of the user that may only use it.
- // Then just fill in the line. Enjoy - Bruzer18
- if((GetPlayerSkin(playerid) == 286))
- {
- new name[256];
- GetPlayerName(playerid, name, sizeof(name));
- if(strcmp(name,"Bruzer18",true) == 0)
- {
- }
- else
- {
- GameTextForPlayer(playerid,"~r~Your not the~n~Faction~n~Leader",4000,1);
- ForceClassSelection(playerid);
- SetPlayerHealth(playerid,0.0);
- }
- return 1;
- }
- if(logged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You failed to log in before spawning, You have been kicked");
- SendClientMessage(playerid,COLOR_BLUE, "Next time login before spawning - Thanks!");
- Kick(playerid);
- }
- SetPlayerInterior(playerid,0);
- if(gTeam[playerid] == TEAM_PD) {
- SendClientMessage(playerid,COLOR_BLUE, "Type /duty to go on duty ! </duty>!");
- SetPlayerColor(playerid,COLOR_GREEN); // Green
- }
- else if(gTeam[playerid] == TEAM_FBI) {
- SetPlayerColor(playerid,COLOR_RED); // Red
- }
- else if(gTeam[playerid] == TEAM_MEDIC) {
- SetPlayerColor(playerid,COLOR_YELLOW); // Yellow
- }
- else if(gTeam[playerid] == TEAM_GunDealers) {
- SendClientMessage(playerid, COLOR_BLUE, "Your now a Civilian of El Quebadros, Use </skin> to pick a new skin.");
- SetPlayerColor(playerid,COLOR_PINK); // Pink
- }
- else if(gTeam[playerid] == TEAM_DrugDealers) {
- SendClientMessage(playerid, COLOR_BLUE, "Your now a Civilian of Las Payasadas, Use </skin> to pick a new skin.");
- SetPlayerColor(playerid,COLOR_BLUE); // Blue
- }
- else if(gTeam[playerid] == TEAM_Taxi) {
- SetPlayerColor(playerid,COLOR_LIGHTBLUE); // Light Blue
- }
- else if(gTeam[playerid] == TEAM_Mayor) {
- SetPlayerColor(playerid,COLOR_DARKRED); // Dark Red
- }
- else if(gTeam[playerid] == TEAM_Hitman) {
- SetPlayerColor(playerid,COLOR_ORANGE); // Orange
- }
- else if(gTeam[playerid] == TEAM_NEWS) {
- SendClientMessage(playerid,COLOR_BLUE, "Feel free to type /news to announce the local news.");
- SetPlayerColor(playerid,COLOR_GREY); // Greyzor?
- }
- else if(gTeam[playerid] == TEAM_DMV) {
- SendClientMessage(playerid, COLOR_YELLOW, "Use /duty to get on duty at any time! ");
- SetPlayerColor(playerid,COLOR_GREY); // COLOR_DARKRED // TEAM_MS-13
- if(gTeam[playerid] == TEAM_MS) {
- SetPlayerColor(playerid,COLOR_GREEN); // Green
- }
- }
- return 1;
- }
- //#define TEAM_ 9
- //TEAM_NEWS 8
- //-----------------------------------------------------------------------------
- public SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-1657.5237,1207.6644,13.6719);
- SetPlayerFacingAngle(playerid,357.6906);
- SetPlayerCameraPos(playerid, -1657.4678,1211.2292,13.6781);
- SetPlayerCameraLookAt(playerid,-1657.5237,1207.6644,13.6719);
- }
- //------------------------------------------------------------------------------
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerClass(playerid, classid);
- SetupPlayerForClassSelection(playerid);
- gPlayerClass[playerid] = classid;
- switch (classid) {
- case 0:
- {
- GameTextForPlayer(playerid, "~g~Police Department", 5000, 3);
- }
- case 1:
- {
- GameTextForPlayer(playerid, "~g~FBI", 5000, 3);
- }
- case 2:
- {
- GameTextForPlayer(playerid, "~g~Medics", 5000, 3);
- }
- case 3:
- {
- GameTextForPlayer(playerid, "~g~Civilians Of ElQuebadros", 5000, 3);
- }
- case 4:
- {
- GameTextForPlayer(playerid, "~g~Civilians Of LasPayasadas", 5000, 3);
- }
- case 5:
- {
- GameTextForPlayer(playerid, "~g~Taxi", 5000, 3);
- }
- case 6:
- {
- GameTextForPlayer(playerid, "~g~Mayor", 5000, 3);
- }
- case 7:
- {
- GameTextForPlayer(playerid, "~g~Hitman", 5000, 3);
- }
- case 8:
- {
- GameTextForPlayer(playerid, "~g~News", 5000, 3);
- }
- case 9:
- {
- GameTextForPlayer(playerid, "~g~HighWay Patrol", 5000, 3);
- }
- case 10:
- {
- GameTextForPlayer(playerid, "~g~MS-13", 5000, 3);
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256],tmp[256], tmp2[256];
- new idx;
- new string[256];
- cmd = strtok(cmdtext, idx);
- new sendername;
- new giveplayerid;
- //=========================//
- if(strcmp(cmd, "/hitmaninvite", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /hitmaninvite [playerid/PartOfName]");
- return 1;
- }
- if(gTeam[playerid] == 7 || gTeam[playerid] == 7)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- SetPlayerTeam(playerid, 7);
- }
- }
- }
- else
- {
- format(string, sizeof(string), " %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- }
- return 1;
- }
- //=================================//
- if (strcmp("/duty", cmdtext, true, 10) == 0)
- {
- // if (PlayerToPoint(2, playerid,1568.7919,-1691.1198,5.8906))
- // {
- if(gTeam[playerid] == 0 || gTeam[playerid] == 9)
- {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- GivePlayerWeapon(playerid, 24, 500);
- GivePlayerWeapon(playerid, 3, 1);
- GivePlayerWeapon(playerid, 25, 20);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, " Your not a Police Officer! ");
- return 1;
- }
- return 0;
- }
- // }
- //----------------------//
- if (strcmp("/skin", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"_______Skin List _____");
- SendClientMessage(playerid, COLOR_GREY," 1.Normal 2.Irish Guy ");
- SendClientMessage(playerid, COLOR_GREY," 3.BusinessMan 4.BikerMan ");
- SendClientMessage(playerid, COLOR_GREY," 5.Girl1 6.Girl2 ");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Type the name <EX: /normal> ");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, " Your not a civilian or El Quebadros or Las Payasadas! ");
- return 1;
- }
- }
- //================================//
- if (strcmp("/normal", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You picked the Normal Skin! ");
- SetPlayerSkin(playerid, 60);
- return 1;
- }
- }
- //-===================//
- if (strcmp("/irishguy", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You picked the Irish Guy Skin! ");
- SetPlayerSkin(playerid, 101);
- return 1;
- }
- }
- if (strcmp("/businessman", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You picked the Business Man Skin! ");
- SetPlayerSkin(playerid, 147);
- return 1;
- }
- }
- if (strcmp("/bikerman", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You picked the Biker guy skin! ");
- SetPlayerSkin(playerid, 179);
- return 1;
- }
- }
- if (strcmp("/girl1", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You picked the Girl 1 Skin! ");
- SetPlayerSkin(playerid, 192);
- return 1;
- }
- }
- if (strcmp("/girl2", cmdtext, true, 10) == 0)
- {
- if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You picked the Girl 2 Skin! ");
- SetPlayerSkin(playerid, 193);
- return 1;
- }
- }
- //============//
- if(strcmp(cmd, "/news", true) == 0)
- {
- if(gTeam[playerid] == 8)
- {
- 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_GREY, "USAGE: /news [newstext]");
- return 1;
- }
- format(string, sizeof(string), "[ABC News] %s: %s",sendername, result);
- OOCNews(COLOR_NEWS,string);
- return 1;
- }
- }
- //========Kill===================//
- if(strcmp(cmd, "/kill", true) == 0)
- {
- SetPlayerHealth(playerid, 0);
- SendClientMessage(playerid,COLOR_RED, " You've killed yourself, Enjoy it!.");
- return 1;
- }
- //-==---------------------------------//
- if(strcmp(cmd, "/adminarmourup", true) == 0)
- {
- if(IsPlayerAdmin(playerid)) // This checks if the players an rcon admin.
- {
- SetPlayerArmour(playerid, 999);
- SetPlayerHealth(playerid, 999);
- GivePlayerWeapon(playerid, 24, 100);
- GivePlayerWeapon(playerid, 26, 10660);
- GivePlayerWeapon(playerid, 38, 10660);
- GivePlayerWeapon(playerid, 31, 10660);
- GivePlayerWeapon(playerid, 34, 10660);
- GivePlayerWeapon(playerid, 16, 10660);
- return 1;
- }
- }
- //==============================//
- if(strcmp(cmd, "/forums", true) == 0)
- {
- SendClientMessage(playerid,COLOR_YELLOW, "SaharaDesert Roleplay - V1.0 Made by Bruzer18.");
- SendClientMessage(playerid,COLOR_YELLOW, "Forums link : .......");
- return 1;
- }
- //----------------------------------[ooc]-----------------------------------------------
- // Broken - needs to be fixed..
- //===================================//
- if(strcmp(cmd, "/commands", true) == 0)
- {
- SendClientMessage(playerid,COLOR_ORANGE, "|__________COMMANDS__________|");
- SendClientMessage(playerid,COLOR_ORANGE, " Commands: /forums /kill /ooc /skin .");
- SendClientMessage(playerid,COLOR_ORANGE, " Police Help : /duty");
- if(adminlevel[playerid] != 3)
- {
- SendClientMessage(playerid,COLOR_ORANGE, " /aheal /kick");
- return 1;
- }
- return 1;
- }
- // register//
- GetPlayerName(playerid, playername, sizeof(playername));
- if(strcmp(cmd, "/register", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /register (password)");
- }
- else
- {
- if (!dini_Exists(udb_encode(playername)))
- {
- dini_Create(udb_encode(playername));
- dini_IntSet(udb_encode(playername), "password", udb_hash(tmp));
- dini_IntSet(udb_encode(playername), "adminlevel", 0);
- dini_IntSet(udb_encode(playername), "money", 0);
- format(string, sizeof(string), "Account %s created! You can now login with /login %s", playername, tmp);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- GivePlayerMoney(playerid, 4000);
- SendClientMessage(playerid, COLOR_YELLOW, "You received 4000 for registering, enjoy your stay! ");
- }
- else
- {
- format(string, sizeof(string), "%s is already registered.", playername,tmp);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/login", true) == 0)
- {
- if(logged[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_RED, "You are already logged in!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /login [password]");
- }
- else
- {
- if (dini_Exists(udb_encode(playername)))
- {
- tmp2 = dini_Get(udb_encode(playername), "password");
- if (udb_hash(tmp) != strval(tmp2))
- {
- SendClientMessage(playerid, COLOR_RED, "Wrong/Invalid Password!");
- }
- else
- {
- logged[playerid] = 1;
- money[playerid] = dini_Int(udb_encode(playername), "money");
- adminlevel[playerid] = dini_Int(udb_encode(playername), "adminlevel");
- format(string, sizeof(string), "%s, you are now logged in . You have admin level %d and have %d dollars.", playername, adminlevel[playerid], money[playerid]);
- SendClientMessage(playerid, COLOR_GREEN, string);
- GivePlayerMoney(playerid, money[playerid]);
- }
- }
- else
- {
- format(string, sizeof(string), "You are not registerid Type /register [password] to create an account!", playername);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/makemeadmin", true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] != 3)
- {
- adminlevel[playerid] = 5;
- SendClientMessage(playerid, COLOR_GREEN, "You are now at the max admin level!!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You are already the top admin!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Please, first login: /login [password]");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You must first login with rcon! (/rcon login [rcon-pass])");
- }
- return 1;
- }
- //=============//
- //=------
- return 0;
- }
- //============================================================================//
- public OnPlayerDisconnect(playerid, reason)
- {
- money[playerid] = GetPlayerMoney(playerid);
- dini_IntSet(udb_encode(playername), "money", money[playerid]);
- dini_IntSet(udb_encode(playername), "adminlevel", adminlevel[playerid]);
- logged[playerid] = 0;
- return 1;
- }
- //--------------------------------------------------------------------//
- //==============================================================================
- public OOCNews(color,const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!gNews[i])
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- }
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- 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)
- {
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -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);
- }
- }
- }
- }
- return 1;
- }
- //--------------------------- ---------------------------------------------------
- public OnPlayerText(playerid, text[])
- {
- new sendername[MAX_PLAYER_NAME];
- new string[256];
- //=====================//
- if (realchat)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says: %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 0;
- }// Not connected.
- return 1;
- }
- //====================================//
- SetPlayerClass(playerid, classid) {
- if(classid == 0) {
- gTeam[playerid] = TEAM_PD;
- } else if(classid == 1) {
- gTeam[playerid] = TEAM_FBI;
- } else if(classid == 2) {
- gTeam[playerid] = TEAM_MEDIC;
- } else if(classid == 3) {
- gTeam[playerid] = TEAM_GunDealers;
- } else if(classid == 4) {
- gTeam[playerid] = TEAM_DrugDealers;
- } else if(classid == 5) {
- gTeam[playerid] = TEAM_Taxi;
- } else if(classid == 6) {
- gTeam[playerid] = TEAM_Mayor;
- } else if(classid == 7) {
- gTeam[playerid] = TEAM_Hitman;
- } else if(classid == 8) {
- gTeam[playerid] = TEAM_NEWS;
- } else if(classid == 9) {
- gTeam[playerid] = TEAM_MS;
- } else if(classid == 10) {
- }
- }
- //------------------------------------------------------------------------------
- //=---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement