Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <sscanf2>
- //Command Use
- #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- //Login Register System
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- //Save Path
- #define PATH "/NAdmin/Users/%s.ini"
- #define reportPATH "/NAdmin/Config/ReportLog.txt" //directory for reports, in the folder "scriptfiles"
- //Colors
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- //COLORS 2
- #define COLOR_GREEN 0x008000FF
- #define COLOR_BLUE 0x0000FFFF
- #define COLOR_BRIGHTRED 0xFF000AAA
- #define COLOR_AQUA 0x00FFFFAA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_BEIGE 0xFFF8DCAA
- #define COLOR_BLACK 0x000000AA
- #define COLOR_LIGHTERBLUE 0x00BFFFAA
- #define COLOR_BLUELIGHT 0x1E90FFAA
- #define COLOR_BLUEMEDIUM 0x0000CDAA
- #define COLOR_BLUEDARK 0x00008BAA
- #define COLOR_PINK 0xFF1493AA
- #define COLOR_PINKDARK 0xFF00FFAA
- #define COLOR_GREENLIGHT 0x00FF00AA
- #define COLOR_GREENDARK 0x006400AA
- #define COLOR_MAROON 0x800000AA
- #define COLOR_OKER 0x808000AA
- #define COLOR_ORANGE 0xFF4500AA
- #define COLOR_ORANGELIGHT 0xFF8C00AA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_VIOLETDARK 0x9400D3AA
- #define COLOR_INDIGO 0xAB0082AA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_SAND 0xFFDEADAA
- #define COLOR_SILVER 0xC0C0C0AA
- #define COLOR_TEAL 0x008080AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GOLD 0xFFD700AA
- #define COLOR_BROWN 0x8B4513AA
- #define COLOR_BROWNLIGHT 0xA0522DAA
- #define COLOR_GRAY 0xA9A9A9AA
- #define COLOR_GRAYDARK 0x696969AA
- #define COLOR_INVISIBLE 0xFFFFFF00
- #define COLOR_INDIA 0x80000096
- #define COLOR_PAKISTAN 0x40808096
- #define COLOR_NEPAL 0x8000FF96
- #define COLOR_BRAZIL 0xB7B70096
- #define COLOR_CHINA 0x80808096
- #define COLOR_GREECE 0x00000096
- #define COLOR_SINGAPORE 0x00FFFF96
- #define COLOR_IRAQ 0x8080C096
- //Admin Command Variables
- #define MAX_WARNINGS 3
- //Admin Level
- //Cmd Variables
- //Server Messages
- forward SendRandomMsgToAll();
- //Vip System
- new vip[MAX_PLAYERS];
- //Admin System
- new AdminLevel[MAX_PLAYERS];
- new Warns[MAX_PLAYERS];
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- pScore
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("Donor",vip[playerid]);
- INI_Int("Score",PlayerInfo[playerid][pScore]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- stock udb_hash(buf[]) {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public SendRandomMsgToAll()
- {
- switch(random(4))// "switch - case" is a sort of "if - else if - else" statement (operator?)
- {
- case 1: SendClientMessageToAll(COLOR_RED, "Please Type /help To Get Help From Server");
- case 2: SendClientMessageToAll(COLOR_RED, "Please Type /cmds To Know Server Commands!");
- case 3: SendClientMessageToAll(COLOR_RED, "Please Respect Everyone In Server.");
- case 4: SendClientMessageToAll(COLOR_RED, "Welcome To Our Server And As You Are New These Are The Basics You Need To Know.");
- }
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Nirzor's Admin System V1.5 ");
- print("--------------------------------------\n");
- SetTimer("SendRandomMsgToAll", 60 * 1000, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Please Type Your Desired Password To Log In.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Please Type A Password To Register An Account.","Register","Quit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"Donor",vip[playerid]);
- INI_WriteInt(File,"Score",GetPlayerScore(playerid));
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- #if defined USE_STATS
- CMD:stats(playerid,params[]) {
- new string[256], pDeaths, player1, h, m, s,playername[MAX_PLAYER_NAME];
- if(isnull(params)) player1 = playerid;
- else player1 = strval(params);
- if(IsPlayerConnected(player1)) {
- TotalGameTime(player1, h, m, s);
- GetPlayerName(player1, playername, sizeof(playername));
- if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
- format(string,sizeof(string),"{F9FF88}|-| %s's Stats |-|\n \nScores: %d\n \nKills %d\n \nDeaths %d\n \nRatio: %0.2f\n \nMoney: $%d\n \nAdmin Level: %d\n \nModerator: %d\n \nTime: %d hrs %d mins %d secs\n \nFor other information use /stats!",playername, GetPlayerScore(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths, GetPlayerMoney(player1), PlayerInfo[player1][Level], PlayerInfo[player1][Helper], h, m, s);
- return ShowPlayerDialog(playerid, 11111,DIALOG_STYLE_MSGBOX,"{FFFF00}Player Status",string,"Close","");
- } else return SendClientMessage(playerid, red, "Player Not Connected!");
- }
- #endif
- CMD:helpme(playerid, params[])
- {
- new str[128], Name1[MAX_PLAYER_NAME];
- if(sscanf(params,"s", str))
- {
- SendClientMessage(playerid, COLOR_RED,"CORRECT USAGE: /helpme [text]");
- return 1;
- }
- GetPlayerName(playerid, Name1, sizeof(Name1));
- format(str, sizeof(str),"{00FFFF}[HELP MSG From %s]:{00FFF0} %s",Name1, str);
- MessageToTwice(COLOR_RED, str);
- SendClientMessage(playerid, COLOR_YELLOW,"Your Request has been sent to online Administrators.");
- return 1;
- }
- CMD:heal(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- SetPlayerHealth(playerid, 100); //if he's allowed, restore his health
- SendClientMessage(playerid, COLOR_GREEN, "Your Health Has Been Restored To 100"); // and send him the success-message
- CMDMessageToAdmins(playerid,"HEAL");
- }
- else
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!"); // if not, send him only the following message
- }
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- new PID; //define the playerid we wanna kick
- new reason[64]; //the reason, put into a string
- new str[128]; //a new message string
- new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
- GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
- GetPlayerName(PID, Playername, sizeof(Playername));
- if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
- if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
- return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- format(str, sizeof(str), "'%s' Has Been Kicked By Administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
- SendClientMessageToAll(COLOR_RED, str); //send that message to all
- CMDMessageToAdmins(playerid,"KICK");
- Kick(PID); //kick the playerid we've defined
- }
- else //if he has not got the permissions
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!"); //return this message
- }
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) {
- new PID; //define the playerid we wanna ban
- new reason[64]; //the reason, put into a string
- new str[128]; //a new message string
- new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
- GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
- GetPlayerName(PID, Playername, sizeof(Playername));
- if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
- if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
- return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- format(str, sizeof(str), "'%s' Has Been Banned By Administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
- SendClientMessageToAll(COLOR_RED, str); //send that message to all
- CMDMessageToAdmins(playerid,"BAN");
- Ban(PID); //Ban the playerid we've defined
- }
- else //if he has not got the permissions
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!"); //return this message
- }
- return 1;
- }
- COMMAND:freeze(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new Target; //defines the playerid we wanna freeze
- if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /freeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
- if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
- return SendClientMessage(playerid, COLOR_RED, "ERROR:Player Is Not Connected!");
- if(!sscanf(params, "u", Target))
- {
- new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
- GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
- new pname[MAX_PLAYER_NAME]; //define the adminname
- GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
- new tstring[128]; //define the string for the player (victim)
- new pstring[128];// define the string for the admin which is performing
- new astring[128];//define the string for all the players which are online
- format(tstring,sizeof(tstring),"You have been frozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
- format(pstring,sizeof(pstring),"You have frozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
- format(astring,sizeof(astring),"Administrator %s has frozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
- SendClientMessage(Target,COLOR_GOLD,tstring);//sends the message to the victim
- SendClientMessage(playerid,COLOR_GREEN,pstring);//sends the message to the admin
- SendClientMessageToAll(COLOR_BLUE,astring);//sends the message to everybody
- TogglePlayerControllable(Target,0); //with that function, the player won't be able to mov, while we're using the variable "Target" as the playerid
- CMDMessageToAdmins(playerid,"FREEZE");
- }
- }
- // if he doesn't have permissions, return that message!
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- return 1;
- }
- COMMAND:car(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >=2)
- {
- new car;
- if(IsPlayerInAnyVehicle(playerid)) return 1;
- if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_ORANGE, "USE: /v(ehicle) [id_vehicle]");
- if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_GREY, "That id doesn't exist!");
- new Float:x, Float:y, Float:z, Float:a;
- GetPlayerPos(playerid, x,y,z);
- GetPlayerFacingAngle(playerid, a);
- car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
- PutPlayerInVehicle(playerid, car, 0);
- CMDMessageToAdmins(playerid,"CAR");
- }
- else
- {
- Error2(playerid);
- }
- return 1;
- }
- COMMAND:fix(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >=1)
- {
- new pla;
- if(sscanf(params,"u",pla)) return SendClientMessage(playerid, COLOR_ORANGE, "USE: /repair [ID]");
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, COLOR_GREY, "Your car is fixed!");
- CMDMessageToAdmins(playerid,"FIX");
- }
- else
- {
- Error1(playerid);
- }
- return 1;
- }
- COMMAND:admins(playerid,params[])
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, COLOR_ORANGE, " ");
- SendClientMessage(playerid, COLOR_ORANGE, "-| ADMINS |-");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341)
- {
- new admtext[64];
- new sendername[MAX_PLAYER_NAME];
- new string[256];
- if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; }
- else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Moderator"; }
- else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Lead Moderator"; }
- else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Level-4 Senior Administrator"; }
- else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Level-5 Master Administrator"; }
- else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Level-6 Global Administrator"; }
- else if(PlayerInfo[i][pAdmin] == 7) { admtext = "Level-7 Co-Owner"; }
- else if(PlayerInfo[i][pAdmin] == 8) { admtext = "level-8 Owner"; }
- else { admtext = "Gamemoderator"; }
- GetPlayerName(i, sendername, sizeof(sendername));
- format(string, 256, "%s ( %s )", sendername, admtext);
- SendClientMessage(playerid, COLOR_GREEN, string);
- }
- }
- }
- }
- return 1;
- }
- COMMAND:unfreeze(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new Target; //defines the playerid we wanna unfreeze
- if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /unfreeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
- if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
- return SendClientMessage(playerid, COLOR_GREY, "ERROR:Player is not connected!");
- if(!sscanf(params, "u", Target))
- {
- new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
- GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
- new pname[MAX_PLAYER_NAME]; //define the adminname
- GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
- new tstring[128]; //define the string for the player (victim)
- new pstring[128];// define the string for the admin which is performing
- new astring[128];//define the string for all the players which are online
- format(tstring,sizeof(tstring),"You have been unfrozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
- format(pstring,sizeof(pstring),"You have unfrozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
- format(astring,sizeof(astring),"Administrator %s has unfrozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
- SendClientMessage(Target,COLOR_GOLD,tstring);//sends the message to the victim
- SendClientMessage(playerid,COLOR_GREEN,pstring);//sends the message to the admin
- SendClientMessageToAll(COLOR_BLUE,astring);//sends the message to everybody
- TogglePlayerControllable(Target,1); //with that function, the player will be able to move again, while we're using the variable "Target" as playerid again
- CMDMessageToAdmins(playerid,"UNFREEZE");
- }
- else
- {
- Error3(playerid);
- }
- }
- // if he doesn't have permissions, return that message!
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- return 1;
- }
- COMMAND:clearchat(playerid,params[])
- {
- if( PlayerInfo[ playerid ][ pAdmin ] < 1 ) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- {
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( COLOR_BLUE,"Main Chat Has Been Cleared" );
- }
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
- if(sscanf(params, "us", id, str2))
- {
- SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
- return 1;
- }
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
- {
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
- SendClientMessage(playerid, 0xFF0000FF, str);
- format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
- SendClientMessage(id, 0xFF0000FF, str);
- }
- return 1;
- }
- COMMAND:report(playerid,params[])
- {
- new Target; //define the target's name
- new Reason[128];//the report-reason
- if(!sscanf(params, "us[32]",Target, Reason))
- {
- if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!"); //comment this line if you want to try this cmd on yourself
- if(!IsPlayerConnected(Target)) //if the ID is invalid
- return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!"); //send the player a message, that the ID doesn't exist
- new tname[MAX_PLAYER_NAME]; //the name of player one (reporting)
- new pname[MAX_PLAYER_NAME]; //the name of player two (the reported)
- GetPlayerName(Target,tname,sizeof(tname)); //get (receive) the player's name for the first
- GetPlayerName(playerid,pname,sizeof(pname)); //get (receive) the player's name for the second
- new rstring[256]; //the report-string
- format(rstring,sizeof(rstring),"* Player %s(%d) reported %s(%d)! (Reason: %s)", pname,playerid,tname,Target,Reason); //only admins will receive this message! a specific player with a reason got reported, here we'll use all variables created
- SendMessageToAdmins(COLOR_WHITE,rstring); //we'll talk about that later
- //NOW HERE, we'll open the reportpath and WRITE into it
- new File:Log = fopen(reportPATH, io_append); //here you're opening the path defined
- new logData[128]; //create the logdata we wanna write in
- new name[MAX_PLAYER_NAME]; //define the name again
- GetPlayerName(Target,name,sizeof(name)); //receive the name again
- new fTime[6]; //create the specific time for the report
- getdate(fTime[0], fTime[1], fTime[2]); //get the report's date
- gettime(fTime[3], fTime[4], fTime[5]); //get the report's time
- format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s got reported by %s! (Reason: %s)\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], tname, pname, Reason); //this will write everything (name,reason,time,date etc.) into the logdata
- fwrite(Log, logData); //write it into the path
- fclose(Log); //close the log, finished!
- }
- else return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /report <playerid> <reason>"); //detects the wrong params from sscanf and send the client this message
- return 1;
- }
- forward SendMessageToAdmins(color,const string[]);
- public SendMessageToAdmins(color,const string[]) //create the callback, including color and string
- {
- for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the admins
- {
- if(IsPlayerConnected(i) == 1) //the admin gotta be connected
- if(PlayerInfo[i][pAdmin] >= 1) //and his level gotta be at least 1 (or higher)
- SendClientMessage(i, color, string); //send this message now to every admin online, with color + string!
- }
- return 1;
- }
- CMD:acar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- //here, you'll have to put in again the variables of your enum of the playerinfo, to check the required adminlevel
- new Float:x, Float:y, Float:z, Float:angle; //create the position of the player, which can be anywhere
- GetPlayerPos(playerid, x, y, z); //get the player's position, to know where the car should be put
- GetPlayerFacingAngle(playerid, angle); //get the player's angle, to put the car in the right angle
- new veh = CreateVehicle(429, x, y, z, angle, 0, 0, 60); //in the variable "veh", you're storing and creating a vehicle now!
- //429 is the ID of the car, "0" is the color (black)! change it simply later, I'mma give you a link
- PutPlayerInVehicle(playerid, veh, 0); //this function will put the player into the created vehicle
- ChangeVehicleColor(429, 0, 1); //this will change the vehicle color to black (and white), surely!
- CMDMessageToAdmins(playerid,"ACAR");
- return 1;
- }
- CMD:fakechat(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 5) //put your admin-variable from your on enum of the playerinfo here again!
- {
- new Target; //the player which'll get "blamed"
- new Msg[128]; //the string for the message
- if(sscanf(params, "us[50]", Target,Msg)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /fakechat [playerid] [message]"); //returns the right params if you've written it wrong
- if(!IsPlayerConnected(Target)) //check if the ID is valid, if not
- return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!"); //send the player such a message
- if(!sscanf(params, "us[50]", Target,Msg)) //if the params are written correctly, do the following! (target "u" and message "s" used here, with the size "50")
- {
- new PName[MAX_PLAYER_NAME]; //a new name for the player
- GetPlayerName(Target,PName,sizeof PName); //receive the player's name
- new textstring[400];//the string for the message
- format(textstring, sizeof(textstring), "{FFFFFF}(%i): {FFFFFF}%s", Target, Msg); //format the message with the string we've created, Target for the player, Msg for the message
- SendPlayerMessageToAll(Target, textstring); //of course everyone should see the message
- format(textstring,sizeof(textstring),"You have sent a fakechat message for %s(%d)! (Message: %s)",PName,Target,Msg); //you don't have to, but you CAN add it! It sends you the success-message that you've sent the fakemessage
- SendClientMessage(playerid,COLOR_GREEN,textstring); //this message should only appear to the one which is performing the command
- CMDMessageToAdmins(playerid,"FAKECHAT");
- }
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-5 Administrator to use this command!");
- return 1;
- }
- COMMAND:givescore(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new Target;
- new Ammount;
- if(!sscanf(params, "ui", Target, Ammount))
- {
- if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
- if(Ammount > 100000) return SendClientMessage(playerid,COLOR_RED,"ERROR: Score Amount Is From 0 To 100000");
- SetPlayerScore(Target,GetPlayerScore(Target)+Ammount);
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(Target,tname,sizeof(tname));
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- new tstring[256];
- new pstring[256];
- format(tstring,sizeof(tstring),"You Have Been Given %d Score By Administrator %s",Ammount,pname);
- format(pstring,sizeof(pstring),"You have given %d score to %s(%d)",Ammount,tname,Target);
- SendClientMessage(Target,COLOR_BLUE,tstring);
- SendClientMessage(playerid,COLOR_BLUE,pstring);
- CMDMessageToAdmins(playerid,"GIVESCORE");
- }
- else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /givescore <playerid> <ammount>");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- return 1;
- }
- COMMAND:force(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new Target;
- if(!sscanf(params, "u", Target))
- {
- if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
- ForceClassSelection(Target);
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(Target,tname,sizeof(tname));
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- new tstring[256];
- new pstring[256];
- format(tstring,sizeof(tstring),"You Have Been Forced To Class Selection By %s",pname);
- format(pstring,sizeof(pstring),"You Have Forced %s(%d) Into Class Selection",tname);
- SendClientMessage(Target,COLOR_BLUE,tstring);
- SendClientMessage(playerid,COLOR_BLUE,pstring);
- CMDMessageToAdmins(playerid,"FORCE");
- }
- else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /force <playerid>");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- return 1;
- }
- COMMAND:spawn(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new Target;
- if(!sscanf(params, "u", Target))
- {
- if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
- if(PlayerInfo[Target][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Can't Use This Command On This Admin!");
- SpawnPlayer(Target);
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(Target,tname,sizeof(tname));
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- new tstring[256];
- new pstring[256];
- format(tstring,sizeof(tstring),"You Have Been Spawned %s",pname);
- format(pstring,sizeof(pstring),"You Have Spawned %s(%d)",tname);
- SendClientMessage(Target,COLOR_BLUE,tstring);
- SendClientMessage(playerid,COLOR_BLUE,pstring);
- CMDMessageToAdmins(playerid,"SPAWN");
- }
- else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /spawn <playerid>");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- return 1;
- }
- COMMAND:mute(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new Target;
- if(!sscanf(params, "u", Target))
- {
- if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
- if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
- if(PlayerInfo[Target][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Can't Use This Command On This Admin!");
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(Target,tname,sizeof(tname));
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- new tstring[256];
- new pstring[256];
- format(tstring,sizeof(tstring),"You Have Been Muted By %s! You Can't Talk!",pname);
- format(pstring,sizeof(pstring),"You Have Muted %s(%d)",tname,Target);
- SendClientMessage(Target,COLOR_RED,tstring);
- SendClientMessage(playerid,COLOR_GREEN,pstring);
- CMDMessageToAdmins(playerid,"MUTE");
- }
- else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /mute <playerid>");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- return 1;
- }
- COMMAND:unmute(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new Target;
- if(!sscanf(params, "u", Target))
- {
- if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
- if(PlayerInfo[Target][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Can't Use This Command On This Admin!");
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(Target,tname,sizeof(tname));
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- new tstring[256];
- new pstring[256];
- format(tstring,sizeof(tstring),"You Have Been UnMuted By %s! You Can Talk Now!",pname);
- format(pstring,sizeof(pstring),"You Have Muted Player %s(%d)",tname,Target);
- SendClientMessage(Target,COLOR_RED,tstring);
- SendClientMessage(playerid,COLOR_GREEN,pstring);
- CMDMessageToAdmins(playerid,"UNMUTE");
- }
- else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /unmute <playerid>");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- return 1;
- }
- COMMAND:givecash(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new
- toplayerid, // the player we want to give money to
- amount;
- // extracting player's ID and amount from params
- if (!sscanf(params, "ii", toplayerid, amount))
- {
- if (toplayerid != INVALID_PLAYER_ID)
- {
- new
- message[40];
- GivePlayerMoney(toplayerid, amount);
- format(message, sizeof(message), "You Got $%d From Administrator!", amount);
- SendClientMessage(toplayerid, COLOR_RED, message);
- CMDMessageToAdmins(playerid,"GIVECASH");
- }
- else SendClientMessage(playerid, COLOR_RED, "That player is not connected");
- }
- else SendClientMessage(playerid, COLOR_ORANGE, "Usage: /givemoney <playerid> <amount>");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- return 1;
- }
- COMMAND:god(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- SetPlayerHealth(playerid, 99999);
- SendClientMessage(playerid, COLOR_GREEN,"You Are Now On God Mod");
- CMDMessageToAdmins(playerid,"GOD");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- return 1;
- }
- COMMAND:offgod(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, COLOR_GREEN,"You Have Turned Off God Mode");
- CMDMessageToAdmins(playerid,"OFFGOD");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- return 1;
- }
- COMMAND:jail(playerid, params[])
- {
- new id;
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(!sscanf(params, "u", id))
- {
- new string[900];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s jailed you for %s", name,params);
- SendClientMessage(id, COLOR_RED, string);
- format(string, sizeof(string), "You jailed %s", PlayerName);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "Administrator %s jailed %s",name,PlayerName);
- SendClientMessageToAll(COLOR_WHITE, string);
- SetPlayerPos(id, 264.6288,77.5742,1001.0391);
- SetPlayerInterior(id, 1);
- CMDMessageToAdmins(playerid,"JAIL");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /jail [PlayerId/PartOfName][Reason]");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- }
- COMMAND:unjail(playerid, params[])
- {
- new id;
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdmin] >=1)
- {
- if(!sscanf(params, "u", id))
- {
- new string[900];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s Has Unjailed You", name);
- SendClientMessage(id, COLOR_RED, string);
- format(string, sizeof(string), "You unjailed %s", PlayerName);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "Administrator %s Has Unjailed %s",name,PlayerName);
- SetPlayerPos(id, 1555.097900, -1675.848754, 16.195312);
- SetPlayerInterior(id, 0);
- CMDMessageToAdmins(playerid,"UNJAIL");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /unjail [PlayerId/PartOfName]");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- }
- COMMAND:setscore(playerid, params[])
- {
- new id;
- new score;
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- if(!sscanf(params, "ui", id, score))
- {
- if(score <= 999999999)
- {
- new string[64];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s Set Your Score To %d", name, score);
- SendClientMessage(id, COLOR_RED, string);
- format(string, sizeof(string), "You reseted %s's score to %d", PlayerName, score);
- SendClientMessage(playerid, COLOR_WHITE, string);
- SetPlayerScore(id, score);
- CMDMessageToAdmins(playerid,"SETSCORE");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_RED, "You can't set more than $999.999.999");
- }
- else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /setscore [PlayerId/PartOfName] [Score]");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-4 Administrator to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- }
- COMMAND:goto(playerid, params[])
- {
- new id;
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- if(!sscanf(params, "ui", id))
- {
- new string[300];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- new Float:x, Float:y, Float:z; GetPlayerPos(id,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(id));
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s Has Been Teleported To Your Position", name);
- SendClientMessage(id, COLOR_RED, string);
- format(string, sizeof(string), "You Went To Player %s", PlayerName);
- SendClientMessage(playerid, COLOR_BLUE, string);
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
- SetPlayerPos(playerid,x+2,y,z);
- CMDMessageToAdmins(playerid,"GOTO");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /goto [PlayerId/PartOfName]");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- }
- COMMAND:get(playerid, params[])
- {
- new id;
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- if(!sscanf(params, "ui", id))
- {
- new string[300];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(id,GetPlayerInterior(playerid));
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s Teleported You To His Position", name);
- SendClientMessage(id,COLOR_RED, string);
- format(string, sizeof(string), "You Have Teleported %s To Your Position", PlayerName);
- SendClientMessage(playerid,COLOR_BLUE, string);
- SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
- SetPlayerPos(id,x+2,y,z);
- CMDMessageToAdmins(playerid,"GET");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /gethere[PlayerId/PartOfName]");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- }
- COMMAND:akill(playerid, params[])
- {
- new id;
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- if(!sscanf(params, "u", id))
- {
- new string[100];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s Has Killed You", name);
- SendClientMessage(id, COLOR_RED, string);
- format(string, sizeof(string), "You Have Killed %s", PlayerName);
- SendClientMessage(playerid, COLOR_BLUE, string);
- SetPlayerHealth(id, 0);
- CMDMessageToAdmins(playerid,"AKILL");
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /akill [PlayerId/PartOfName]");
- }
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
- }
- COMMAND:acmds(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SendClientMessage(playerid, COLOR_GREEN,"==============================");
- SendClientMessage(playerid, COLOR_GREEN,"========Admin-Commands========");
- SendClientMessage(playerid, COLOR_GREEN,"/heal,/kick,/ban,/freeze,/unfreeze");
- SendClientMessage(playerid, COLOR_GREEN,"/clearchat,/jail,/unjail,/acar");
- SendClientMessage(playerid, COLOR_GREEN,"/fakechat,/givescore,/force");
- SendClientMessage(playerid, COLOR_GREEN,"/spawn,/mute,/unmute,/fix,/car");
- SendClientMessage(playerid, COLOR_GREEN,"/givecash,/god,/offgod,/setlevel");
- SendClientMessage(playerid, COLOR_GREEN,"/setscore,/akill,/get,/goto");
- SendClientMessage(playerid, COLOR_GREEN,"===============================");
- CMDMessageToAdmins(playerid,"ACMDS");
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- return 1;
- }
- CMD:warn(playerid,params[])
- {
- if(AdminLevel[playerid] >= 1)
- {
- new Target;
- new Reason[50];
- if(sscanf(params, "us[50]", Target, Reason)) return SendClientMessage(playerid,COLOR_RED,"Usage: /warn [playerid] [reason]");
- if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Invaild ID");
- Warns[Target]++;
- new tname[MAX_PLAYER_NAME];
- GetPlayerName(Target,tname,sizeof(tname));
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pname,sizeof(pname));
- new String[256];
- format(String,sizeof String, "Administrator %s warned %s [Reason: %s %d/%d]", pname, tname, Reason, Warns[Target], MAX_WARNINGS);
- SendClientMessage(playerid, COLOR_RED, String);
- if(Warns[Target] == MAX_WARNINGS)
- {
- new str[256];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(Target,name,sizeof(name));
- format(str,sizeof(str),"%s has been kicked by Server [Reason: Max Warnings]", name, Target);
- SendClientMessageToAll(COLOR_RED, str);
- Warns[Target] = 0;
- Kick(Target);
- }
- }
- else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be level 1 Administrator to use this command!");
- 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)
- {
- 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;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_WriteInt(File,"Donor",0);
- INI_WriteInt(File,"Score",0);
- INI_WriteInt(File,"Helperator",0);
- INI_Close(File);
- SendClientMessage(playerid, COLOR_WHITE,"Your now registered!");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- SetPlayerScore(playerid, GetPlayerScore(playerid));
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Congratulations You Have Been Succesfully Logged In!","Ok","");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You Have Entered An Incorrect Password And This Is Not The Password Of This Account.\n"COL_WHITE"Type your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- forward Error1(playerid);
- public Error1(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
- return 1;
- }
- forward Error2(playerid);
- public Error2(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
- return 1;
- }
- forward Error3(playerid);
- public Error3(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
- return 1;
- }
- forward Error4(playerid);
- public Error4(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-4 Administrator to use this command!");
- return 1;
- }
- forward Error5(playerid);
- public Error5(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-5 Administrator to use this command!");
- return 1;
- }
- forward Error6(playerid);
- public Error6(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-6 Administrator to use this command!");
- return 1;
- }
- forward Error7(playerid);
- public Error7(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-7 Administrator to use this command!");
- return 1;
- }
- forward Error8(playerid);
- public Error8(playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-8 Administrator to use this command!");
- return 1;
- }
- forward MessageToTwice(color,const string[]);
- public MessageToTwice(color,const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, color, string);
- }
- return 1;
- }
- stock CMDMessageToAdmins(playerid,command[])
- {
- new string[128]; GetPlayerName(playerid,string,sizeof(string));
- format(string,sizeof(string),"[INFO]Administrator %s has used %s",string,command);
- return MessageToTwice(COLOR_PINK,string);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement