Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Zombie Survival v2.0
- Made by Jelly23
- */
- /*Includes*/
- #include <a_samp>
- #include <sscanf2>
- #include <izcmd>
- #include <a_mysql>
- #include <TextMenu>
- #include <foreach>
- /*Variables*/
- new global[128];
- new banrowid[MAX_PLAYERS];
- new banrowname[MAX_PLAYERS][24];
- new banrowname2[MAX_PLAYERS][24];
- new addbaname[MAX_PLAYERS][24];
- new LBAN2[MAX_PLAYERS][31][24];
- new LBAN[MAX_PLAYERS][31];
- /*Whirlpool*/
- native WP_Hash(buffer[], len, const str[]);
- /*Enumerator - PlayerInfo*/
- enum playerinfo
- {
- ID,
- Pass[129],
- Logged,
- Level,
- Cash,
- Kills,
- Deaths
- };
- new PlayerInfo[MAX_PLAYERS][playerinfo];
- /*Map System*/
- new mapid,
- Mapname[50],
- HumanX[30],
- HumanY[30],
- HumanZ[30],
- ZombieX[30],
- ZombieY[30],
- ZombieZ[30],
- Duration,
- Time,
- Weather,
- Interior,
- Filterscript[30];
- /*Colors*/
- #define HUMAN_COLOR (0x0000BBAA)
- #define ZOMBIE_COLOR (0xAA3333AA)
- /*Teams*/
- #define HUMAN (0)
- #define ZOMBIE (1)
- /*Timers*/
- new mTimer;
- /*Dialogs*/
- #define DIALOG_REGISTER (0)
- #define DIALOG_LOGIN (1)
- #define DIALOG_BANLIST (3)
- #define DIALOG_BANLIST2 (4)
- #define DIALOG_BANLIST3 (5)
- #define DIALOG_BANLIST4 (6)
- #define DIALOG_BANLIST5 (7)
- #define DIALOG_BANLIST6 (8)
- #define DIALOG_BANLIST7 (9)
- #define DIALOG_BANLIST8 (10)
- #define DIALOG_BANLIST9 (11)
- #define DIALOG_BANLIST10 (12)
- #define DIALOG_BANLIST11 (13)
- #define DIALOG_MAPLIST (14)
- #define DIALOG_MAPLIST2 (15)
- #define DIALOG_MAPLIST3 (16)
- #define DIALOG_MAPLIST4 (17)
- #define DIALOG_MAPLIST5 (18)
- #define DIALOG_MAPLIST6 (19)
- /*TextDraw Menus*/
- #define MENU_OTHER (0)
- #define MENU_SHOP (1)
- /*MySQL*/
- #define host "localhost"
- #define user "root"
- #define db "zombie"
- #define pass ""
- /*Textdraws*/
- new Text:Zombie_Draws[11]; //Time and team info.
- new mysql;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Zombie Survival - v1.0");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- DisableInteriorEnterExits(); //Disables interior entrances/exit
- UsePlayerPedAnims(); // Uses standard player walking animation (animation of the CJ skin) instead of custom animations for every skin
- mysql_format(mysql, global, sizeof(global), "SELECT * FROM `maps` ORDER BY RAND() LIMIT 1");
- mysql_tquery(mysql, global, "LoadMaps", "");
- mTimer = SetTimer("MapTimer", 1000, true); //Map timer
- SetGameModeText("Zombie Survival v1.0"); //Mode Text
- AddPlayerClass(162,2296.5662,2451.6270,10.8203,87.8270,0,0,0,0,0,0);
- mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
- mysql = mysql_connect(host, user, db, pass);
- if(mysql_errno(mysql) != 0)
- {
- print("Could not connect to database!"); SendRconCommand("hostname MYSQL ERROR");
- }
- else
- {
- printf("MYSQL: Connected Successfully To Database (%s)",db);
- }
- Zombie_Draws[0] = TextDrawCreate(28.000000, 303.000000, "box");
- TextDrawLetterSize(Zombie_Draws[0], 0.000000, 3.500000);
- TextDrawTextSize(Zombie_Draws[0], 146.875000, 0.000000);
- TextDrawAlignment(Zombie_Draws[0], 1);
- TextDrawColor(Zombie_Draws[0], -1);
- TextDrawUseBox(Zombie_Draws[0], 1);
- TextDrawBoxColor(Zombie_Draws[0], 125);
- TextDrawSetShadow(Zombie_Draws[0], 0);
- TextDrawSetOutline(Zombie_Draws[0], 0);
- TextDrawBackgroundColor(Zombie_Draws[0], 120);
- TextDrawFont(Zombie_Draws[0], 1);
- TextDrawSetProportional(Zombie_Draws[0], 1);
- TextDrawSetShadow(Zombie_Draws[0], 0);
- Zombie_Draws[1] = TextDrawCreate(43.799865, 303.000000, "Humans:_20~n~Zombies:_10");
- TextDrawLetterSize(Zombie_Draws[1], 0.400000, 1.600000);
- TextDrawAlignment(Zombie_Draws[1], 1);
- TextDrawColor(Zombie_Draws[1], -1);
- TextDrawSetShadow(Zombie_Draws[1], 0);
- TextDrawSetOutline(Zombie_Draws[1], 1);
- TextDrawBackgroundColor(Zombie_Draws[1], 255);
- TextDrawFont(Zombie_Draws[1], 1);
- TextDrawSetProportional(Zombie_Draws[1], 1);
- TextDrawSetShadow(Zombie_Draws[1], 0);
- Zombie_Draws[2] = TextDrawCreate(28.000045, 339.299774, "box");
- TextDrawLetterSize(Zombie_Draws[2], 0.000000, -0.437500);
- TextDrawTextSize(Zombie_Draws[2], 146.688766, 0.000000);
- TextDrawAlignment(Zombie_Draws[2], 1);
- TextDrawColor(Zombie_Draws[2], -5963521);
- TextDrawUseBox(Zombie_Draws[2], 1);
- TextDrawBoxColor(Zombie_Draws[2], -5963521);
- TextDrawSetShadow(Zombie_Draws[2], 0);
- TextDrawSetOutline(Zombie_Draws[2], 0);
- TextDrawBackgroundColor(Zombie_Draws[2], 255);
- TextDrawFont(Zombie_Draws[2], 1);
- TextDrawSetProportional(Zombie_Draws[2], 1);
- TextDrawSetShadow(Zombie_Draws[2], 0);
- Zombie_Draws[3] = TextDrawCreate(28.000045, 302.197509, "box");
- TextDrawLetterSize(Zombie_Draws[3], 0.000000, -0.437500);
- TextDrawTextSize(Zombie_Draws[3], 146.688766, 0.000000);
- TextDrawAlignment(Zombie_Draws[3], 1);
- TextDrawColor(Zombie_Draws[3], -5963521);
- TextDrawUseBox(Zombie_Draws[3], 1);
- TextDrawBoxColor(Zombie_Draws[3], -5963521);
- TextDrawSetShadow(Zombie_Draws[3], 0);
- TextDrawSetOutline(Zombie_Draws[3], 0);
- TextDrawBackgroundColor(Zombie_Draws[3], 255);
- TextDrawFont(Zombie_Draws[3], 1);
- TextDrawSetProportional(Zombie_Draws[3], 1);
- TextDrawSetShadow(Zombie_Draws[3], 0);
- Zombie_Draws[4] = TextDrawCreate(151.999389, 339.900177, "box");
- TextDrawLetterSize(Zombie_Draws[4], 0.000000, -4.682541);
- TextDrawTextSize(Zombie_Draws[4], 146.688171, 0.000000);
- TextDrawAlignment(Zombie_Draws[4], 1);
- TextDrawColor(Zombie_Draws[4], -5963521);
- TextDrawUseBox(Zombie_Draws[4], 1);
- TextDrawBoxColor(Zombie_Draws[4], -5963521);
- TextDrawSetShadow(Zombie_Draws[4], 0);
- TextDrawSetOutline(Zombie_Draws[4], 0);
- TextDrawBackgroundColor(Zombie_Draws[4], 255);
- TextDrawFont(Zombie_Draws[4], 1);
- TextDrawSetProportional(Zombie_Draws[4], 1);
- TextDrawSetShadow(Zombie_Draws[4], 0);
- Zombie_Draws[5] = TextDrawCreate(28.198883, 339.900177, "box");
- TextDrawLetterSize(Zombie_Draws[5], 0.000000, -4.682541);
- TextDrawTextSize(Zombie_Draws[5], 22.887638, 0.000000);
- TextDrawAlignment(Zombie_Draws[5], 1);
- TextDrawColor(Zombie_Draws[5], -5963521);
- TextDrawUseBox(Zombie_Draws[5], 1);
- TextDrawBoxColor(Zombie_Draws[5], -5963521);
- TextDrawSetShadow(Zombie_Draws[5], 0);
- TextDrawSetOutline(Zombie_Draws[5], 0);
- TextDrawBackgroundColor(Zombie_Draws[5], 255);
- TextDrawFont(Zombie_Draws[5], 1);
- TextDrawSetProportional(Zombie_Draws[5], 1);
- TextDrawSetShadow(Zombie_Draws[5], 0);
- Zombie_Draws[6] = TextDrawCreate(49.899772, 284.698883, "Team_Info");
- TextDrawLetterSize(Zombie_Draws[6], 0.400000, 1.600000);
- TextDrawAlignment(Zombie_Draws[6], 1);
- TextDrawColor(Zombie_Draws[6], -1);
- TextDrawSetShadow(Zombie_Draws[6], 0);
- TextDrawSetOutline(Zombie_Draws[6], 1);
- TextDrawBackgroundColor(Zombie_Draws[6], 255);
- TextDrawFont(Zombie_Draws[6], 1);
- TextDrawSetProportional(Zombie_Draws[6], 1);
- TextDrawSetShadow(Zombie_Draws[6], 0);
- Zombie_Draws[7] = TextDrawCreate(558.996826, 28.000167, "250");
- TextDrawLetterSize(Zombie_Draws[7], 0.400000, 1.600000);
- TextDrawAlignment(Zombie_Draws[7], 1);
- TextDrawColor(Zombie_Draws[7], -1);
- TextDrawSetShadow(Zombie_Draws[7], 0);
- TextDrawSetOutline(Zombie_Draws[7], 1);
- TextDrawBackgroundColor(Zombie_Draws[7], 255);
- TextDrawFont(Zombie_Draws[7], 2);
- TextDrawSetProportional(Zombie_Draws[7], 1);
- TextDrawSetShadow(Zombie_Draws[7], 0);
- Zombie_Draws[8] = TextDrawCreate(548.000000, 32.200271, "box");
- TextDrawLetterSize(Zombie_Draws[8], 0.000000, 0.881999);
- TextDrawTextSize(Zombie_Draws[8], 603.750000, 0.000000);
- TextDrawAlignment(Zombie_Draws[8], 1);
- TextDrawColor(Zombie_Draws[8], -1);
- TextDrawUseBox(Zombie_Draws[8], 1);
- TextDrawBoxColor(Zombie_Draws[8], 125);
- TextDrawSetShadow(Zombie_Draws[8], 0);
- TextDrawSetOutline(Zombie_Draws[8], 0);
- TextDrawBackgroundColor(Zombie_Draws[8], 120);
- TextDrawFont(Zombie_Draws[8], 1);
- TextDrawSetProportional(Zombie_Draws[8], 1);
- TextDrawSetShadow(Zombie_Draws[8], 0);
- Zombie_Draws[9] = TextDrawCreate(558.996337, 14.999958, "Time");
- TextDrawLetterSize(Zombie_Draws[9], 0.400000, 1.600000);
- TextDrawAlignment(Zombie_Draws[9], 1);
- TextDrawColor(Zombie_Draws[9], -1);
- TextDrawSetShadow(Zombie_Draws[9], 0);
- TextDrawSetOutline(Zombie_Draws[9], 1);
- TextDrawBackgroundColor(Zombie_Draws[9], 255);
- TextDrawFont(Zombie_Draws[9], 1);
- TextDrawSetProportional(Zombie_Draws[9], 1);
- TextDrawSetShadow(Zombie_Draws[9], 0);
- Zombie_Draws[10] = TextDrawCreate(49.899772, 426.500671, "Map:");
- TextDrawLetterSize(Zombie_Draws[10], 0.400000, 1.600000);
- TextDrawAlignment(Zombie_Draws[10], 1);
- TextDrawColor(Zombie_Draws[10], -1);
- TextDrawSetShadow(Zombie_Draws[10], 0);
- TextDrawSetOutline(Zombie_Draws[10], 1);
- TextDrawBackgroundColor(Zombie_Draws[10], 255);
- TextDrawFont(Zombie_Draws[10], 1);
- TextDrawSetProportional(Zombie_Draws[10], 1);
- TextDrawSetShadow(Zombie_Draws[10], 0);
- return 1;
- }
- ERROR(playerid,msg[]) //Sends an error message
- {
- format(global,128,"{FF0000}[ERROR]:{FFFFFF} %s",msg);
- return SendClientMessage(playerid,-1,global);
- }
- forward MapTimer();
- public MapTimer()
- {
- Duration -= 1; //Map time decreasing
- new count[4];
- format(count,sizeof(count),"%i",Duration);
- TextDrawSetString(Zombie_Draws[7],count);
- TextDrawShowForAll(Zombie_Draws[7]);
- if(Duration <= 0) //Map Over, switching maps...
- {
- HumansWin();
- }
- if(Duration == 200) //Random zombie, and the next players to spawn wont be in human team.
- {
- new randomid = Iter_Random(Player); //A random player id will be stored in "randomid" var
- format(global,sizeof(global),"{FFFF00}[INFECTION]: {FFFFFF}%s has become a zombie.",GetName(randomid));
- SendClientMessageToAll(-1,global); //Sends the message letting everybody know who is the infected
- SetPlayerZombie(randomid); //Sets the random player's team to zombie
- UpdateTeams();
- }
- foreach(new i: Player)
- {
- SetPlayerScore(i,PlayerInfo[i][Kills]);
- if(GetCash(i) < GetPlayerMoney(i))
- {
- ResetPlayerMoney(i);
- GivePlayerMoney(i,PlayerInfo[i][Cash]);
- }
- }
- }
- UpdateTeams()//Updates the team info textdraw
- {
- new infodraw[36];
- format(infodraw,sizeof(infodraw),"~b~Humans:_%i~n~~r~Zombies:_%i",GetTeamCount(HUMAN),GetTeamCount(ZOMBIE));
- TextDrawSetString(Zombie_Draws[1],infodraw);
- TextDrawShowForAll(Zombie_Draws[1]);
- }
- HumansWin() //Humans Survived
- {
- KillTimer(mTimer); //Kills the timer
- foreach(new i: Player) //Loops through all players
- {
- if(GetPlayerTeam(i) == HUMAN)
- {
- GiveCash(i,10000); //Gives them all 10k
- }
- TextMenuShowForPlayer(i,MENU_OTHER,"Humans Survived","~w~ Every ~b~human~w~ has received ~g~$10,000"); //Shows the menu to everybody
- }
- SetTimer("Reset", 5000, false); //Will restart the map system
- }
- ZombiesWin() //Zombies win
- {
- KillTimer(mTimer); //Kills the timer
- foreach(new i: Player) //Loops through all players
- {
- GiveCash(i,5000); //Gives them all 50k
- TextMenuShowForPlayer(i,MENU_OTHER,"Zombies Win","~w~ Every ~r~zombie~w~ has received ~g~$5,000"); //Shows the menu to everybody
- }
- SetTimer("Reset", 5000, false); //Will restart the map system
- }
- forward Reset();//New dynamic map system
- public Reset()
- {
- new query[128];
- if(strcmp(Filterscript, "None"))
- {
- format(query,90,"unloadfs %s",Filterscript);
- SendRconCommand(query);
- }
- mysql_format(mysql, query, sizeof(query), "SELECT * FROM `maps` ORDER BY RAND() LIMIT 1");
- mysql_tquery(mysql, query, "LoadMaps", "");
- }
- forward LoadMaps(); //Loads the maps
- public LoadMaps()
- {
- new TurfS = cache_get_row_count();
- for(new i = 0; i < TurfS; i++)
- {
- mapid = cache_get_field_content_int(i,"mapid");
- cache_get_field_content(i, "Mapname", Mapname, mysql, 50);
- cache_get_field_content(i, "HumanX", HumanX, mysql, 30);
- cache_get_field_content(i, "HumanY", HumanY, mysql, 30);
- cache_get_field_content(i, "HumanZ", HumanZ, mysql, 30);
- cache_get_field_content(i, "ZombieX", ZombieX, mysql, 30);
- cache_get_field_content(i, "ZombieY", ZombieY, mysql, 30);
- cache_get_field_content(i, "ZombieZ", ZombieZ, mysql, 30);
- Duration = cache_get_field_content_int(i,"Duration");
- Time = cache_get_field_content_int(i,"Time");
- Weather = cache_get_field_content_int(i,"Weather");
- Interior = cache_get_field_content_int(i,"Interior");
- cache_get_field_content(i, "Filterscript", Filterscript, mysql, 30);
- }
- new str[90];
- format(str,90,"Map: %s (%d)",Mapname,mapid);
- TextDrawSetString(Zombie_Draws[10],str);
- TextDrawShowForAll(Zombie_Draws[10]);
- if(strcmp(Filterscript, "None"))
- {
- format(str,90,"loadfs %s",Filterscript);
- SendRconCommand(str);
- }
- SetWorldTime(Time);
- SetWeather(Weather);
- foreach(new p: Player) TextMenuHideForPlayer(p),SpawnPlayer(p); //Players are spawned
- mTimer = SetTimer("MapTimer", 1000, true); //MapTimer starts again
- }
- GetName(playerid) //Gets somebody's name
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- stock Float:GetDistanceBetweenPlayers(playerid,targetplayerid)
- {
- new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
- if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetplayerid))
- {
- return -1.00;
- }
- GetPlayerPos(playerid,x1,y1,z1);
- GetPlayerPos(targetplayerid,x2,y2,z2);
- return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
- }
- SetPlayerZombie(playerid) //Sets a specific player to zombie
- {
- SetPlayerColor(playerid,ZOMBIE_COLOR); //Sets the player's color to zombie team's
- SetPlayerTeam(playerid,ZOMBIE); //Player is officialy in zombie team
- SetPlayerHealth(playerid,100); //Sets the health to 100
- switch(random(4)) //Sets the specific player's skin to four random skins
- {
- case 0: SetPlayerSkin(playerid,162);
- case 1: SetPlayerSkin(playerid,135);
- case 2: SetPlayerSkin(playerid,137);
- case 3: SetPlayerSkin(playerid,196);
- }
- ResetPlayerWeapons(playerid);
- ClearAnimations(playerid); //Clears the animations, so you don't get stuck after being set
- }
- forward GetClosestPlayer(p1);
- public GetClosestPlayer(p1)
- {
- new Float:dis,Float:dis2,player;
- player = -1;
- dis = 99999.99;
- foreach(Player,x)
- {
- if(x != p1)
- {
- dis2 = GetDistanceBetweenPlayers(x,p1);
- if(dis2 < dis && dis2 != -1.00)
- {
- dis = dis2;
- player = x;
- }
- }
- }
- return player;
- }
- SetPlayerHuman(playerid) //Sets a specific player to human
- {
- switch(random(8)) //Sets the specific player's skin to eight random skins
- {
- case 0: SetPlayerSkin(playerid,165);
- case 1: SetPlayerSkin(playerid,166);
- case 2: SetPlayerSkin(playerid,154);
- case 3: SetPlayerSkin(playerid,0);
- case 4: SetPlayerSkin(playerid,150);
- case 5: SetPlayerSkin(playerid,147);
- case 6: SetPlayerSkin(playerid,143);
- case 7: SetPlayerSkin(playerid,126);
- }
- SetPlayerColor(playerid,HUMAN_COLOR); //The specific player gets human color
- SetPlayerTeam(playerid,HUMAN); //You are officialy added in human team
- SetPlayerHealth(playerid,100); //Health set back to 100
- GivePlayerWeapon(playerid,24,400); //Desert eagle (24) is given to humans by default
- ClearAnimations(playerid); //Clears the animations, so you don't get stuck after being set
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 2296.5662,2451.6270, 10.8203);
- SetPlayerFacingAngle(playerid, 87.8270);
- SetPlayerCameraPos(playerid, 2293.3640,2451.7341,12.8203);
- SetPlayerCameraLookAt(playerid, 2296.5662,2451.6270, 10.8203);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- UpdateTeams();
- TextDrawShowForPlayer(playerid,Zombie_Draws[10]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[9]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[8]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[7]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[6]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[5]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[4]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[3]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[2]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[1]);
- TextDrawShowForPlayer(playerid,Zombie_Draws[0]);
- PlayerInfo[playerid][Logged] = 0;
- mysql_format(mysql, global, sizeof(global),"SELECT * FROM `bans` WHERE `b_name` = '%e' or `b_ip` ='%s' LIMIT 1", GetName(playerid),GetIp(playerid));
- mysql_tquery(mysql, global, "OnBanCheck", "i", playerid);
- return 1;
- }
- KickEx(playerid)
- {
- SetTimerEx("DelayedKick", 1000, false, "i", playerid);
- }
- forward DelayedKick(playerid);
- public DelayedKick(playerid)
- {
- Kick(playerid);
- return 1;
- }
- forward OnBanCheck(playerid);
- public OnBanCheck(playerid)
- {
- new rows,fields;
- new adm[24],res[50],time[50],origin[24];
- cache_get_data(rows, fields, mysql);
- if(rows)
- {
- cache_get_field_content(0, "b_admin", adm, mysql, 24);
- cache_get_field_content(0, "b_reason", res, mysql,50);
- cache_get_field_content(0, "b_time", time, mysql, 50);
- cache_get_field_content(0, "b_name", origin, mysql, 24);
- TogglePlayerSpectating(playerid,true);
- SendClientMessage(playerid,0xFF0080FF,"----------------------------------------------------------------------------------------------------------");
- SendClientMessage(playerid,0xFF0080FF,"* You are banned from this server.");
- format(global,128,"* Account: %s",origin);
- format(global,128,"* Admin: %s",adm);
- format(global,128,"* Reason: %s / Time: %s",res,time);
- SendClientMessage(playerid,0xFF0080FF,"----------------------------------------------------------------------------------------------------------");
- KickEx(playerid);
- }
- else
- {
- new query[128];
- format(global,sizeof global,"%s has joined the server.",GetName(playerid));
- SendClientMessageToAll(0xFFFFFFAA,global);
- mysql_format(mysql, query, sizeof(query),"SELECT `pass` FROM `players` WHERE `name` = '%e'", GetName(playerid));
- mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
- }
- }
- forward OnAccountCheck(playerid);
- public OnAccountCheck(playerid)
- {
- new rows, fields,string[400];
- cache_get_data(rows, fields, mysql);
- if(rows)
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are already registered\nPlease enter your password to log into your account", GetName(playerid));
- cache_get_field_content(0, "pass", PlayerInfo[playerid][Pass], mysql, 129);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login",string,"Login","");
- }
- else
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are not registered\nPlease enter a password to register your account", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register",string,"Register","");
- }
- }
- GetTeamCount(teamid)
- {
- new teamcount = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(GetPlayerState(i) == PLAYER_STATE_NONE) continue;
- if(GetPlayerTeam(i) != teamid) continue;
- teamcount++;
- }
- return teamcount;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new reasons[14];
- switch(reason)
- {
- case 0: reasons = "Timeout/Crash";
- case 1: reasons = "Quit";
- case 2: reasons = "Kick/Ban";
- }
- format(global, sizeof global, "%s has left the server (%s).", GetName(playerid), reasons);
- SendClientMessageToAll(0xC4C4C4FF, global);
- SavePlayer(playerid);
- PlayerInfo[playerid][Kills] = 0;
- PlayerInfo[playerid][Deaths] = 0;
- PlayerInfo[playerid][Cash] = 0;
- PlayerInfo[playerid][Level] = 0;
- if(GetTeamCount(HUMAN) == 0)
- {
- ZombiesWin();
- }
- UpdateTeams();
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(Duration <= 200) //if Duration is 200 or below, next players to spawn will automatically be zombies
- {
- SetPlayerZombie(playerid); //Player is set to zombie team
- }
- else //if Duration is above 200, any player to spawn becomes human
- {
- SetPlayerHuman(playerid); //Player is set to human team
- }
- if(GetPlayerTeam(playerid) == ZOMBIE)
- {
- SetPlayerInterior(playerid,Interior);
- SetPlayerPos(playerid,floatstr(ZombieX),floatstr(ZombieY),floatstr(ZombieZ));
- }
- else
- {
- SetPlayerPos(playerid,floatstr(HumanX),floatstr(HumanY),floatstr(HumanZ));
- SetPlayerInterior(playerid,Interior);
- }
- UpdateTeams();
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(GetTeamCount(HUMAN) == 0)
- {
- ZombiesWin();
- }
- SendDeathMessage(killerid,playerid,reason);
- PlayerInfo[playerid][Deaths]++;
- if(killerid != INVALID_PLAYER_ID)
- {
- GiveCash(killerid,2455);
- PlayerInfo[killerid][Kills]++;
- SendClientMessage(killerid,-1,"{FFFF00}[KILL]: {FFFFFF}You received $2455 for killing somebody.");
- format(global,128,"{FFFF00}[DEATH]: {FFFFFF}You have been killed by %s.",GetName(killerid));
- SendClientMessage(playerid,-1,global);
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_FIRE)
- {
- if(GetPlayerTeam(playerid) == ZOMBIE)
- {
- if(Duration <= 0) return ERROR(playerid,"Map is over, wait for the next one.");
- new humanvictim = GetClosestPlayer(playerid);
- if(IsPlayerConnected(humanvictim))
- {
- if(GetDistanceBetweenPlayers(playerid,humanvictim) < 3)
- {
- SetPlayerZombie(humanvictim);
- PlayerInfo[playerid][Kills]++;
- GiveCash(playerid,3200);
- SendClientMessage(playerid,-1,"{FFFF00}[INFECT]: {FFFFFF}You received $3200 for infecting somebody.");
- SendDeathMessage(playerid, humanvictim, 255);
- format(global,128,"{FFFF00}[INFECT]: {FFFFFF}You have been infected by %s.",GetName(playerid));
- SendClientMessage(humanvictim,-1,global);
- UpdateTeams();
- if(GetTeamCount(HUMAN) == 0)
- {
- ZombiesWin();
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerCommandReceived(playerid,cmdtext[])
- {
- if(PlayerInfo[playerid][Logged] == 0)
- {
- ERROR(playerid,"You must be logged in to use any command.");
- return 0;
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- SavePlayer(playerid)
- {
- if(PlayerInfo[playerid][Logged] == 1)
- {
- new query[256];
- mysql_format(mysql, query, sizeof(query),"UPDATE `players` SET `kills`='%d', `deaths`='%d', `cash`='%d', `Level`='%d' WHERE `name` = '%e'",PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths],PlayerInfo[playerid][Cash],PlayerInfo[playerid][Level],GetName(playerid));
- mysql_tquery(mysql, query, "", "");
- }
- }
- ResetCash(playerid)
- {
- PlayerInfo[playerid][Cash] = 0;
- ResetPlayerMoney(playerid);
- }
- GetCash(playerid)
- {
- return PlayerInfo[playerid][Cash];
- }
- GiveCash(playerid,cash)
- {
- PlayerInfo[playerid][Cash] += cash;
- GivePlayerMoney(playerid,cash);
- }
- forward GetLastBans(playerid);
- public GetLastBans(playerid)
- {
- new count,raw = cache_get_row_count(),lastbans[1000],Gn[MAX_PLAYER_NAME],AdminB[MAX_PLAYER_NAME],bTime[30],bReason[50];
- format(lastbans, sizeof(lastbans),"{FFFFFF}Name\t{FFFFFF}Admin\t{FFFFFF}Date\t{FFFFFF}Reason\n");
- for(new i=0; i < raw; i ++ )
- {
- LBAN[playerid][count] = cache_get_field_content_int(i,"bid");
- cache_get_field_content(i,"b_name",Gn,mysql,MAX_PLAYER_NAME);
- format(LBAN2[playerid][count],24,"%s",Gn);
- cache_get_field_content(i,"b_admin",AdminB,mysql,MAX_PLAYER_NAME);
- cache_get_field_content(i,"b_time",bTime,mysql,30);
- cache_get_field_content(i,"b_reason",bReason,mysql,50);
- format(lastbans, sizeof(lastbans), "%s\n%s\t%s\t%s\t%s", lastbans, Gn, AdminB, bTime, bReason);
- count++;
- }
- ShowPlayerDialog(playerid, DIALOG_BANLIST3, DIALOG_STYLE_TABLIST_HEADERS, "Ban List", lastbans, "Select", "Cancel");
- }
- forward MapEditor(playerid,mapidz);
- public MapEditor(playerid,mapidz)
- {
- new zcount = 0,raw = cache_get_row_count(),LittleString[90];
- for(new i=0; i < raw; i ++ )
- {
- zcount++;
- }
- if(zcount == 0) return ERROR(playerid,"There is no such map!");
- format(LittleString,sizeof(LittleString),"You are editing mapid %i",mapidz);
- ShowPlayerDialog(playerid, DIALOG_MAPLIST2, DIALOG_STYLE_LIST, LittleString,"Set Interior\nSet Time\nSet Weather\nSet Duration\nDelete Map", "Continue","Close");
- return 1;
- }
- forward EditBans(playerid,editname);
- public EditBans(playerid,editname)
- {
- new zcount = 0,raw = cache_get_row_count(),LittleString[90],Gn[24];
- format(LittleString,sizeof(LittleString),"You are editing %s's ban",editname);
- for(new i=0; i < raw; i ++ )
- {
- zcount++;
- cache_get_field_content(i,"b_admin",Gn,mysql,MAX_PLAYER_NAME);
- banrowid[playerid] = cache_get_field_content_int(i,"bid");
- format(banrowname2[playerid],24,"%s",Gn);
- }
- if(zcount == 0) return SendClientMessage(playerid,-1,"Error: there is no such ban!");
- ShowPlayerDialog(playerid, DIALOG_BANLIST8, DIALOG_STYLE_LIST, LittleString,"Player's Name\nAdmin's Name\nReason", "Continue","Close");
- return 1;
- }
- forward OnAccountRegister(playerid);
- public OnAccountRegister(playerid)
- {
- SendClientMessage(playerid, -1, "{FF0000}[ACCOUNT]: {FFFFFF}Successfully registered.");
- }
- forward OnAccountLoad(playerid);
- public OnAccountLoad(playerid)
- {
- PlayerInfo[playerid][ID] = cache_get_field_content_int(0, "id");
- PlayerInfo[playerid][Level] = cache_get_field_content_int(0, "Level");
- PlayerInfo[playerid][Cash] = cache_get_field_content_int(0, "cash");
- PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "kills");
- PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "deaths");
- PlayerInfo[playerid][Logged] = 1;
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid,PlayerInfo[playerid][Cash]);
- SendClientMessage(playerid, -1, "{FF0000}[ACCOUNT]: {FFFFFF}Successfully logged in.");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_REGISTER)
- {
- new string[200];
- if(!response)
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are not registered\nPlease enter a password to register your account\n{FF0000}Please Register", GetName(playerid));
- return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register",string,"Register","");
- }
- if (strlen(inputtext) < 4 || strlen(inputtext) > 20)
- {
- format(string, sizeof(string),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are not registered\nPlease enter a password to register your account\n{FF0000}Password too short or either long", GetName(playerid));
- return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register",string,"Register","");
- }
- new query[600];
- WP_Hash(PlayerInfo[playerid][Pass], 129, inputtext);
- mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`name`,`Level`, `pass`, `kills`, `deaths`, `cash`, `IP`) VALUES ('%e','0','%e', 0, 0, 0, '%e')", GetName(playerid),PlayerInfo[playerid][Pass],GetIp(playerid));
- mysql_tquery(mysql, query, "OnAccountRegister", "d", playerid);
- PlayerInfo[playerid][Logged] = 1;
- SendClientMessage(playerid, -1, "{FFFF00}[ACCOUNT]: {FFFFFF}Account succesfuly registered.");
- PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if(response)
- {
- new hpass[129],query[128];
- WP_Hash(hpass, 129, inputtext);
- if(!strcmp(hpass, PlayerInfo[playerid][Pass]))
- {
- mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `name` = '%e' LIMIT 1", GetName(playerid));
- mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
- }
- else
- {
- format(query, sizeof(query),"{FFFF00}Welcome {0080FF}%s, {FFFF00}you are already registered\nPlease enter your password to log into your account", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login",query,"Login","");
- }
- }
- else
- {
- KickEx(playerid);
- }
- }
- if(dialogid == DIALOG_BANLIST11)
- {
- if(response)
- {
- mysql_format(mysql,global,sizeof(global),"UPDATE `bans` SET `b_name`= '%e' WHERE `bid`= '%d'",inputtext,banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- format(banrowname[playerid],24,"%s",inputtext);
- SendClientMessage(playerid,-1,"{FFFF00}[BANLIST]: {FFFFFF}Name successfuly changed.");
- }
- }
- if(dialogid == DIALOG_BANLIST10)
- {
- if(response)
- {
- mysql_format(mysql,global,sizeof(global),"UPDATE `bans` SET `b_admin`= '%e' WHERE `bid`= '%d'",inputtext,banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- SendClientMessage(playerid,-1,"{FFFF00}[BANLIST]: {FFFFFF}Admin's name successfuly changed.");
- }
- }
- if(dialogid == DIALOG_BANLIST9)
- {
- if(response)
- {
- mysql_format(mysql,global,sizeof(global),"UPDATE `bans` SET `b_reason`= '%e' WHERE `bid`= '%d'",inputtext,banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- SendClientMessage(playerid,-1,"{FFFF00}[BANLIST]: {FFFFFF}Reason successfuly changed.");
- }
- }
- if(dialogid == DIALOG_BANLIST8)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,DIALOG_BANLIST11, DIALOG_STYLE_INPUT, "Player's Name", "Enter a new name", "Change", "Cancel");
- case 1:
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"Only level 3 admins can use that feature");
- ShowPlayerDialog(playerid,DIALOG_BANLIST10, DIALOG_STYLE_INPUT, "Admin's Name", "Enter a new admin name", "Change", "Cancel");
- }
- case 2: ShowPlayerDialog(playerid,DIALOG_BANLIST9, DIALOG_STYLE_INPUT, "Reason", "Enter a new reason", "Change", "Cancel");
- }
- }
- }
- if(dialogid == DIALOG_BANLIST5)
- {
- if(response)
- {
- mysql_format(mysql,global, sizeof(global), "SELECT * FROM `bans` WHERE `b_name` = '%e' LIMIT 1",inputtext);
- mysql_tquery(mysql,global, "EditBans", "ds",playerid,inputtext);
- format(banrowname[playerid],24,"%s",inputtext);
- }
- }
- if(dialogid == DIALOG_BANLIST7)
- {
- if(response)
- {
- format(global,sizeof(global),"%s %s",addbaname[playerid], inputtext);
- cmd_offban(playerid,global);
- }
- }
- if(dialogid == DIALOG_BANLIST6)
- {
- if(response)
- {
- format(addbaname[playerid],24,"%s",inputtext);
- ShowPlayerDialog(playerid,DIALOG_BANLIST7, DIALOG_STYLE_INPUT, "Add Ban", "Enter a reason", "Confirm", "Cancel");
- }
- }
- if(dialogid == DIALOG_BANLIST4)
- {
- if(response)
- {
- mysql_format(mysql,global, sizeof(global), "SELECT * FROM `bans` WHERE `b_name` LIKE '%%%s%%' OR `b_ip` LIKE '%%%s%%' ORDER BY `bid` DESC LIMIT 10",inputtext,inputtext);
- mysql_tquery(mysql,global, "GetLastBans", "d",playerid);
- }
- }
- if(dialogid == DIALOG_BANLIST3)
- {
- if(response)
- {
- if(PlayerInfo[playerid][Level] >= 2)
- {
- banrowid[playerid] = LBAN[playerid][listitem];
- format(banrowname2[playerid],24,"%s",LBAN2[playerid][listitem]);
- ShowPlayerDialog(playerid, DIALOG_BANLIST2, DIALOG_STYLE_MSGBOX, "Ban Info", "Would you like to unban that player?", "Unban", "Cancel");
- }
- }
- }
- if(dialogid == DIALOG_BANLIST2)
- {
- if(response)
- {
- mysql_format(mysql, global, sizeof(global),"DELETE FROM `bans` WHERE `bid` = '%d' LIMIT 1",banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- mysql_format(mysql, global, sizeof(global), "UPDATE `players` SET `Banned`= %d WHERE `b_name`='%e'",0,banrowname2[playerid]);
- mysql_tquery(mysql, global, "QueryComplete", "");
- format(global, sizeof(global),"{FF0000}[BANLIST]: {FFFFFF}You have successfully removed ban id %d",banrowid[playerid]);
- SendClientMessage(playerid,-1,global);
- }
- }
- if(dialogid == DIALOG_BANLIST)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- mysql_format(mysql,global,sizeof(global),"SELECT * FROM `bans` ORDER BY `bid` DESC LIMIT 30");
- mysql_tquery(mysql,global, "GetLastBans", "d",playerid);
- }
- case 1:
- {
- ShowPlayerDialog(playerid,DIALOG_BANLIST4, DIALOG_STYLE_INPUT, "Search Bans", "Enter a name and results will show up", "Search", "Cancel");
- }
- case 2:
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a level 3!");
- ShowPlayerDialog(playerid,DIALOG_BANLIST5, DIALOG_STYLE_INPUT, "Edit Bans", "Enter a ban name to edit it", "Confirm", "Cancel");
- }
- case 3:
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a level 3!");
- ShowPlayerDialog(playerid,DIALOG_BANLIST6, DIALOG_STYLE_INPUT, "Add Ban", "Enter a Player's name", "Confirm", "Cancel");
- }
- }
- }
- }
- if(dialogid == DIALOG_MAPLIST)
- {
- if(response)
- {
- banrowid[playerid] = strval(inputtext);
- mysql_format(mysql,global, sizeof(global), "SELECT * FROM `maps` WHERE `mapid` = '%d' LIMIT 1",banrowid[playerid]);
- mysql_tquery(mysql,global, "MapEditor", "dd",playerid,banrowid[playerid]);
- }
- }
- if(dialogid == DIALOG_MAPLIST2)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,DIALOG_MAPLIST3, DIALOG_STYLE_INPUT, "Interior", "Enter a new interior ID below", "Confirm", "Cancel");
- case 1: ShowPlayerDialog(playerid,DIALOG_MAPLIST4, DIALOG_STYLE_INPUT, "Time", "Below goes the new map time", "Confirm", "Cancel");
- case 2: ShowPlayerDialog(playerid,DIALOG_MAPLIST5, DIALOG_STYLE_INPUT, "Weather", "Below goes the weather ID", "Confirm", "Cancel");
- case 3: ShowPlayerDialog(playerid,DIALOG_MAPLIST6, DIALOG_STYLE_INPUT, "Map Duration", "Minimum = 255","Confirm", "Cancel");
- case 4:
- {
- mysql_format(mysql, global, sizeof(global),"DELETE FROM `maps` WHERE `mapid` = '%d' LIMIT 1",banrowid[playerid]);
- mysql_tquery(mysql, global,"","");
- format(global,sizeof(global),"{FF0000}[MAP]: {FFFFFF}You removed map id %i",banrowid[playerid]);
- SendClientMessage(playerid,-1,global);
- }
- }
- }
- }
- if(dialogid == DIALOG_MAPLIST3)
- {
- if(response)
- {
- mysql_format(mysql, global, sizeof(global), "UPDATE `maps` SET `Interior`= %d WHERE `mapid`='%d'",strval(inputtext),banrowid[playerid]);
- mysql_tquery(mysql, global, "QueryComplete", "");
- format(global,sizeof(global),"{FF0000}[MAP]: {FFFFFF}You have set map id %i's interior to %i",banrowid[playerid],strval(inputtext));
- SendClientMessage(playerid,-1,global);
- }
- }
- if(dialogid == DIALOG_MAPLIST4)
- {
- if(response)
- {
- mysql_format(mysql, global, sizeof(global), "UPDATE `maps` SET `Time`= %d WHERE `mapid`='%d'",strval(inputtext),banrowid[playerid]);
- mysql_tquery(mysql, global, "QueryComplete", "");
- format(global,sizeof(global),"{FF0000}[MAP]: {FFFFFF}You have set map id %i's world time to %i",banrowid[playerid],strval(inputtext));
- SendClientMessage(playerid,-1,global);
- }
- }
- if(dialogid == DIALOG_MAPLIST5)
- {
- if(response)
- {
- mysql_format(mysql, global, sizeof(global), "UPDATE `maps` SET `Weather`= %d WHERE `mapid`='%d'",strval(inputtext),banrowid[playerid]);
- mysql_tquery(mysql, global, "QueryComplete", "");
- format(global,sizeof(global),"{FF0000}[MAP]: {FFFFFF}You have set map id %i's weather to %i",banrowid[playerid],strval(inputtext));
- SendClientMessage(playerid,-1,global);
- }
- }
- if(dialogid == DIALOG_MAPLIST6)
- {
- if(response)
- {
- mysql_format(mysql, global, sizeof(global), "UPDATE `maps` SET `Duration`= %d WHERE `mapid`='%d'",strval(inputtext),banrowid[playerid]);
- mysql_tquery(mysql, global, "QueryComplete", "");
- format(global,sizeof(global),"{FF0000}[MAP]: {FFFFFF}You have set map id %i's duration to %i",banrowid[playerid],strval(inputtext));
- SendClientMessage(playerid,-1,global);
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnTextMenuResponse(playerid,menuid,listitem)
- {
- if(menuid == MENU_SHOP)
- {
- if(GetPlayerTeam(playerid) == ZOMBIE) return ERROR(playerid,"Nice try.");
- switch(listitem)
- {
- case 1:
- {
- if(GetCash(playerid) < 2500) return ERROR(playerid,"You need $2500 in order to buy this weapon.");
- GiveCash(playerid,-2500);
- GivePlayerWeapon(playerid,25,100);
- }
- case 2:
- {
- if(GetCash(playerid) < 4300) return ERROR(playerid,"You need $4300 in order to buy this weapon.");
- GiveCash(playerid,-4300);
- GivePlayerWeapon(playerid,30,100);
- }
- case 3:
- {
- if(GetCash(playerid) < 5000) return ERROR(playerid,"You need $5000 in order to buy this weapon.");
- GiveCash(playerid,-5000);
- GivePlayerWeapon(playerid,31,100);
- }
- case 4:
- {
- if(GetCash(playerid) < 3400) return ERROR(playerid,"You need $3400 in order to buy this weapon.");
- GiveCash(playerid,-3400);
- GivePlayerWeapon(playerid,29,100);
- }
- case 5:
- {
- if(GetCash(playerid) < 1500) return ERROR(playerid,"You need $1500 in order to buy this weapon.");
- GiveCash(playerid,-1500);
- GivePlayerWeapon(playerid,24,100);
- }
- case 6:
- {
- if(GetCash(playerid) < 6500) return ERROR(playerid,"You need $6500 in order to buy this weapon.");
- GiveCash(playerid,-6500);
- GivePlayerWeapon(playerid,27,150);
- }
- case 7:
- {
- if(GetCash(playerid) < 7500) return ERROR(playerid,"You need $7500 in order to buy this weapon.");
- GiveCash(playerid,-7500);
- GivePlayerWeapon(playerid,34,150);
- }
- case 8:
- {
- if(GetCash(playerid) < 3000) return ERROR(playerid,"You need $3000 in order to buy an armor.");
- GiveCash(playerid,-3000);
- SetPlayerArmour(playerid,100);
- }
- }
- }
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(!success)
- {
- ERROR(playerid,"Invalid command! please take a look into /cmds");
- }
- return 1;
- }
- GetTeamName(playerid)
- {
- new tname[10];
- if(GetPlayerTeam(playerid) == HUMAN)
- {
- tname = "~b~Human";
- }
- else
- {
- tname = "~r~Zombie";
- }
- return tname;
- }
- GetPlayerAdmin(playerid)
- {
- new rankname[25];
- switch(PlayerInfo[playerid][Level])
- {
- case 1: rankname = "~b~Moderator";
- case 2: rankname = "~g~Administrator";
- case 3: rankname = "~p~Manager";
- case 4: rankname = "~r~Owner";
- }
- return rankname;
- }
- GetIp(playerid)
- {
- new ip[16];
- GetPlayerIp(playerid, ip, 16);
- return ip;
- }
- BanPlayer(admin[],id,resa[])
- {
- SetPlayerPos(id,197.6661,173.8179,1003.0234);
- SetPlayerInterior(id,3);
- SetCameraBehindPlayer(id);
- new Year, Month, Day,tima[80],Query[600],Hour, Minute, Second;
- getdate(Year, Month, Day);
- gettime(Hour, Minute, Second);
- format(tima,sizeof(tima),"%d/%d/%d | %02d:%02d",Day,Month,Year,Hour,Minute);
- mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `bans` (`b_name`,`b_ip`,`b_admin`,`b_reason`,`b_time`) VALUES ('%s','%s','%s','%s','%s')",GetName(id),GetIp(id),admin,resa,tima);
- mysql_tquery(mysql, Query,"","");
- KickEx(id);
- return 1;
- }
- /*Commands*/
- CMD:commands(playerid) return cmd_cmds(playerid);
- CMD:cmds(playerid)
- {
- new Cmds[350];
- strcat(Cmds," ~y~/stats~n~");
- strcat(Cmds," ~y~/credits~n~");
- strcat(Cmds," ~y~/savestats~n~");
- strcat(Cmds," ~y~/kill~n~");
- strcat(Cmds," ~y~/shop~n~");
- strcat(Cmds," ~y~/admins~n~");
- strcat(Cmds," ~y~/rules~n~");
- strcat(Cmds," ~y~/report");
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Commands",Cmds);
- return 1;
- }
- CMD:rules(playerid)
- {
- new Rules[350];
- strcat(Rules," ~y~1-~w~ Respect admins/players~n~");
- strcat(Rules," ~y~2-~w~ Cheating/Hacking will lead to a ban~n~");
- strcat(Rules," ~y~3-~w~ You may not ask for score/cash/level~n~");
- strcat(Rules," ~y~4-~w~ You may not abuse bugs, report them~n~");
- strcat(Rules," ~y~5-~w~ C-Bug isn't allowed here~n~");
- strcat(Rules," ~y~6-~w~ You may not disturb admins~n~");
- strcat(Rules," ~y~7-~w~ Banned? Do not evade, appeal at forums~n~");
- strcat(Rules," ~y~8-~w~ Racism isn't tolerated in here");
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Rules",Rules);
- return 1;
- }
- CMD:credits(playerid)
- {
- new Credits[29];
- strcat(Credits,"~y~ Developer: ~w~Jelly23");
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Credits",Credits);
- return 1;
- }
- CMD:stats(playerid)
- {
- new Stats[210];
- format(Stats,204," ~y~Name: ~w~%s~n~ ~y~Admin Level: ~w~%i~n~ ~y~Cash: ~g~$%i~n~ ~y~Kills: ~w~%i~n~ ~y~Deaths: ~w~%i~n~ ~y~Team: ~w~%s",
- GetName(playerid),PlayerInfo[playerid][Level],GetCash(playerid),PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths],GetTeamName(playerid));
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Statistics",Stats);
- return 1;
- }
- CMD:savestats(playerid)
- {
- SavePlayer(playerid);
- SendClientMessage(playerid,-1,"{FFFF00}[STATS]: {FFFFFF}Stats saved!");
- return 1;
- }
- CMD:kill(playerid) return SetPlayerHealth(playerid,0),SendClientMessage(playerid,-1,"{FF0000}[SUICIDE]: {FFFFFF}You killed yourself");
- CMD:shop(playerid)
- {
- if(GetPlayerTeam(playerid) != HUMAN) return ERROR(playerid,"You must be a human to use this command.");
- if(Duration < 200) return ERROR(playerid,"You can't buy anymore weapons once the first zombie appears. Wait for the next round.");
- new Shop[350];
- strcat(Shop," ~r~1-~w~ Shotgun (~g~$2500~w~)~n~");
- strcat(Shop," ~r~2-~w~ AK47 (~g~$4300~w~)~n~");
- strcat(Shop," ~r~3-~w~ M4 (~g~$5000~w~)~n~");
- strcat(Shop," ~r~4-~w~ MP5 (~g~$3400~w~)~n~");
- strcat(Shop," ~r~5-~w~ Desert Eagle (~g~$1500~w~)~n~");
- strcat(Shop," ~r~6-~w~ Combat Shotgun (~g~$6500~w~)~n~");
- strcat(Shop," ~r~7-~w~ Sniper Rifle (~g~$7500~w~)~n~");
- strcat(Shop," ~r~8-~w~ Armor (~g~$3000~w~)");
- TextMenuShowForPlayer(playerid,MENU_SHOP,"Shop",Shop,8);
- return 1;
- }
- CMD:admins(playerid)
- {
- new admins[1500],count;
- foreach(new i: Player)
- {
- if(PlayerInfo[i][Level] >= 1)
- {
- count++;
- format(admins,sizeof(admins)," ~y~%s-_%s(%d)_-_%s~n~",admins,GetName(i),i,GetPlayerAdmin(i));
- }
- }
- if(count == 0)
- {
- admins = " No ~r~admins ~w~online right now";
- }
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Admins",admins);
- return 1;
- }
- CMD:acmds(playerid)
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new ACMDS[350];
- strcat(ACMDS," ~b~Level 1:~w~ /warn /kick /spec /specoff /spawn /slap~n~");
- strcat(ACMDS," ~g~Level 2:~w~ /banlist /ban /unban /weaps /disarm /giveallcash~n~");
- strcat(ACMDS," ~p~Level 3:~w~ /offban /setlevel /setkills /setdeaths /resetcash~n~");
- strcat(ACMDS," ~r~Level 4:~w~ /setweather /settime /gmx /setcash~n~");
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Admin Commands",ACMDS);
- return 1;
- }
- CMD:warn(playerid, params[])
- {
- new id, reason[24];
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- if(sscanf(params, "us[24]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /warn [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{FF0000}[WARN]: %s has been warned by %s [Reason: %s]", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(-1, global);
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- new id, reason[24];
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- if(sscanf(params, "us[24]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{FF0000}[KICK]: %s has been kicked by %s [Reason: %s]", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(-1, global);
- KickEx(id);
- return 1;
- }
- CMD:spec(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /spec [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- if(IsPlayerInAnyVehicle(id))
- {
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
- }
- else
- {
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, id);
- }
- return 1;
- }
- CMD:specoff(playerid)
- {
- if(PlayerInfo[playerid][Level] == 0) return 0;
- TogglePlayerSpectating(playerid, 0);
- SpawnPlayer(playerid);
- return 1;
- }
- CMD:spawn(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /spawn [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- SpawnPlayer(id);
- format(global,sizeof(global),"{FFFF00}[SPAWN]: {FFFFFF}You have spawned '%s'",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[SPAWN]: {FFFFFF}You have been spawned by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 1) return ERROR(playerid,"You must be a moderator to use this command.");
- new Float:xPos[3],id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /slap [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- GetPlayerPos(id,xPos[0],xPos[1],xPos[2]);
- SetPlayerPos(id,xPos[0],xPos[1],xPos[2]+7);
- format(global,sizeof(global),"{FFFF00}[SLAP]: {FFFFFF}You have slapped '%s'",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[SLAP]: {FFFFFF}You have been slapped by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:ban(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- new id, reason[50];
- if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid,-1,"USAGE: /ban [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- if(PlayerInfo[playerid][Level] <= PlayerInfo[id][Level]) return ERROR(playerid,"You can't ban that player.");
- format(global, sizeof(global), "{FF0000}[BAN]: {FFFFFF}%s has been banned by %s [Reason: %s]", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(-1, global);
- BanPlayer(GetName(playerid),id,reason);
- return 1;
- }
- CMD:unban(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- new target[50];
- if(sscanf(params,"s[50]", target)) return SendClientMessage(playerid,-1,"USAGE: /unban [name]");
- mysql_format(mysql, global, sizeof(global),"SELECT * FROM `bans` WHERE `b_name` ='%e' OR `b_ip` ='%e' LIMIT 1",target,target);
- mysql_tquery(mysql, global,"OnAccountUnban","ds",playerid,target);
- return 1;
- }
- forward OnAccountUnban(playerid,tar[]);
- public OnAccountUnban(playerid,tar[])
- {
- new rows, fields;
- cache_get_data(rows, fields, mysql);
- if(rows)
- {
- new Query[200];
- mysql_format(mysql, Query, sizeof(Query),"DELETE FROM `bans` WHERE `b_name` = '%e' or `b_ip` ='%e' LIMIT 1",tar,tar);
- mysql_tquery(mysql, Query,"","");
- format(global, sizeof(global),"{00FF00}[UNBAN]: {FFFFFF}You have successfully unbanned account/ip %s",tar);
- SendClientMessage(playerid,-1,global);
- }
- else
- {
- ERROR(playerid,"No such ban found.");
- }
- return 1;
- }
- CMD:weaps(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] >= 2)
- {
- new count = 0;
- new ammo, weaponid, weapon[30], string26[150], id;
- if(!sscanf(params, "u", id))
- {
- for (new c = 0; c < 13; c++)
- {
- GetPlayerWeaponData(id, c, weaponid, ammo);
- if (weaponid != 0 && ammo != 0)
- {
- count++;
- }
- }
- SendClientMessage(playerid, -1, "||{FF8000}============={FFFF00} Weapons And Ammo {FF8000}===========||");
- if(count > 0)
- {
- for (new c = 0; c < 13; c++)
- {
- GetPlayerWeaponData(id, c, weaponid, ammo);
- if (weaponid != 0 && ammo != 0)
- {
- GetWeaponName(weaponid, weapon, 24);
- format(string26, sizeof(string26), "{00FF00}Weapons: {A8FFA8}%s {FF0000}.:. {00FF00}Ammo: {A8FFA8}%d", weapon, ammo);
- SendClientMessage(playerid, -1, string26);
- }
- }
- }
- else
- {
- ERROR(playerid,"This player has no weapons.");
- }
- return 1;
- }
- else return SendClientMessage(playerid, -1, "USAGE: /weaps [id]");
- }
- else return ERROR(playerid,"You must be an administrator to use this command.");
- }
- CMD:disarm(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- new id;
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /disarm [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- ResetPlayerWeapons(id);
- format(global,sizeof(global),"{FFFF00}[DISARM]: {FFFFFF}You have disarmed '%s'",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[DISARM]: {FFFFFF}You have been disarmed by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:giveallcash(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be an administrator to use this command.");
- if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /giveallcash [cash]");
- new strt[200];
- foreach(new i: Player)
- {
- GiveCash(i,strval(params));
- }
- format(strt,127," %s ~w~%s has given everyone ~g~$%i",GetPlayerAdmin(playerid),GetName(playerid),strval(params));
- TextMenuShowForPlayer(playerid,MENU_OTHER,"Cash",strt);
- return 1;
- }
- CMD:offban(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- new target[24],reason[50];
- if(sscanf(params, "s[24]s[50]", target, reason)) return SendClientMessage(playerid,-1,"USAGE: /offban [account] [reason]");
- mysql_format(mysql,global,sizeof(global),"SELECT * FROM `players` WHERE `name` = '%e' LIMIT 1",target);
- mysql_tquery(mysql,global,"OnAccountBan","dss",playerid,target,reason);
- return 1;
- }
- forward OnAccountBan(playerid,target[],offreason[]);
- public OnAccountBan(playerid,target[],offreason[])
- {
- new zcount=0,raw = cache_get_row_count(),ggwzd[20],Query[200];
- for(new i=0; i < raw; i ++ )
- {
- zcount++;
- cache_get_field_content(i,"IP",ggwzd,mysql,20);
- }
- if(zcount == 0) return ERROR(playerid,"No such account found.");
- new tima[80];
- new Year, Month, Day;
- getdate(Year, Month, Day);
- new Hour, Minute, Second;
- gettime(Hour, Minute, Second);
- format(tima,sizeof(tima),"%d/%d/%d | %d:%d",Day,Month,Year,Hour,Minute);
- mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `bans` (`b_name`,`b_ip`,`b_admin`,`b_reason`,`b_time`) VALUES ('%s','%s','%s','%s','%s')",target,ggwzd,GetName(playerid),offreason,tima);
- mysql_tquery(mysql, Query,"","");
- format(global,sizeof(global),"{FFFF00}[OFF-BAN]: {FFFFFF}You have offline-banned %s [Reason: %s]", target, offreason );
- SendClientMessage(playerid,-1,global);
- return 1;
- }
- CMD:setlevel(playerid, params[])
- {
- new id,level;
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "USAGE: /setlevel [playerid] [level]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- if(level < 0) return ERROR(playerid,"Levels are between 0-4 only");
- if(level > 4) return ERROR(playerid,"Levels are between 0-4 only");
- format(global, sizeof(global), "{00FF00}[LEVEL]: {FFFFFF}Your level was set to '%i' by %s.", level,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[LEVEL]: {FFFFFF}You have given level '%i' to %s.", level,GetName(id));
- SendClientMessage(playerid,-1, global);
- PlayerInfo[id][Level] = level;
- return 1;
- }
- CMD:setkills(playerid, params[])
- {
- new id,kill;
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- if(sscanf(params, "ud", id, kill)) return SendClientMessage(playerid, -1, "USAGE: /setkills [playerid] [kills]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{00FF00}[KILLS]: {FFFFFF}Your kills were set to '%i' by %s.", kill,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[KILLS]: {FFFFFF}You have set %s's kills to %i.",GetName(id),kill);
- SendClientMessage(playerid,-1, global);
- PlayerInfo[id][Kills] = kill;
- return 1;
- }
- CMD:setdeaths(playerid, params[])
- {
- new id,kill;
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- if(sscanf(params, "ud", id, kill)) return SendClientMessage(playerid, -1, "USAGE: /setdeaths [playerid] [deaths]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}Your deaths were set to '%i' by %s.", kill,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}You have set %s's deaths to %i.",GetName(id),kill);
- SendClientMessage(playerid,-1, global);
- PlayerInfo[id][Deaths] = kill;
- return 1;
- }
- CMD:resetcash(playerid, params[])
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- new id;
- if(sscanf(params, "ud", id)) return SendClientMessage(playerid, -1, "USAGE: /resetcash [playerid]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- ResetCash(id);
- format(global,sizeof(global),"{FFFF00}[RESET]: {FFFFFF}You have reset %s's cash",GetName(id));
- SendClientMessage(playerid,-1,global);
- format(global,sizeof(global),"{FFFF00}[RESET]: {FFFFFF}Your cash was reset by '%s'",GetName(playerid));
- SendClientMessage(id,-1,global);
- return 1;
- }
- CMD:settime(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] < 4) return ERROR(playerid,"You must be an owner to use this command.");
- if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /settime [time]");
- SetWorldTime(strval(params));
- return 1;
- }
- CMD:setweather(playerid,params[])
- {
- if(PlayerInfo[playerid][Level] < 4) return ERROR(playerid,"You must be an owner to use this command.");
- if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /setweather [time]");
- SetWeather(strval(params));
- return 1;
- }
- CMD:setcash(playerid, params[])
- {
- new id,kill;
- if(PlayerInfo[playerid][Level] < 4) return ERROR(playerid,"You must be an owner to use this command.");
- if(sscanf(params, "ud", id, kill)) return SendClientMessage(playerid, -1, "USAGE: /setcash [playerid] [cash]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}Your cash was set to $%i by %s.", kill,GetName(playerid));
- SendClientMessage(id,-1, global);
- format(global, sizeof(global), "{00FF00}[DEATHS]: {FFFFFF}You have set %s's cash to $%i.",GetName(id),kill);
- SendClientMessage(playerid,-1, global);
- ResetCash(id);
- GiveCash(id,kill);
- return 1;
- }
- CMD:report(playerid, params[])
- {
- new id,reason[50];
- if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /report [playerid] [reason]");
- if (id == INVALID_PLAYER_ID) return ERROR(playerid,"Player isn't online.");
- format(global, sizeof(global), "{FF0000}[REPORT]: {FFFFFF}%s has reported %s(%i). [Reason: %s]", GetName(playerid),GetName(id),id,reason);
- foreach(new I: Player)
- {
- if(PlayerInfo[I][Level] >= 1) SendClientMessage(I,-1, global);
- }
- SendClientMessage(playerid,-1,"{FFFF00}[REPORT]: {FFFFFF}Your report was sent to the staff, wait for a response!");
- return 1;
- }
- CMD:banlist(playerid)
- {
- if(PlayerInfo[playerid][Level] < 2) return ERROR(playerid,"You must be a moderator to use this command.");
- ShowPlayerDialog(playerid, DIALOG_BANLIST, DIALOG_STYLE_LIST, "{FFFF00}Ban List","Last Bans\nFind Bans\nEdit Bans\nAdd Ban", "Close","");
- return 1;
- }
- CMD:mapeditor(playerid)
- {
- if(PlayerInfo[playerid][Level] < 3) return ERROR(playerid,"You must be a manager to use this command.");
- ShowPlayerDialog(playerid,DIALOG_MAPLIST, DIALOG_STYLE_INPUT, "Map Editor", "Enter a mapid below:", "Edit", "Cancel");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement