Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <foreach>
- #include <sscanf2>
- #include <YSI/y_ini>
- #include <YSI\y_commands>
- #define COLOR_RED 0xE01B4CFF
- #define COL_BLUE "{345ACF}"
- #define COL_RED "{E01B4C}"
- #define COL_WHITE "{FFFFFF}"
- #define COL_ORA "{E0A21B}"
- #define COL_YELLOW "{F5E618}"
- #define COL_GREEN "{2EAD15}"
- #define IPI INVALID_PLAYER_ID
- #define SCM SendClientMessage
- #define SCMToAll SendClientMessageToAll
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_CLICK 3
- #define DIALOG_ADMIN 4
- #define RCON_DIALOG 5
- #define SKIN_ID 150
- #define START_MONEY 1000
- #define INI_Exists(%0) fexist(%0)
- #define MAX_PING 500
- #define PING_KICK 2000//u can change the 2000 its the max ping
- #define MAX_CARS 1000//max cars
- #define Player_File "Players/%s.ini"
- #pragma tabsize 0
- new Text:Spec0[MAX_PLAYERS];
- new Text:Spec1[MAX_PLAYERS];
- new
- countd = -1,
- countdown,
- cdstarted = 0;
- forward LoadPlayerData(playerid, name[], value[]);
- enum pData
- {
- pPassword,
- pAdmin,
- pMoney,
- pScore,
- pMute,
- pFrozen,
- pSpecating,
- pSkin,
- pWarn,
- pSpam,
- pDuty,
- VIP,
- }
- new P_Data[MAX_PLAYERS][pData];
- new SwearWords[][] = //add ur own swer words
- {
- "noob",
- "s0beit",
- "fuck u",
- "mother fucker",
- "dick",
- "suck",
- "ass",
- "fuck"
- };
- public OnFilterScriptInit()
- {
- UsePlayerPedAnims();
- SetTimer("PingKicker", PING_KICK, true);
- AddPlayerClass(SKIN_ID, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- SetTimer("ClearSpam",5000,true);
- for(new playerid = 0;playerid < GetMaxPlayers();playerid++) {
- Spec0[playerid] = TextDrawCreate(322.000000, 322.000000, "~h~~g~Specating");
- TextDrawBackgroundColor(Spec0[playerid], 255);
- TextDrawFont(Spec0[playerid], 2);
- TextDrawLetterSize(Spec0[playerid], 0.370000, 2.900000);
- TextDrawColor(Spec0[playerid], 16711935);
- TextDrawSetOutline(Spec0[playerid], 1);
- TextDrawSetProportional(Spec0[playerid], 0);
- Spec1[playerid] = TextDrawCreate(211.000000, 360.000000, "~g~Name: ~w~She[R]vin.K ~g~Score: ~w~7 ~g~Money: ~w~101000");
- TextDrawBackgroundColor(Spec1[playerid], 255);
- TextDrawFont(Spec1[playerid], 3);
- TextDrawLetterSize(Spec1[playerid], 0.360000, 1.299998);
- TextDrawColor(Spec1[playerid], -1);
- TextDrawSetOutline(Spec1[playerid], 0);
- TextDrawSetProportional(Spec1[playerid], 1);
- TextDrawSetShadow(Spec1[playerid], 1); }
- print("\n--------------------------------------");
- print(" Admin System Scripted By She[R]vin.K");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Admin System Scripted By She[R]vin.K");
- print("----------------------------------\n");
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 768.4396,-1373.0276,13.5605);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPVarInt(playerid, "Join", 1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new dialog[128], string[128];
- format(string, 35, Player_File, GetName(playerid));
- if(!INI_Exists(string))
- {
- format(dialog, sizeof(dialog),""COL_BLUE"Name "COL_WHITE"%s "COL_YELLOW"isn't registered\n\nPlease typepassword", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Welcome to my server", dialog, "Register", "Exit");
- }
- else
- {
- format(dialog, sizeof(dialog),""COL_YELLOW"Name "COL_WHITE"%s "COL_YELLOW"is registered\n\nPlease login", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Welcome to my server",dialog, "Login", "Exit");
- }
- SetPVarInt(playerid, "Join", 1);
- new Pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new
- pFile[35];
- format(pFile, 35, Player_File, GetName(playerid));
- new
- INI:UserFile = INI_Open(pFile);
- INI_WriteInt(UserFile, "Admin", P_Data[playerid][pAdmin]);
- INI_WriteInt(UserFile, "Money", GetPlayerMoney(playerid));
- INI_WriteInt(UserFile, "Score", GetPlayerScore(playerid));
- INI_WriteInt(UserFile, "Skin", P_Data[playerid][pSkin]);
- INI_WriteInt(UserFile, "Warn", P_Data[playerid][pWarn]);
- INI_WriteInt(UserFile, "VIP", P_Data[playerid][VIP]);
- INI_Close(UserFile);
- new Pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(GetPVarInt(playerid, "Join") == 1)
- {
- GivePlayerMoney(playerid, P_Data[playerid][pMoney]);
- SetPlayerScore(playerid, P_Data[playerid][pScore]);
- SetPVarInt(playerid, "Join", 0);
- if(P_Data[playerid][pWarn] >= 5) {
- Kick(playerid);
- SCM(playerid,COLOR_RED,"You have 5 warns!");}
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(P_Data[playerid][pMute] == 1) {
- SCM(playerid, COLOR_RED, "You are muted!");
- return 0; }
- for(new words; words<sizeof(SwearWords); words++)
- {
- if(strfind(text,SwearWords[words],true) != -1 ) { SCM(playerid, COLOR_RED,"Behave"); return 0;}
- }
- P_Data[playerid][pSpam] += 1;
- if(P_Data[playerid][pSpam] == 5) {
- new string[128];
- format(string, 128, "[ANTI-SPAM] Player %s has been kicked.", GetName(playerid));
- SCMToAll(COLOR_RED,string);
- Kick(playerid);
- }
- else if(P_Data[playerid][pSpam] == 4) {
- SCM(playerid,COLOR_RED,"STOP SPAMMING OR U WILL GET AUTO KICKED!");
- return 0;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_REGISTER:
- {
- if(response)
- {
- new
- string[179],pFile[35];
- format(pFile, 35, Player_File, GetName(playerid));
- new
- INI:UserFile = INI_Open(pFile);
- INI_WriteInt(UserFile, "Password", udb_hash(inputtext));
- INI_WriteInt(UserFile, "Admin", 0);
- INI_WriteInt(UserFile, "Money", START_MONEY);
- INI_WriteInt(UserFile, "Score", 0);
- INI_WriteInt(UserFile, "Skin", SKIN_ID);
- INI_WriteInt(UserFile, "Warn", 0);
- INI_WriteInt(UserFile, "VIP", 0);
- INI_Close(UserFile);
- SetPVarInt(playerid, "Registered", 1);
- SetPVarInt(playerid, "Logged", 1);
- SpawnPlayer(playerid);
- format(string, 125, ""COL_YELLOW"Name: "COL_WHITE"%s "COL_YELLOW"Password: "COL_WHITE"%s "COL_YELLOW"succesfuly registerd", GetName(playerid), inputtext);
- SCM(playerid, 0x46BA29FF, string);
- SpawnPlayer(playerid);
- }
- else Kick(playerid);
- }
- case DIALOG_LOGIN:
- {
- if(response)
- {
- new
- pFile[35],dialog[128];
- format(pFile, 35, Player_File, GetName(playerid));
- INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);
- if(udb_hash(inputtext) == P_Data[playerid][pPassword])
- {
- SetPVarInt(playerid, "Logged", 1);
- SCM(playerid,-1,"Succesfuly login!");
- }
- else
- {
- format(dialog, sizeof(dialog),""COL_YELLOW"Name "COL_WHITE"%s "COL_YELLOW"is registered\n\n{FFFFFF}Please login", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FF0033}Welcome to my server",dialog, "Login", "Exit");
- }
- }
- else Kick(playerid);
- }
- case DIALOG_CLICK:
- {
- if(!response) return SCM(playerid,-1,"Dialog is closed");
- new
- text[128];
- switch(listitem)
- {
- case 0: {
- Kick(GetPVarInt(playerid,"pplayerid"));
- SetPVarInt(playerid,"pplayerid",999);
- format(text,sizeof(text),"Admin %s is kick you from server!",GetName(playerid));
- SCM(GetPVarInt(playerid,"pplayerid"),-1,text);}
- case 1: {
- Ban(GetPVarInt(playerid,"pplayerid"));
- SetPVarInt(playerid,"pplayerid",999);
- format(text,sizeof(text),"Admin %s is ban you from server!",GetName(playerid));
- SCM(GetPVarInt(playerid,"pplayerid"),-1,text); }
- case 2: {
- ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_INPUT,"Admin Control Panel","Type admin level [1-5]","Make","Ëxit");
- }
- }
- }
- case DIALOG_ADMIN:
- {
- if(!response) return SCM(playerid,-1,"Dialog is closed");
- new
- string[128];
- P_Data[GetPVarInt(playerid,"pplayerid")][pAdmin] = strval(inputtext);
- format(string,sizeof(string),"Now you are admin level %d",strval(inputtext));
- SCM(GetPVarInt(playerid,"pplayerid"),-1,string);
- format(string,sizeof(string),"Player %s is now admin level %d",GetName(GetPVarInt(playerid,"pplayerid")),strval(inputtext));
- SCM(playerid,-1,string);
- SetPVarInt(playerid,"pplayerid",999);
- }
- case RCON_DIALOG:
- {
- if(!response) return SCM(playerid,-1,"Dialog is closed");
- new
- string[128];
- switch(listitem)
- {
- case 0: {//Server name
- ShowPlayerDialog(playerid,RCON_DIALOG+1,DIALOG_STYLE_INPUT,"Server name","Type new server name","Insert","Exit");
- }
- case 1: {//Map name
- ShowPlayerDialog(playerid,RCON_DIALOG+2,DIALOG_STYLE_INPUT,"Map name","Type new map name","Insert","Exit");
- }
- case 2: {//Web adress
- ShowPlayerDialog(playerid,RCON_DIALOG+3,DIALOG_STYLE_INPUT,"Web adress","Type new web adress","Insert","Exit");
- }
- case 3: {//Unlock
- SendRconCommand("password 0");
- }
- case 4: {//lock
- ShowPlayerDialog(playerid,RCON_DIALOG+4,DIALOG_STYLE_INPUT,"LOCK server","Type password for server","Insert","Exit");
- }
- case 5: {//GMX
- format(string,sizeof(string),"Admin %s has restart server",GetName(playerid));
- SCMToAll(-1,string);
- SendRconCommand("gmx");
- }
- case 6: {//Password
- ShowPlayerDialog(playerid,RCON_DIALOG+5,DIALOG_STYLE_INPUT,"Change password","Type new RCON password","Insert","Exit");
- }
- case 7: {//Turn Off
- format(string,sizeof(string),"Admin %s has shutted down server",GetName(playerid));
- SCMToAll(-1,string);
- SendRconCommand("exit");
- }
- }
- }
- case RCON_DIALOG+1:
- {
- new string[32];
- format(string, 16, "hostname %s",inputtext);
- SendRconCommand(string);
- }
- case RCON_DIALOG+2:
- {
- new string[32];
- format(string, 16, "mapname %s",inputtext);
- SendRconCommand(string);
- }
- case RCON_DIALOG+3:
- {
- new string[32];
- format(string, 16, "weburl %s",inputtext);
- SendRconCommand(string);
- }
- case RCON_DIALOG+4:
- {
- new string[32];
- format(string, 16, "password %s",inputtext);
- SendRconCommand(string);
- }
- case RCON_DIALOG+5:
- {
- new string[32];
- format(string, 16, "rcon_password %s",inputtext);
- SendRconCommand(string);
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(P_Data[playerid][pAdmin] > 0 && P_Data[playerid][pAdmin] < 5) {
- ShowPlayerDialog(playerid,DIALOG_CLICK,DIALOG_STYLE_LIST,"Admin Control Panel","Kick\nBan","Press","Exit");
- SetPVarInt(playerid,"pplayerid",clickedplayerid);}
- else if(P_Data[playerid][pAdmin] == 5) {
- ShowPlayerDialog(playerid,DIALOG_CLICK,DIALOG_STYLE_LIST,"Admin Control Panel","Kick\nBan\nMake Admin","Press","Exit");
- SetPVarInt(playerid,"pplayerid",clickedplayerid);}
- return 1;
- }
- public LoadPlayerData(playerid, name[], value[])
- {
- INI_Int("Password", P_Data[playerid][pPassword]);
- INI_Int("Admin", P_Data[playerid][pAdmin]);
- INI_Int("Money", P_Data[playerid][pMoney]);
- INI_Int("Score", P_Data[playerid][pScore]);
- INI_Int("Skin", P_Data[playerid][pSkin]);
- INI_Int("Warn", P_Data[playerid][pWarn]);
- INI_Int("VIP", P_Data[playerid][VIP]);
- return 1;
- }
- stock GetName(playerid)
- {
- new
- pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- return pName;
- }
- 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;
- }
- //======================Commands=====================
- YCMD:duty(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128];
- if(P_Data[playerid][pDuty] == 0) {
- format(string,sizeof(string),""COL_ORA"Admin "COL_WHITE"%s "COL_ORA"is now on duty",GetName(playerid));
- SCMToAll(-1,string); P_Data[playerid][pDuty] = 1;}
- else {
- format(string,sizeof(string),""COL_ORA"Admin "COL_WHITE"%s "COL_ORA"is now off duty",GetName(playerid));
- SCMToAll(-1,string); P_Data[playerid][pDuty] = 1;}
- return 1;
- }
- YCMD:ban(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128],pplayerid, reason[48];
- if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /ban [Player ID/Player Name] [Reason]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is ban player "COL_WHITE"%s "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
- SCMToAll(-1,string);
- Bans(playerid,pplayerid,reason);
- Ban(pplayerid);
- return 1;
- }
- YCMD:count(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- if(cdstarted == 1) return SCM(playerid, COLOR_RED, "The countdown has already included!");
- new
- seconds;
- if(sscanf(params, "i", seconds)) return SCM(playerid, COLOR_RED, "Usage: /count [How much secunds]");
- countd = seconds;
- GameTextForAll("COUNT DOWN START",2000,6);
- countdown = SetTimer("cd",1000,true);
- return 1;
- }
- YCMD:clearchat(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] == 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- for(new chat = 0; chat <= 25; chat++)
- SCMToAll(-1, " ");
- SCMToAll(-1,""COL_GREEN"Chat cleared.");
- return 1;
- }
- YCMD:kick(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128],pplayerid, reason[48];
- if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /kick [Player ID/Player Name] [Reason]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is kick player "COL_WHITE"%s "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
- SCMToAll(-1,string);
- Kick(pplayerid);
- return 1;
- }
- YCMD:goto(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,Float:Pos[3];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /goto [Player ID]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- GetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
- SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
- return 1;
- }
- YCMD:mute(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,reason[48],string[128];
- if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /mute [Player ID/Player Name] [Reason]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has muted player "COL_WHITE"%s. "COL_RED"Reason: "COL_WHITE"%s",GetName(playerid),GetName(pplayerid),reason);
- SCMToAll(COLOR_RED,string);
- P_Data[pplayerid][pMute] = 1;
- return 1;
- }
- YCMD:unmute(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /unmute [Player ID/Player Name]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has unmuted player "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
- SCMToAll(COLOR_RED,string);
- P_Data[pplayerid][pMute] = 0;
- return 1;
- }
- YCMD:getip(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,ip[64],string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /getip [Player ID/Player Name]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- GetPlayerIp(pplayerid,ip,50);
- format(string,sizeof(string),""COL_BLUE"IP from player "COL_WHITE"%s "COL_BLUE"is "COL_WHITE"%s",GetName(playerid),ip);
- SCM(playerid,COLOR_RED,string);
- return 1;
- }
- YCMD:slap(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,Float:health,string[128],reason[48];
- if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /slap [Player ID/Player Name] [Reason]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- GetPlayerHealth(pplayerid,health); SetPlayerHealth(pplayerid,health-10);
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has slaped player "COL_WHITE"%s. "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
- SCMToAll(COLOR_RED,string);
- return 1;
- }
- YCMD:amsg(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128],message[48];
- if(sscanf(params, "us[48]", pplayerid,message)) return SCM(playerid, COLOR_RED, "Usage: /amsg [Player ID/Player Name] [Message]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- format(string,sizeof(string),""COL_WHITE"AdminMSG "COL_RED"%s "COL_WHITE"| Message: "COL_RED"%s",GetName(playerid),message);
- SCM(pplayerid,COLOR_RED,string);
- SCM(playerid,COLOR_RED,"Admin message sent!");
- return 1;
- }
- YCMD:a(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] == 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- text[128];
- if(sscanf(params, "s[128]",text)) return SCM(playerid, COLOR_RED, "Usage: /achat [Text]");
- format(text,sizeof(text),""COL_WHITE"Admin "COL_RED"%s "COL_WHITE"| Text: "COL_RED"%s",GetName(playerid),params[0]);
- foreach(Player, i) {
- if(P_Data[i][pAdmin] > 0){
- SCM(i,COLOR_RED,text);}}
- return 1;
- }
- YCMD:ann(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new string[128],style;
- if(sscanf(params, "s[128]i",string,style)) return SCM(playerid, COLOR_RED, "Usage: /ann [Text] [Text Style 0-3]");
- GameTextForAll(string,4000,style);
- return 1;
- }
- YCMD:freeze(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128],reason[48];
- if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /freeze [Player ID/Player Name] [Reason]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- if(P_Data[pplayerid][pFrozen] == 1) return SCM(playerid, COLOR_RED, "Player is already frozen!");
- TogglePlayerControllable(pplayerid, false);
- P_Data[pplayerid][pFrozen] = 1;
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has freezed player "COL_WHITE"%s. "COL_RED"Reason: "COL_WHITE"%s",GetName(playerid),GetName(pplayerid),reason);
- SCMToAll(COLOR_RED,string);
- return 1;
- }
- YCMD:unfreeze(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /unfreeze [Player ID/Player Name]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- if(P_Data[pplayerid][pFrozen] == 0) return SCM(playerid, COLOR_RED, "Player isn't frozen!");
- TogglePlayerControllable(pplayerid, true);
- P_Data[pplayerid][pFrozen] = 0;
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has unfreeze player "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
- SCMToAll(COLOR_RED,string);
- return 1;
- }
- YCMD:spec(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,Float:Pos[3],string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /spec [Player ID/Player Name]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
- SetPVarFloat(playerid,"XPos",Pos[0]);
- SetPVarFloat(playerid,"YPos",Pos[1]);
- SetPVarFloat(playerid,"ZPos",Pos[2]);
- SetPVarInt(playerid,"Interior",GetPlayerInterior(playerid));
- SetPVarInt(playerid,"VW",GetPlayerVirtualWorld(playerid));
- P_Data[playerid][pSpecating] = 1;
- format(string,sizeof(string),"~g~Name: ~w~%s ~g~Score: ~w~%d ~g~Money: ~w~%d",GetName(pplayerid),GetPlayerScore(pplayerid),GetPlayerMoney(pplayerid));
- TextDrawSetString(Spec1[playerid],string);
- TextDrawShowForPlayer(playerid,Spec1[playerid]);
- TextDrawShowForPlayer(playerid,Spec0[playerid]);
- if ( !IsPlayerInAnyVehicle(pplayerid) ) {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, pplayerid);
- SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pplayerid));
- return 1; }
- else {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(pplayerid));
- SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(pplayerid)); }
- return 1;
- }
- YCMD:specoff(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- if(P_Data[playerid][pSpecating] == 0)return SCM(playerid, COLOR_RED, "You don't specate nobody!");
- TogglePlayerSpectating(playerid, 0);
- SetPlayerPos(playerid,GetPVarFloat(playerid,"XPos"),GetPVarFloat(playerid,"YPos"),GetPVarFloat(playerid,"ZPos"));
- SetPlayerInterior(playerid,GetPVarInt(playerid,"Interior"));
- SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"VW"));
- SetPVarFloat(playerid,"XPos",999);
- SetPVarFloat(playerid,"YPos",999);
- SetPVarFloat(playerid,"ZPos",999);
- SetPVarInt(playerid,"Interior",0);
- SetPVarInt(playerid,"VW",0);
- P_Data[playerid][pSpecating] = 0;
- TextDrawHideForPlayer(playerid,Spec1[playerid]);
- TextDrawHideForPlayer(playerid,Spec0[playerid]);
- return 1;
- }
- YCMD:heal(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- SetPlayerHealth(playerid,100);
- return 1;
- }
- YCMD:setskin(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,skin,string[128];
- if(sscanf(params, "ui", pplayerid,skin)) return SCM(playerid, COLOR_RED, "Usage: /setskin [Player ID/Player Name] [Skin ID]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- P_Data[playerid][pSkin] = skin;
- SetPlayerSkin(pplayerid,skin);
- format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has set skin "COL_WHITE"%d "COL_YELLOW"to you",GetName(playerid),skin);
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_YELLOW"Skin seted to player "COL_WHITE"%s",GetName(pplayerid));
- SCM(playerid,-1,string);
- return 1;
- }
- YCMD:eject(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 2) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /eject [Player ID/Player Name]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- RemovePlayerFromVehicle(pplayerid);
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has eject you from vehicle",GetName(playerid));
- SCM(pplayerid,-1,string);
- return 1;
- }
- YCMD:setvhealth(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,Float:health;
- if(sscanf(params, "ui", pplayerid,health)) return SCM(playerid, COLOR_RED, "Usage: /setvhealth [Player ID/Player Name] [Health]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- if(!IsPlayerInAnyVehicle(pplayerid)) return SCM(playerid, COLOR_RED, "Player must be intro car!");
- SetVehicleHealth(GetPlayerVehicleID(pplayerid),health);
- return 1;
- }
- YCMD:jetpack(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 7) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- SetPlayerSpecialAction(playerid, 2);
- return 1;
- }
- YCMD:kill(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /kill [Player ID/Player Name]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- SetPlayerHealth(pplayerid,0);
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has kill player "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:setcarcolor(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,col[2];
- if(sscanf(params, "udd", pplayerid,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /setcarcolor [Player ID/Player Name] [Color 1] [Color 2]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_RED,"You must be into car!");
- ChangeVehicleColor(GetPlayerVehicleID(pplayerid), col[0],col[1]);
- return 1;
- }
- YCMD:warn(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128],reason[48];
- if(sscanf(params, "us[48]", pplayerid,reason)) return SCM(playerid, COLOR_RED, "Usage: /warn [Player ID/Player Name] [Reason]");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- P_Data[pplayerid][pWarn] += 1;
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has warned you. Reason: "COL_WHITE"%s",GetName(playerid),reason);
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"has warned by you. Reason: "COL_WHITE"%s",GetName(pplayerid),reason);
- SCM(playerid,-1,string);
- if(P_Data[pplayerid][pWarn] >=5) {
- Kick(pplayerid);}
- return 1;
- }
- YCMD:settime(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- time,string[128];
- if(sscanf(params, "i", time)) return SCM(playerid, COLOR_RED, "Usage: /settime [Time Of They Day]");
- format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has changed time to "COL_WHITE"%d",GetName(playerid),time);
- SCMToAll(-1,string);
- SetWorldTime(time);
- return 1;
- }
- YCMD:get(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,Float:Pos[3];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /get [Player ID]");
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
- return 1;
- }
- YCMD:fixcar(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_RED, "You must be into car!");
- RepairVehicle(GetPlayerVehicleID(playerid));
- SCM(playerid,-1,""COL_YELLOW"Vehicle repaired.");
- return 1;
- }
- YCMD:amoney(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,money,string[128];
- if(sscanf(params, "ui", pplayerid,money)) return SCM(playerid, COLOR_RED, "Usage: /amoney [Player ID/Player Name] [Money]");
- GivePlayerMoney(pplayerid, money);
- format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has give you "COL_WHITE"$%d",GetName(playerid),money);
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_YELLOW"Player "COL_WHITE"%s "COL_YELLOW"has received "COL_WHITE"$%d",GetName(pplayerid),money);
- SCM(playerid,-1,string);
- return 1;
- }
- YCMD:giveweapon(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,gun,ammo,string[128];
- if(sscanf(params, "uii", pplayerid,gun,ammo)) return SCM(playerid, COLOR_RED, "Usage: /aweapon [Player ID/Player Name] [Weapon ID] [Ammo]");
- GivePlayerWeapon(pplayerid, gun,ammo);
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has give you weapon id: "COL_WHITE"%d",GetName(playerid),gun);
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"has received weapon id: "COL_WHITE"%d",GetName(pplayerid),gun);
- SCM(playerid,-1,string);
- return 1;
- }
- YCMD:unban(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- name[48],string[64];
- if(sscanf(params, "s[48]",name)) return SCM(playerid, COLOR_RED, "Usage: /unban [Player Name]");
- format(string,sizeof(string),"%s.ini",name);
- fremove(string);
- SCM(playerid, COLOR_RED, "Player has been unbaned!");
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- return 1;
- }
- YCMD:disarm(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[64];
- if(sscanf(params, "u",pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /disarm [Player ID/Player Name]");
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has disarm you",GetName(playerid));
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_RED"You'r disarm player "COL_WHITE"%s",GetName(pplayerid));
- SCM(playerid,-1,string);
- ResetPlayerWeapons(pplayerid);
- return 1;
- }
- YCMD:unbanip(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- ip[48],string[64];
- if(sscanf(params, "s[48]",ip)) return SCM(playerid, COLOR_RED, "Usage: /unbanip [Player IP]");
- format(string,sizeof(string),"unbanip %s",ip);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- SCM(playerid, COLOR_RED, "IP has been unbaned!");
- return 1;
- }
- YCMD:killall(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- SetPlayerHealth(i,0);
- }
- return 1;
- }
- YCMD:explode(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128];
- if(sscanf(params, "u", pplayerid)) return SCM(playerid, COLOR_RED, "Usage: /aweapon [Player ID/Player Name]");
- Explode(pplayerid);
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has explode "COL_WHITE"%s",GetName(playerid),GetName(pplayerid));
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:healall(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128];
- for(new i = 0; i<GetMaxPlayers();i++) {
- SetPlayerHealth(i,100); }
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has heal all players",GetName(playerid));
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:armourall(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128];
- for(new i = 0; i<GetMaxPlayers();i++) {
- SetPlayerArmour(i,100); }
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has give all players armour.",GetName(playerid));
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:rac(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128];
- for(new car = 0; car<MAX_CARS;car++) {
- VehicleHaveDriver(car);
- SetVehicleToRespawn(car); }
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has respawn all cars.",GetName(playerid));
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:setadmin(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 8 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128],pplayerid,level;
- if(sscanf(params, "ui", pplayerid,level)) return SCM(playerid, COLOR_RED, "Usage: /setadmin [Player ID/Player Name] [Admin Level]");
- if(level > 8 || level <= 0) return SCM(playerid,COLOR_RED,"Max level is 8");
- if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has given you admin level"COL_WHITE" %d",GetName(playerid),level);
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"now have admin level"COL_WHITE" %d",GetName(pplayerid),level);
- SCM(playerid,-1,string);
- P_Data[pplayerid][pAdmin] = level;
- return 1;
- }
- YCMD:tpall(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 6) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128],Float:Pos[3];
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
- foreach(Player, i) {
- SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid, GetPlayerInterior(playerid));SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid)); }
- format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has port all players to him.",GetName(playerid));
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:setscore(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 7) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- pplayerid,string[128],score;
- if(sscanf(params, "u", pplayerid,score)) return SCM(playerid, COLOR_RED, "Usage: /setscore [Player ID] [Score]");
- format(string,sizeof(string),""COL_RED"Admin "COL_YELLOW"%s "COL_RED"set your score to "COL_YELLOW"%d",GetName(playerid),score);
- SCM(pplayerid,-1,string);
- format(string,sizeof(string),""COL_RED"You are set score to player "COL_YELLOW"%s. "COL_RED"Score: "COL_YELLOW"%d",GetName(pplayerid),score);
- SCM(playerid,-1,string);
- P_Data[playerid][pScore] = score;
- return 1;
- }
- YCMD:setweather(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128],weather;
- if(sscanf(params, "i", weather)) return SCM(playerid, COLOR_RED, "Usage: /setweather [weather ID (0 - 45)]");
- if(weather > 45 || weather < 0) return SCM(playerid, COLOR_RED, "Wrong weather id!");
- format(string,sizeof(string),""COL_YELLOW"Admin "COL_WHITE"%s "COL_YELLOW"has change weather to id: "COL_WHITE"%d",GetName(playerid),weather);
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:setvip(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][pAdmin] < 8) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- new
- string[128],pplayerid,level;
- if(sscanf(params, "ui", pplayerid, level)) return SCM(playerid, COLOR_RED, "Usage: /setvip [Player ID/Player Name] [VIP Level]");
- if(level > 3 || level < 0) return SCM(playerid, COLOR_RED, "Wrong level id!");
- P_Data[pplayerid][VIP] = level;
- format(string,sizeof(string),""COL_YELLOW"Player "COL_WHITE"%s "COL_YELLOW"has promoted to VIP level "COL_WHITE"%d",GetName(pplayerid),level);
- SCMToAll(-1,string);
- return 1;
- }
- YCMD:kickall(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][pAdmin] < 7) return SCM(playerid, COLOR_RED, "You have no permission to use this command!");
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- Kick(i);
- }
- return 1;
- }
- //======================VIP Commands==========================================//
- YCMD:v(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] == 0) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new
- text[128];
- if(sscanf(params, "s[128]",text)) return SCM(playerid, COLOR_RED, "Usage: /vchat [Text]");
- format(text,sizeof(text),""COL_WHITE"VIP "COL_YELLOW"%s "COL_WHITE"| Text: "COL_YELLOW"%s",GetName(playerid),params[0]);
- foreach(Player, i) {
- if(P_Data[i][VIP] > 0){
- SCM(i,-1,text);}}
- return 1;
- }
- YCMD:vfix(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- RepairVehicle(GetPlayerVehicleID(playerid));
- SCM(playerid, -1, ""COL_YELLOW"Your vehicle has succesfuly repaired!");
- return 1;
- }
- YCMD:vvehcolor(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new
- col[2];
- if(sscanf(params, "ii",col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vvehcolor [Color 1] [Color 2]");
- ChangeVehicleColor(GetPlayerVehicleID(playerid), col[0],col[1]);
- SCM(playerid,-1,""COL_YELLOW"Vehicle color changed!");
- return 1;
- }
- YCMD:vbike(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new
- col[2],vehicle;
- if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vbike [Bike ID] [Color 1] [Color 2]");
- if(vehicle == 461 || vehicle == 463 || vehicle == 468 || vehicle == 521 || vehicle == 522) {
- Cars(playerid, vehicle,col[0],col[1]); }
- return 1;
- }
- YCMD:vipheal(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- SetPlayerHealth(playerid, 100.0);
- SCM(playerid,-1,""COL_YELLOW"Heal changed to 100.0!");
- return 1;
- }
- YCMD:vheal(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][VIP] == 1) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- SetPlayerArmour(playerid, 100.0);
- SCM(playerid,-1,""COL_YELLOW"Armoru changed to 100.0!");
- return 1;
- }
- YCMD:vskin(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new skin;
- if(sscanf(params, "i",skin)) return SCM(playerid, COLOR_RED, "Usage: /vskin [Skin ID]");
- if(skin < 0 || skin > 299) return SCM(playerid, COLOR_RED, "Wrong skin id!");
- SetPlayerSkin(playerid,skin);
- P_Data[playerid][pSkin] = skin;
- SCM(playerid,-1,""COL_YELLOW"Skin changed!");
- return 1;
- }
- YCMD:vweather(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new weather;
- if(sscanf(params, "i", weather)) return SCM(playerid, COLOR_RED, "Usage: /vweather [weather ID (0 - 45)]");
- if(weather > 45 || weather < 0) return SCM(playerid, COLOR_RED, "Wrong weather id!");
- SetPlayerWeather(playerid, weather);
- SCM(playerid,-1,""COL_YELLOW"Weather changed!");
- return 1;
- }
- YCMD:vtime(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new hour,minute;
- if(sscanf(params, "ii", hour,minute)) return SCM(playerid, COLOR_RED, "Usage: /vtime [Hours] [Minutes]");
- if(hour > 24 || hour < 0) return SCM(playerid, COLOR_RED, "Wrong hour id!");
- if(minute > 60 || minute < 0) return SCM(playerid, COLOR_RED, "Wrong minute id!");
- SetPlayerTime(playerid, hour,minute);
- SCM(playerid,-1,""COL_YELLOW"Time for you changed!");
- return 1;
- }
- YCMD:vcar(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new
- col[2],vehicle;
- if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vcar [Car ID] [Color 1] [Color 2]");
- if(vehicle == 461 || vehicle == 463 || vehicle == 468 || vehicle == 521 || vehicle == 522 || vehicle == 417
- || vehicle == 425 || vehicle == 447 || vehicle == 487 || vehicle == 488 || vehicle == 497 || vehicle == 522|| vehicle == 548 || vehicle == 563
- || vehicle == 430 || vehicle == 446 || vehicle == 452 || vehicle == 453|| vehicle == 454 || vehicle == 472 || vehicle == 473 || vehicle == 484 || vehicle == 493 || vehicle == 595) return SCM(playerid, COLOR_RED, "Just cars please!");
- Cars(playerid, vehicle,col[0],col[1]);
- return 1;
- }
- YCMD:vjetpack(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- if(P_Data[playerid][VIP] < 2) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- SetPlayerSpecialAction(playerid, 2);
- return 1;
- }
- YCMD:vheli(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] < 3) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new
- col[2],vehicle;
- if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vheli [Heli ID] [Color 1] [Color 2]");
- if(vehicle == 417 || vehicle == 425 || vehicle == 447 || vehicle == 487 || vehicle == 488 || vehicle == 497
- || vehicle == 522 || vehicle == 548 || vehicle == 563 )
- {
- Cars(playerid, vehicle,col[0],col[1]); } else {SCM(playerid, COLOR_RED, "Just helicopter id!");}
- return 1;
- }
- YCMD:vplane(playerid, params[], help)
- {
- #pragma unused help
- if(P_Data[playerid][VIP] < 3) return SCM(playerid, COLOR_RED, "You need to be VIP!");
- new
- col[2],vehicle;
- if(sscanf(params, "iii",vehicle,col[0],col[1])) return SCM(playerid, COLOR_RED, "Usage: /vplane [Car ID] [Color 1] [Color 2]");
- if(vehicle == 460 || vehicle == 476 || vehicle == 511 || vehicle == 513 || vehicle == 512|| vehicle == 519
- || vehicle == 553|| vehicle == 577 || vehicle == 592 || vehicle == 593 )
- {
- Cars(playerid, vehicle,col[0],col[1]); } else {SCM(playerid, COLOR_RED, "You must type id of plane!");}
- return 1;
- }
- COMMAND:report(playerid, params[])
- {
- new
- pplayerid,string[1000],reason[100];
- if(sscanf(params, "ds[100]", pplayerid,reason)) return SCM(playerid, COLOR_RED, ""COL_RED"Info: "COL_WHITE"/Report (Playerid) (Reason)");
- if(pplayerid == IPI) return SCM(playerid, -1, ""COL_RED"Error: "COL_WHITE"Wrong Playerid.");
- format(string,sizeof(string),""COL_BLUE"(REPORT): "COL_WHITE" \"%s (%d)\" has reported against \"%s (%d)\". (Reason: %s)",GetName(playerid),playerid,GetName(pplayerid),pplayerid,reason);
- SendAdminMessage(string);
- SCM(playerid, -1, ""COL_GREEN"Report successfully sended, please wait for the admins to take action.");
- return 1;
- }
- forward PingKicker();
- public PingKicker()
- {
- new string[128];
- foreach(Player, i) {
- if(GetPlayerPing(i) > MAX_PING) {
- format(string, sizeof (string), "Exceeding Ping Limit. Max ping is %d", MAX_PING);
- SCM(i,COLOR_RED,string);
- Kick(i); }
- }
- }
- forward ClearSpam();
- public ClearSpam()
- {
- foreach(Player, i) {
- if(P_Data[i][pSpam] > 1) {
- P_Data[i][pSpam] = 0;}
- }
- }
- forward cd();
- public cd()
- {
- countd--;
- new
- str[16];
- format(str,32,"~g~%d",countd);
- GameTextForAll(str,1000,6);
- if(countd==0)
- {
- GameTextForAll("~g~GO!",2000,6);
- KillTimer(countdown);
- cdstarted = 0;
- }
- }
- stock Explode(playerid)
- {
- new Float:Pos[3];
- GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
- CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 10);
- }
- stock VehicleHaveDriver(car)
- {
- foreach(Player, i)
- {
- if(IsPlayerInVehicle(i, car)) return 1;
- }
- return 1;
- }
- stock Bans(playerid,targetid,reason[])
- {
- new string[128];
- format(string, sizeof(string), "Admin %s has ban player %s. Reason: %s\n", GetName(playerid),GetName(targetid),reason);
- new File:hFile;
- hFile = fopen("/ShAdmin/Bans.txt", io_append);
- fwrite(hFile, string);
- fclose(hFile);
- }
- stock Cars(playerid, model, color1, color2)
- {
- new Float:Pos[4];
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
- if(GetPVarInt(playerid,"VipCar") != -1) DestroyVehicle(GetPVarInt(playerid,"VipCar"));
- new vehicleid = CreateVehicle(model,Pos[0],Pos[1],Pos[2], Pos[3],color1, color2, 3600);
- SetPVarInt(playerid,"VipCar", vehicleid);
- SCM(playerid,-1,""COL_YELLOW"Vehicle spawned!");
- }
- stock SendAdminMessage(text[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(P_Data[i][pAdmin]>=1)
- {
- SendClientMessage(i,-1,text);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment