Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <utils>
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #define COLOR_GRAD1 0xB4B5B7FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD3 0xCBCCCEFF
- #define COLOR_GRAD4 0xD8D8D8FF
- #define COLOR_GRAD5 0xE3E3E3FF
- #define COLOR_GRAD6 0xF0F0F0FF
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_LIGHTRED 0xFF6347AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_LIGHTGREEN 0x9ACD32AA
- #define COLOR_YELLOW 0xFFFF00AA
- #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_ALLDEPT 0xFF8282AA
- #define COLOR_NEWS 0xFFA500AA
- #define COLOR_OOC 0xE0FFFFAA
- new Zombiesteam[MAX_PLAYERS];
- new Soldiersteam[MAX_PLAYERS];
- new CurrentMoney[MAX_PLAYERS];
- new LastMoney[MAX_PLAYERS];
- new CreatedCars[100];
- new CreatedCar = 0;
- forward ShowStats(playerid,targetid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward OnPlayerUpdate(playerid);
- forward Encrypt(string[]);
- forward OnPlayerLogin(playerid,const string[]);
- forward PlayerPlayMusic(playerid);
- forward StopMusic();
- forward AntiMoneyCheat();
- //forward gametime();
- //forward gametime2();
- forward AntiGunCheat();
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- new rankcost = 600;
- new Menu:perk;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Call of Duty: Nazi Zombies");
- print("----------------------------------\n");
- }
- #endif
- enum pInfo
- {
- pPassword[128],
- pRank,
- pExp,
- pKills,
- pDeaths,
- pJuggernaut,
- pOverkill,
- pFrag,
- pAdmin,
- pPremium,
- pSaw,
- pCash,
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new gPlayerLogged[MAX_PLAYERS];
- new gPlayerAccount[MAX_PLAYERS];
- public OnGameModeInit()
- {
- //SetTimer("gametime", 900000, 0); // 15 minutes
- SetTimer("AntiMoneyCheat", 1000, 1);
- SetTimer("AntiGunCheat", 1000, 1);
- perk = CreateMenu("perk Menu", 1, 50.0, 180.0, 200.0, 200.0);
- SetMenuColumnHeader(perk, 0, "*_Perks Menu_*");
- AddMenuItem(perk, 0, "Overkill For $100,000");
- AddMenuItem(perk, 0, "Fragx3 For $75,000");
- AddMenuItem(perk, 0, "Juggernaut For $125,000");
- AddMenuItem(perk, 0, "Exit");
- SetGameModeText("Nazi Zombies");
- AddPlayerClass(287, 81.010902, 1672.796509, 16.632231, 269.1425, 22, 100, 0, 0, 0, 0); // Soldier 1
- AddPlayerClass(121, 114.8816,1673.2751,17.5518, 269.1425, 22, 100, 0, 0, 0, 0); // Soldier 2
- AddPlayerClass(286, 101.7231,1701.1642,18.0489, 269.1425, 22, 100, 0, 0, 0, 0); // Soldier 3 premium silver
- AddPlayerClass(164, 101.7231,1701.1642,18.0489, 269.1425, 22, 100, 0, 0, 0, 0); // Soldier 4 premium gold
- AddPlayerClass(285, 101.7231,1701.1642,18.0489, 269.1425, 22, 100, 0, 0, 0, 0); // Soldier 5 Admin
- AddPlayerClass(137,33.6468,1805.6796,17.6406,212.1153,24,260,33,10,0,0); // zom 1
- AddPlayerClass(230,125.5642,1793.7635,17.6406,259.5016,24,260,33,10,0,0); // zom 2
- AddPlayerClass(78,193.5855,1754.2750,17.6481,217.8279,24,260,33,10,0,0); // zom 3
- AddPlayerClass(128,193.5855,1754.2750,17.6481,217.8279,24,260,33,10,0,0); // zom 4 premium silver
- AddPlayerClass(162,193.5855,1754.2750,17.6481,217.8279,24,260,33,10,0,0); // zom 5 premium gold
- AddPlayerClass(167,193.5855,1754.2750,17.6481,217.8279,24,260,33,10,0,0); // zom 6 Admin
- AddStaticVehicle(425,228.4282,1890.0945,18.1998,0.0292,0,0); // Heli 1
- AddStaticVehicle(425,203.2448,1888.1006,18.2295,4.3415,0,0); // Heli 2
- CreateObject(980, 96.641930, 1919.085693, 19.931686, 0.0000, 0.0000, 90.2409);// Gates for helocp[ter
- CreateObject(980, 213.792221, 1875.419312, 13.470366, 0.0000, 0.0000, 0.0000); // Gatse for helicopter
- CreateObject(16287, 81.010902, 1672.796509, 16.632231, 0.0000, 0.0000, 0.0000);
- CreateObject(16287, 101.582672, 1702.111084, 16.640625, 0.0000, 0.0000, 306.7149);
- CreateObject(16287, 114.486176, 1673.373291, 16.640625, 0.0000, 0.0000, 68.7549);
- CreateObject(3866, 68.557297, 1706.036499, 24.479189, 0.0000, 0.0000, 0.0000);
- CreateObject(3887, 108.475548, 1716.453979, 24.709074, 0.0000, 0.0000, 262.0242);
- CreateObject(5837, 56.069839, 1666.369873, 18.204292, 0.0000, 0.0000, 260.4093);
- CreateObject(5837, 52.523544, 1687.042236, 18.358120, 0.0000, 0.0000, 249.9921);
- CreateObject(5837, 139.601257, 1697.671265, 18.358120, 0.0000, 0.0000, 120.3212);
- CreateObject(5837, 136.574707, 1674.391602, 18.358120, 0.0000, 0.0000, 111.7268);
- CreateObject(11088, 34.915924, 2002.516846, 23.404181, 0.0000, 0.0000, 0.0000);
- CreateObject(972, 49.082146, 1766.017456, 16.637506, 0.0000, 0.0000, 283.5101);
- CreateObject(972, 99.477951, 1764.698975, 16.637506, 0.0000, 0.0000, 251.7110);
- CreateObject(972, 153.193848, 1757.340576, 16.637506, 0.0000, 0.0000, 259.4459);
- CreateObject(972, 177.215698, 1725.839233, 16.637506, 0.0000, 0.0000, 210.5621);
- CreateObject(972, 22.684059, 1681.651611, 16.637506, 0.0000, 0.0000, 0.0000);
- CreateObject(3359, 101.222244, 1660.857422, 16.197004, 0.0000, 0.0000, 187.3573);
- CreateObject(18609, 73.880928, 1746.545410, 17.813112, 0.0000, 0.0000, 112.5862);
- CreateObject(18568, 39.873627, 1715.209229, 17.429632, 0.0000, 0.0000, 295.5422);
- CreateObject(18566, 81.356895, 1745.770508, 17.522076, 0.0000, 0.0000, 0.0000);
- CreateObject(18565, 122.414688, 1741.575439, 17.966715, 0.0000, 0.0000, 0.0000);
- CreateObject(18568, 148.264603, 1724.807495, 17.429632, 0.0000, 0.0000, 51.5662);
- CreateObject(18569, 155.915771, 1711.509399, 17.966715, 0.0000, 0.0000, 0.0000);
- CreateObject(18609, 34.632095, 1695.398193, 17.813116, 0.0000, 0.0000, 0.0000);
- CreateObject(16134, 173.035797, 1699.292114, 16.777035, 0.0000, 0.0000, 0.0000);
- CreateObject(3263, 80.121109, 1719.358887, 16.640625, 0.0000, 0.0000, 214.8593);
- CreateObject(3263, 137.558472, 1710.356567, 16.640625, 0.0000, 0.0000, 137.5099);
- CreateObject(3262, 142.977234, 1691.322998, 16.640625, 0.0000, 0.0000, 128.9156);
- CreateObject(3262, 55.059525, 1718.601563, 16.640625, 0.0000, 0.0000, 232.0480);
- CreateObject(3264, 65.993904, 1717.296631, 16.646107, 0.0000, 0.0000, 180.4818);
- CreateObject(3265, 49.128311, 1678.611328, 16.640625, 0.0000, 0.0000, 244.9395);
- CreateObject(3462, 100.570862, 1659.667114, 17.817303, 0.0000, 0.0000, 266.4254);
- CreateObject(17036, 133.677841, 1778.311035, 16.648151, 0.0000, 0.0000, 81.6465);
- AddStaticPickup(352, 1, 100.4487,1698.9833,17.6406); // Uzi gun
- AddStaticPickup(372, 1, 103.9912,1706.3562,17.6406); // Tec 9 gun
- AddStaticPickup(355, 1, 110.0566,1672.6910,17.5495); // ak47 gun
- AddStaticPickup(356, 1, 119.0737,1673.7330,17.5554); // m4 gun
- AddStaticPickup(351, 1, 82.6957,1669.4307,17.5870); // Spas 12 shotgun
- AddStaticPickup(350, 1, 78.7932,1677.9425,17.6406); // sawn off shotgun
- AddStaticPickup(361, 1, 100.1149,1662.3073,17.3289); // Flame THrower
- AddStaticPickup(1240, 1, 115.4408,1719.3175,17.6406); // health
- TextDrawCreate(187.000000,418.000000,"www.cod-saw.tk");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- new string[128];
- if (classid == 0)
- {
- format(string, sizeof(string), "~y~> ~p~Soldiers ~y~< ~n~Team!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 1)
- {
- format(string, sizeof(string), "~y~> ~p~Soldiers ~y~< ~n~Team!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 2)
- {
- format(string, sizeof(string), "~y~> ~p~Soldiers ~y~< ~n~Team(Premium Silver Only)!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 3)
- {
- format(string, sizeof(string), "~y~> ~p~Soldiers ~y~< ~n~Team(Premium Gold Only)!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 4)
- {
- format(string, sizeof(string), "~y~> ~p~Soldiers ~y~< ~n~Team(Admin Only)!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 5)
- {
- format(string, sizeof(string), "~y~> ~p~Nazi Zombies ~y~< ~n~Team!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 6)
- {
- format(string, sizeof(string), "~y~> ~p~Nazi Zombies ~y~< ~n~Team!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 7)
- {
- format(string, sizeof(string), "~y~> ~p~Nazi Zombies ~y~< ~n~Team!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 8)
- {
- format(string, sizeof(string), "~y~> ~p~Nazi Zombies ~y~< ~n~Team(Premium Silver Only)!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 9)
- {
- format(string, sizeof(string), "~y~> ~p~Nazi Zombies ~y~< ~n~Team(Premium gold Only)!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- else if (classid == 10)
- {
- format(string, sizeof(string), "~y~> ~p~Nazi Zombies ~y~< ~n~Team(Admin Only)!");
- GameTextForPlayer(playerid,string,3500,6);
- }
- SetPlayerPos(playerid, 34.6797,1748.0992,17.6406);
- SetPlayerFacingAngle(playerid,55.1572);
- SetPlayerCameraPos(playerid, 30.5591,1752.9990,17.6406);
- SetPlayerCameraLookAt(playerid, 34.6797,1748.0992,17.6406);
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetWeather(09);
- new playrname[MAX_PLAYER_NAME];
- new connect[128];
- GetPlayerName(playerid, playrname, sizeof(playrname));
- format(connect, sizeof(connect), "%s.cer", playrname);
- if(fexist(connect))
- {
- gPlayerAccount[playerid] = 1;
- SendClientMessage(playerid, COLOR_YELLOW, "You are registered, please login with /login password");
- return 1;
- }
- else
- {
- gPlayerAccount[playerid] = 0;
- SendClientMessage(playerid, COLOR_YELLOW, "You are new here or not registered, please register with /register password");
- }
- new string[64];
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), "Welcome to Nazi Zombies %s.",playername);
- SendClientMessage(playerid, COLOR_GREEN,string);
- LastMoney[playerid] = 0;
- Soldiersteam[playerid] = 0;
- Zombiesteam[playerid] = 0;
- CurrentMoney[playerid] = 0;
- PlayerInfo[playerid][pAdmin] = 0;
- PlayerInfo[playerid][pPremium] = 0;
- PlayerInfo[playerid][pSaw] = 0;
- PlayerInfo[playerid][pDeaths] = 0;
- PlayerInfo[playerid][pKills] = 0;
- PlayerInfo[playerid][pExp] = 0;
- PlayerInfo[playerid][pRank] = 0;
- PlayerInfo[playerid][pJuggernaut] = 0;
- PlayerInfo[playerid][pFrag] = 0;
- PlayerInfo[playerid][pOverkill] = 0;
- PlayerInfo[playerid][pCash] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- OnPlayerUpdate(playerid);
- gPlayerLogged[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if (gPlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, " Please log in before spawn!!!");
- Kick(playerid);
- return 1;
- }
- if (PlayerInfo[playerid][pFrag] == 1)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Fragx3 Perk Activated.");
- GivePlayerWeapon(playerid,16,3);
- }
- if (PlayerInfo[playerid][pOverkill] == 1)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Overkill Perk Activated.");
- GivePlayerWeapon(playerid,29,150);
- }
- if (PlayerInfo[playerid][pJuggernaut] == 1)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Juggernaut Perk Activated.");
- SetPlayerArmour(playerid,100);
- }
- new skin = GetPlayerSkin(playerid);
- if (skin == 285 && PlayerInfo[playerid][pAdmin] == 0)
- {
- SendClientMessage(playerid,COLOR_RED,"Im sorry, that is a admin skin and your not a Admin");
- SendClientMessage(playerid,COLOR_GREY,"SYSTEM: Skin Changed!!");
- SetPlayerSkin(playerid,287);
- TogglePlayerControllable(playerid,1);
- }
- if (skin == 286 && PlayerInfo[playerid][pPremium] == 0)
- {
- SendClientMessage(playerid,COLOR_RED,"Im sorry, that is a Premium silver skin and your not a Premium silver member");
- SendClientMessage(playerid,COLOR_GREY,"SYSTEM: Skin Changed!!");
- SetPlayerSkin(playerid,287);
- TogglePlayerControllable(playerid,1);
- }
- if (skin ==164 && PlayerInfo[playerid][pPremium] <= 1)
- {
- SendClientMessage(playerid,COLOR_RED,"Im sorry, that is a Premium gold skin and your not a Premium gold member");
- SendClientMessage(playerid,COLOR_GREY,"SYSTEM: Skin Changed!!");
- SetPlayerSkin(playerid,287);
- TogglePlayerControllable(playerid,1);
- }
- if (skin ==128 && PlayerInfo[playerid][pPremium] == 0)
- {
- SendClientMessage(playerid,COLOR_RED,"Im sorry, that is a Premium silver skin and your not a Premium silver member");
- SendClientMessage(playerid,COLOR_GREY,"SYSTEM: Skin Changed!!");
- SetPlayerSkin(playerid,137);
- TogglePlayerControllable(playerid,1);
- }
- if (skin ==162 && PlayerInfo[playerid][pPremium] <= 1)
- {
- SendClientMessage(playerid,COLOR_RED,"Im sorry, that is a Premium gold skin and your not a Premium gold member");
- SendClientMessage(playerid,COLOR_GREY,"SYSTEM: Skin Changed!!");
- SetPlayerSkin(playerid,137);
- TogglePlayerControllable(playerid,1);
- }
- if (skin == 186 && PlayerInfo[playerid][pAdmin] == 0)
- {
- SendClientMessage(playerid,COLOR_RED,"Im sorry, that is a admin skin and your not a Admin");
- SendClientMessage(playerid,COLOR_GREY,"SYSTEM: Skin Changed!!");
- SetPlayerSkin(playerid,137);
- TogglePlayerControllable(playerid,1);
- }
- if (skin == 287 || skin == 121 || skin == 285 || skin == 286 || skin == 164) // Soldier
- {
- Soldiersteam[playerid] = 1;
- Zombiesteam[playerid] = 0;
- SetPlayerWorldBounds(playerid, 151.5469, 46.8380, 1728.8034, 1651.3818);
- SetPlayerColor(playerid,COLOR_GREEN);
- }
- else if (skin == 137 || skin == 230 || skin == 167 || skin == 78 || skin == 162 || skin == 128) // zombies
- {
- Zombiesteam[playerid] = 1;
- Soldiersteam[playerid] = 0;
- SetPlayerWorldBounds( playerid, 10000.0, -10000.0, 10000.0, -10000.0 );
- SetPlayerColor(playerid,COLOR_RED);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if (Soldiersteam[playerid] == 1 && reason == 54)
- {
- SendClientMessage(playerid, COLOR_RED, "You have lost 1000 Dollars for Suspected suicide, if ");
- SendClientMessage(playerid, COLOR_RED, "this is a error in the Script, please report this to ");
- SendClientMessage(playerid, COLOR_RED, "the forums (www.cod-saw.tk) ");
- GivePlayerMoney(playerid,-1000);
- }
- if (Soldiersteam[playerid] == 1 && Soldiersteam[killerid] == 1) // soldiers Team Kill
- {
- SendClientMessage(killerid, COLOR_RED, "Do not Team Kill (-1000 Money)");
- GivePlayerMoney(killerid,-1000);
- }
- if (Zombiesteam[playerid] == 1 && Zombiesteam[killerid] == 1) // Zombies Team Kill
- {
- SendClientMessage(killerid, COLOR_RED, "Do not Team Kill");
- GivePlayerMoney(killerid,-1000);
- }
- if (Zombiesteam[playerid] == 0 && Zombiesteam[killerid] == 1) //Zombie kill Soldier
- {
- PlayerInfo[killerid][pExp] += 15;
- PlayerInfo[playerid][pDeaths] += 1;
- PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
- SendClientMessage(killerid,COLOR_RED," You got 750$ for the kill and 15 EXP.");
- GivePlayerMoney(killerid,750);
- }
- if (Zombiesteam[playerid] == 1 && Zombiesteam[killerid] == 0) // Soldier Kill Zombie
- {
- PlayerInfo[killerid][pExp] += 10;
- PlayerInfo[playerid][pDeaths] += 1;
- PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
- SendClientMessage(killerid,COLOR_RED," You got 500$ for the kill and 10 EXP.");
- GivePlayerMoney(killerid,500);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- cmd = strtok(cmdtext, idx);
- new tmp[256];
- new playername[MAX_PLAYER_NAME];
- if (strcmp(cmd, "/login", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- new tmppass[64];
- if(gPlayerLogged[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, " You are already logged in.");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GREY, " USAGE: /login [password]");
- return 1;
- }
- strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
- Encrypt(tmppass);
- OnPlayerLogin(playerid,tmppass);
- }
- return 1;
- }
- if (strcmp("/commands", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Account: /register, /login, /stats, /local, /help, /goals /ah");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Account: /buygun (inside Huts for Soldier), /perks, /heal /ch");
- return 1;
- }
- if (strcmp("/goals", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "*_- Unlockables throughout this server -_*");
- SendClientMessage(playerid, COLOR_YELLOW, "");
- SendClientMessage(playerid, COLOR_YELLOW, "");
- return 1;
- }
- if (strcmp("/ah", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Level 1 Admin: /check, /kick");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 2 Admin: /Money, /givemoeny");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 3 Admin: /makesaw, /veh");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 4 Admin: /makeadmin");
- return 1;
- }
- if (strcmp("/ch", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Level 1 Saw Member: ");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 2 Saw Member: ");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 3 Saw Member: /makesaw");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 4 Saw Member: ");
- SendClientMessage(playerid, COLOR_GRAD1, "Level 5 Saw Member: ");
- return 1;
- }
- if(strcmp(cmdtext, "/perks", true) == 0)
- {
- ShowMenuForPlayer(perk, playerid);
- return 1;
- }
- if (strcmp("/help", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_GREEN, "This gamemode is Nazi Zombies, The idea was taken from Call of Duty");
- SendClientMessage(playerid, COLOR_GREEN, "World At War. On this gamemode you need to choose a Side, Either Zombies");
- SendClientMessage(playerid, COLOR_GREEN, "Or soldiers, The zombies need to invade the Soldiers building and kill");
- SendClientMessage(playerid, COLOR_GREEN, "all of the soldiers and get 100 points to win. The soldiers win by surviveing");
- SendClientMessage(playerid, COLOR_GREEN, "15 minutes without letting the zombies get 100 points (10 points every");
- SendClientMessage(playerid, COLOR_GREEN, "time a zombie kills a soldier) Use /commands to see your commands.");
- return 1;
- }
- //----------------------------------[Local]-----------------------------------------------
- if(strcmp(cmd, "/local", true) == 0 || strcmp(cmd, "/l", true) == 0 || strcmp(cmd, "/say", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(gPlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
- return 1;
- }
- 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(local): %s", sendername, result);
- ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- printf("%s", string);
- }
- return 1;
- }
- if (strcmp(cmd, "/register", true)==0)
- {
- new string[265];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GREY, "USAGE: /register [password]");
- return 1;
- }
- if (gPlayerAccount[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, " That name is already registered");
- return 1;
- }
- strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
- Encrypt(PlayerInfo[playerid][pPassword]);
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), "%s.cer", playername);
- new File: file = fopen(string, io_read);
- if (file)
- {
- SendClientMessage(playerid, COLOR_GREY, " That name is already registered");
- fclose(file);
- return 1;
- }
- new File:hFile;
- hFile = fopen(string, io_append);
- new var[32];//
- format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
- format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
- format(var, 32, "Exp=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
- format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
- format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
- format(var, 32, "Juggernaut=%d\n",PlayerInfo[playerid][pJuggernaut]);fwrite(hFile, var);
- format(var, 32, "Overkill=%d\n",PlayerInfo[playerid][pOverkill]);fwrite(hFile, var);
- format(var, 32, "Frag=%d\n",PlayerInfo[playerid][pFrag]);fwrite(hFile, var);
- format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
- format(var, 32, "Premium=%d\n",PlayerInfo[playerid][pPremium]);fwrite(hFile, var);
- format(var, 32, "SAW=%d\n",PlayerInfo[playerid][pSaw]);fwrite(hFile, var);
- format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
- fclose(hFile);
- SendClientMessage(playerid, COLOR_WHITE, "Succesfully Registered!");
- SendClientMessage(playerid, COLOR_WHITE, "Next time you connect, type /login <password> to log in.");
- OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
- return 1;
- }
- if (strcmp(cmd, "/stats", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if (gPlayerLogged[playerid] != 0)
- {
- ShowStats(playerid,playerid);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in !");
- }
- }
- return 1;
- }
- if (strcmp(cmd, "/buygun", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new money = GetPlayerMoney(playerid);
- if (PlayerToPoint(2.0,playerid,100.4487,1698.9833,17.6406) && money >= 999 && Soldiersteam[playerid] == 1) // UZI gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just bought the Uzi");
- GivePlayerWeapon(playerid,28,300);
- GivePlayerMoney(playerid,-1000);
- }
- else if (PlayerToPoint(2.0,playerid,103.9912,1706.3562,17.6406) && money >=499 && Soldiersteam[playerid] == 1) // tec 9 gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just bought the Tec 9");
- GivePlayerWeapon(playerid,32,300);
- GivePlayerMoney(playerid,-500);
- }
- else if (PlayerToPoint(2.0,playerid,110.0566,1672.6910,17.5495) && money >=1499 && Soldiersteam[playerid] == 1) // ak47 gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just bought the ak47");
- GivePlayerWeapon(playerid,30,500);
- GivePlayerMoney(playerid,-1500);
- }
- else if (PlayerToPoint(2.0,playerid,119.0737,1673.7330,17.5554) && money >=2499 && Soldiersteam[playerid] == 1) // m4 gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just bought the m4");
- GivePlayerWeapon(playerid,31,500);
- GivePlayerMoney(playerid,-2000);
- }
- else if (PlayerToPoint(2.0,playerid,82.6957,1669.4307,17.5870) && money >=2999 && Soldiersteam[playerid] == 1) // spas12 gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just bought the spas12 Shotgun");
- GivePlayerWeapon(playerid,27,150);
- GivePlayerMoney(playerid,-3000);
- }
- else if (PlayerToPoint(2.0,playerid,78.7932,1677.9425,17.6406) && money >=3499 && Soldiersteam[playerid] == 1) // sawn off shotgu gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just bought the Sawn Off Shotgun");
- GivePlayerWeapon(playerid,26,300);
- GivePlayerMoney(playerid,-3500);
- }
- else if (PlayerToPoint(2.0,playerid,100.1149,1662.3073,17.3289) && money >=4999 && Soldiersteam[playerid] == 1) // sawn off shotgu gun
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just payed 5000 Dollars for the Flame Thrower");
- GivePlayerWeapon(playerid, 37,350);
- GivePlayerMoney(playerid,-5000);
- }
- }
- return 1;
- }
- if (strcmp(cmd, "/heal", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new money = GetPlayerMoney(playerid);
- if (PlayerToPoint(2.0,playerid,115.4408,1719.3175,17.6406) && money >= 999 && Soldiersteam[playerid] == 1) // health
- {
- SendClientMessage(playerid, COLOR_GRAD1, "You just got full Health back (-2500 Dollars)");
- SetPlayerHealth(playerid,100);
- GivePlayerMoney(playerid,-2500);
- }
- }
- return 1;
- }
- //-------------------------------[Check]--------------------------------------------------------------------------
- if (strcmp(cmd, "/check", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new giveplayerid;
- if (PlayerInfo[playerid][pAdmin] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /check [playerid/PartOfName]");
- return 1;
- }
- //giveplayerid = strval(tmp);
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- ShowStats(playerid,giveplayerid);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " No Such Player");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " You are not an admin");
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/veh", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if (PlayerInfo[playerid][pAdmin] < 3)
- {
- SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
- return 1;
- }
- new car;
- car = strval(tmp);
- if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611 !"); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
- return 1;
- }
- new color1;
- color1 = strval(tmp);
- if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 126 !"); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
- return 1;
- }
- new color2;
- color2 = strval(tmp);
- if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 126 !"); return 1; }
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
- CreatedCars[CreatedCar] = carid;
- CreatedCar ++;
- new string[256];
- format(string, sizeof(string), " Vehicle %d spawned.", carid);
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- return 1;
- }
- //----------------------------------[Kick]------------------------------------------------
- if(strcmp(cmd, "/kick", true) == 0)
- {
- new string[256];
- new giveplayerid;
- new giveplayer[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- 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: /kick [playerid/PartOfName] [reason]");
- return 1;
- }
- Kick(giveplayerid);
- format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
- SendClientMessageToAll(COLOR_LIGHTRED, string);
- return 1;
- }
- }
- }
- else
- {
- format(string, sizeof(string), " %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- return 1;
- }
- //----------------------------------[MAKEADMIN]------------------------------------------------
- if(strcmp(cmd, "/makeadmin", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new string[256];
- new giveplayer[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-3)]");
- return 1;
- }
- new para1;
- new level;
- para1 = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- level = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 4)
- {
- if(IsPlayerConnected(para1))
- {
- if(para1 != INVALID_PLAYER_ID)
- {
- GetPlayerName(para1, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- PlayerInfo[para1][pAdmin] = level;
- printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
- format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername);
- SendClientMessage(para1, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
- }
- }
- return 1;
- }
- //----------------------------------[MAKEprem]------------------------------------------------
- if(strcmp(cmd, "/makeprem", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new string[256];
- new giveplayer[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeprem [playerid/PartOfName] [level(1-3)]");
- return 1;
- }
- new para1;
- new level;
- para1 = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- level = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 4)
- {
- if(IsPlayerConnected(para1))
- {
- if(para1 != INVALID_PLAYER_ID)
- {
- GetPlayerName(para1, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- PlayerInfo[para1][pPremium] = level;
- printf("AdmCmd: %s has Given %s Level %d Premium level.", sendername, giveplayer, level);
- format(string, sizeof(string), " You have been give level %d Premium by %s", level, sendername);
- SendClientMessage(para1, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), " You have given %s level %d Premium.", giveplayer,level);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
- }
- }
- return 1;
- }
- //----------------------------------[MAKESAW]------------------------------------------------
- if(strcmp(cmd, "/makesaw", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new string[256];
- new giveplayer[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-3)]");
- return 1;
- }
- new para1;
- new level;
- para1 = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- level = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pSaw] >= 3 )
- {
- if(IsPlayerConnected(para1))
- {
- if(para1 != INVALID_PLAYER_ID)
- {
- GetPlayerName(para1, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- PlayerInfo[para1][pSaw] = level;
- printf("AdmCmd/ClanCmd: %s has given %s level %d Saw Member In the Server.", sendername, giveplayer, level);
- format(string, sizeof(string), " You have been given rank %d Saw Member by %s", level, sendername);
- SendClientMessage(para1, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), " You have promoted %s to a level %d Saw member.", giveplayer,level);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
- }
- }
- return 1;
- }
- //----------------------------------[Money]------------------------------------------------
- if(strcmp(cmd, "/money", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /money [playerid/PartOfName] [money]");
- return 1;
- }
- new playa;
- new money;
- playa = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- money = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- if(IsPlayerConnected(playa))
- {
- if(playa != INVALID_PLAYER_ID)
- {
- ResetPlayerMoney(playa);
- GivePlayerMoney(playa, money);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
- }
- }
- return 1;
- }
- //----------------------------------[GiveMoney]------------------------------------------------
- if(strcmp(cmd, "/givemoney", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givemoney [playerid/PartOfName] [money]");
- return 1;
- }
- new playa;
- new money;
- playa = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- money = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- if(IsPlayerConnected(playa))
- {
- if(playa != INVALID_PLAYER_ID)
- {
- GivePlayerMoney(playa, money);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
- }
- }
- return 1;
- }
- if (strcmp(cmd, "/admins", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Admins Online Right Now:");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new rrank = PlayerInfo[i][pAdmin];
- if(IsPlayerConnected(i))
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
- {
- GetPlayerName(i, sendername, sizeof(sendername));
- format(string, 256, "Admin: %s (Rank: %d)", sendername,rrank);
- SendClientMessage(playerid, COLOR_GREEN, string);
- }
- }
- }
- }
- return 1;
- }
- return 0;
- }
- public Encrypt(string[])
- {
- for(new x=0; x < strlen(string); x++)
- {
- string[x] += (3^x) * (x % 15);
- if(string[x] > (0xff))
- {
- string[x] -= 64;
- }
- }
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- new Menu:CurrentMenu = GetPlayerMenu(playerid);
- if(CurrentMenu == perk)
- {
- new money = GetPlayerMoney(playerid);
- switch(row)
- {
- case 0:
- {
- if (money >=100000)
- {
- GivePlayerMoney(playerid, -100000);
- PlayerInfo[playerid][pOverkill] = 1;
- }
- }
- case 1:
- {
- if (money >=75000)
- {
- GivePlayerMoney(playerid, -75000);
- PlayerInfo[playerid][pFrag] = 1;
- }
- }
- case 2:
- {
- if (money >=125000)
- {
- GivePlayerMoney(playerid, -125000);
- PlayerInfo[playerid][pJuggernaut] = 1;
- }
- }
- case 3:
- {
- HideMenuForPlayer(perk, playerid);
- TogglePlayerControllable(playerid, 1);
- }
- }
- }
- return 1;
- }
- public OnPlayerLogin(playerid,const string[])
- {
- new pname2[MAX_PLAYER_NAME];
- new pname3[MAX_PLAYER_NAME];
- new string2[64];
- new string3[128];
- GetPlayerName(playerid, pname2, sizeof(pname2));
- format(string2, sizeof(string2), "%s.cer", pname2);
- new File: UserFile = fopen(string2, io_read);
- if (UserFile)
- {
- new valtmp[128];
- fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
- if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
- {
- new key[128],val[128];
- new Data[128];
- while(fread(UserFile,Data,sizeof(Data)))
- {
- key = ini_GetKey(Data);
- if( strcmp( key , "Rank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRank] = strval( val ); }
- if( strcmp( key , "Exp" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExp] = strval( val ); }
- if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
- if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
- if( strcmp( key , "Juggernaut" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJuggernaut] = strval( val ); }
- if( strcmp( key , "Overkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pOverkill] = strval( val ); }
- if( strcmp( key , "Frag" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFrag] = strval( val ); }
- if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
- if( strcmp( key , "Premium" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPremium] = strval( val ); }
- if( strcmp( key , "Saw" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSaw] = strval( val ); }
- if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
- }
- fclose(UserFile);
- gPlayerLogged[playerid] = 1;
- gPlayerAccount[playerid] = 1;
- new rank = PlayerInfo[playerid][pRank];
- SetPlayerScore(playerid, rank);
- GetPlayerName(playerid, pname3, sizeof(pname3));
- format(string3, sizeof(string3), "Welcome %s, you have been succesfully logged in!", pname3);
- SendClientMessage(playerid, COLOR_WHITE,string3);
- GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
- CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Password does not match your name");
- fclose(UserFile);
- }
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(gPlayerLogged[playerid])
- {
- new string3[32];
- new pname3[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname3, sizeof(pname3));
- format(string3, sizeof(string3), "%s.cer", pname3);
- new File: pFile = fopen(string3, io_write);
- if (pFile)
- {
- new var[32];
- format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
- fclose(pFile);
- new File: hFile = fopen(string3, io_append);
- PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
- format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
- format(var, 32, "Exp=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
- format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
- format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
- format(var, 32, "Juggernaut=%d\n",PlayerInfo[playerid][pJuggernaut]);fwrite(hFile, var);
- format(var, 32, "Overkill=%d\n",PlayerInfo[playerid][pOverkill]);fwrite(hFile, var);
- format(var, 32, "Frag=%d\n",PlayerInfo[playerid][pFrag]);fwrite(hFile, var);
- format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
- format(var, 32, "Premium=%d\n",PlayerInfo[playerid][pPremium]);fwrite(hFile, var);
- format(var, 32, "Saw=%d\n",PlayerInfo[playerid][pSaw]);fwrite(hFile, var);
- format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
- fclose(hFile);
- }
- new string[50];
- new nxtlevel = PlayerInfo[playerid][pRank]+1;
- new costlevel = nxtlevel*rankcost;//1000 for testing purposes
- if (PlayerInfo[playerid][pExp] >= costlevel)
- {
- PlayerInfo[playerid][pRank]++;
- format(string, sizeof(string), "~g~Ranked Up~n~~w~You Are Now Rank %d", nxtlevel);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- PlayerPlayMusic(playerid);
- GivePlayerMoney(playerid, 10000);
- new rank = PlayerInfo[playerid][pRank];
- SetPlayerScore(playerid, rank);
- }
- }
- }
- return 1;
- }
- stock ini_GetKey( line[] )
- {
- new keyRes[128];
- keyRes[0] = 0;
- if ( strfind( line , "=" , true ) == -1 ) return keyRes;
- strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
- return keyRes;
- }
- stock ini_GetValue( line[] )
- {
- new valRes[128];
- valRes[0]=0;
- if ( strfind( line , "=" , true ) == -1 ) return valRes;
- strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
- return valRes;
- }
- 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;
- }
- public PlayerPlayMusic(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- SetTimer("StopMusic", 5000, 0);
- PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
- }
- }
- public StopMusic()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- PlayerPlaySound(i, 1069, 0.0, 0.0, 0.0);
- }
- }
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- 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;
- }
- public AntiGunCheat()
- {
- for(new i; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (Soldiersteam[i] == 1)
- {
- if (GetPlayerWeapon(i) == 22 || GetPlayerWeapon(i) == 29 || GetPlayerWeapon(i) == 16 || GetPlayerWeapon(i) == 0 || GetPlayerWeapon(i) == 26 || GetPlayerWeapon(i) == 27 || GetPlayerWeapon(i) == 28 || GetPlayerWeapon(i) == 30 || GetPlayerWeapon(i) == 31 || GetPlayerWeapon(i) == 32 || GetPlayerWeapon(i) == 37)
- {
- }
- else
- {
- SendClientMessage(i, COLOR_RED, "you are Banned for weapon Hacking, Please go to www.cod-saw.tk To appeal");
- Kick(i);
- }
- }
- else if (Zombiesteam[i] == 1)
- {
- if (GetPlayerWeapon(i) == 24 || GetPlayerWeapon(i) == 29 || GetPlayerWeapon(i) == 16 || GetPlayerWeapon(i) == 0 || GetPlayerWeapon(i) == 33)
- {
- }
- else
- {
- SendClientMessage(i, COLOR_RED, "you are Banned for weapon Hacking, Please go to www.cod-saw.tk To appeal");
- Kick(i);
- }
- }
- }
- }
- }
- public AntiMoneyCheat()
- {
- for(new i; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(LastMoney[i] > 0)
- {
- if(GetPlayerMoney(i) - LastMoney[i] > 3000 && PlayerInfo[i][pAdmin] < 2)
- {
- SendClientMessage(i, 0xFF0000AA, "Suspected Money Cheater, Money set back to 10,000 Dollars");
- ResetPlayerMoney(i);
- GivePlayerMoney(i, 10000);
- Kick(i);
- }
- }
- LastMoney[i] = GetPlayerMoney(i);
- }
- }
- }
- /*public gametime()
- {
- for(new i; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- SendClientMessageToAll(COLOR_YELLOW, "Round Over..Restarting Gamemode in 10 seconds.");
- SetTimer("gametime2", 10000, 0); // 15 secs
- }
- }
- }
- //public gametime2()
- {
- for(new i; i<MAX_PLAYERS; i++)
- {
- OnPlayerUpdate(i);
- GameModeExit();
- }
- }
- */
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- 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))
- {
- 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);
- }
- }
- }//not connected
- return 1;
- }
- public ShowStats(playerid,targetid)
- {
- if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
- {
- new jugger[20];
- if(PlayerInfo[targetid][pJuggernaut] == 0) { jugger = "No"; }
- else if(PlayerInfo[targetid][pJuggernaut] == 1) { jugger = "Yes"; }
- new Overkill[20];
- if(PlayerInfo[targetid][pOverkill] == 0) { Overkill = "No"; }
- else if(PlayerInfo[targetid][pOverkill] == 1) { Overkill = "Yes"; }
- new Frag[20];
- if(PlayerInfo[targetid][pFrag] == 0) { Frag = "No"; }
- else if(PlayerInfo[targetid][pFrag] == 1) { Frag = "Yes"; }
- new Premium[20];
- if(PlayerInfo[targetid][pPremium] == 0) { Premium = "Bronze"; }
- else if(PlayerInfo[targetid][pPremium] == 1) { Premium = "Silver"; }
- else if(PlayerInfo[targetid][pPremium] == 2) { Premium = "Gold"; }
- new Saw[20];
- if(PlayerInfo[targetid][pSaw] == 0) { Saw = "Not A Member"; }
- else if(PlayerInfo[targetid][pSaw] == 1) { Saw = "Recruit(Rank 1)"; }
- else if(PlayerInfo[targetid][pSaw] == 2) { Saw = "Member(Rank 2)"; }
- else if(PlayerInfo[targetid][pSaw] == 3) { Saw = "Moderator(Rank 3)"; }
- else if(PlayerInfo[targetid][pSaw] == 4) { Saw = "Leaders(Rank 4)"; }
- else if(PlayerInfo[targetid][pSaw] == 5) { Saw = "Founder(Rank 5)"; }
- new nxtlevel = PlayerInfo[playerid][pRank]+1;
- new costlevel = nxtlevel*rankcost;
- new cash = GetPlayerMoney(targetid);
- new deaths = PlayerInfo[targetid][pDeaths];
- new Admin = PlayerInfo[targetid][pAdmin];
- new kills = PlayerInfo[targetid][pKills];
- new rank = PlayerInfo[targetid][pRank];
- new exp = PlayerInfo[targetid][pExp];
- new togo = nxtlevel*costlevel;
- new name[MAX_PLAYER_NAME];
- GetPlayerName(targetid, name, sizeof(name));
- new Float:px,Float:py,Float:pz;
- GetPlayerPos(targetid, px, py, pz);
- new coordsstring[256];
- SendClientMessage(playerid, COLOR_RED,"________________________________________");
- format(coordsstring, sizeof(coordsstring),"*** %s ***",name);
- SendClientMessage(playerid, COLOR_WHITE,coordsstring);
- format(coordsstring, sizeof(coordsstring), "Rank:[%d] Experience:[%d] Exp_to_go:[%d] Kills:[%d] Deaths:[%d] Cash:[$%d] AdminLevel:[%d]",rank,exp,togo,kills,deaths,cash,Admin);
- SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
- format(coordsstring, sizeof(coordsstring), "Saw_Clan_Position:[%s] Premium_Position:[%s]",Saw,Premium);
- SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
- SendClientMessage(playerid, COLOR_RED, "_______________*_Perks_*_______________");
- format(coordsstring, sizeof(coordsstring), "Juggernaut:[%s] Overkill:[%s] Frag:[%s]",jugger, Overkill, Frag);
- SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
- SendClientMessage(playerid, COLOR_RED,"________________________________________");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement