Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*------------------------------------------------------------------------------
- ________________________________________________________________________________
- © Copyright FunnyBear 2013. All rights reserved
- ________________________________________________________________________________
- Users Directory: Scriptfiles -> fbAdmin -> Users
- ________________________________________________________________________________
- VERSION: v1.0
- DEVELOPER: FunnyBear
- BETA TESTERS: Greentarch
- INFORMATION: This filterscript is owned by Funnybear, you may not re-release
- it without my permission.
- © Copyright 2013. All rights reserved. Do not steal this filterscript, if you're
- using it, leave the credits on.
- ________________________________________________________________________________
- */
- //--[INCLUDES]--
- #include <a_samp>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <sscanf>
- //-----[FORWARDS]-----
- forward loadaccount_user(playerid, name[], value[]);
- forward Unjail(playerid);
- //-----[NATIVES]-----
- native WP_Hash(buffer[],len,const str[]);
- //-----[ADMIN DEFINES]-----
- #define dregister 1
- #define dlogin 2
- #define cmds 3
- #define acmds 4
- #define credits 5
- #define MAX_PLAYER_NAME 24
- #define UserPath "fAdmin/Users/%s.ini"
- //-----[COLOR DEFINES FOR ADMIN/REG SYSTEM]-----
- #define COL_RULES "{FA0A36}"
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- //----[OTHER COLOR DEFINES]-----
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- #define GREY 0xAFAFAFAA
- #define GREEN 0x33AA33AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_RBLUE 0x4169FFAA
- #define YELLOW 0xFFFF00AA
- #define WHITE 0xFFFFFFAA
- #define LIGHTBLUE 0x33CCFFAA
- #define ORANGE 0xFF9900AA
- #define RED 0xFF0000FF
- #define COLOR_ERROR 0xFF6A6AFF
- #define COLOR_BOMB 0x96BD6AFF
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- #define GREY 0xAFAFAFAA
- #define GREEN 0x33AA33AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define YELLOW 0xFFFF00AA
- #define WHITE 0xFFFFFFAA
- #define COLOR_WHITE 0xFFFFFFAA
- #define LIGHTBLUE 0x33CCFFAA
- #define ORANGE 0xFF9900AA
- #define RED 0xFF0000FF
- #define BLUE 0x000060FF
- #define BLUE2 0x005F60FF
- #define Grey 0xC0C0C0FF
- #define COLOR_GRAD1 0xB4B5B7FF
- #define ROB 0xFF9500FF
- #define INFO 0x008080FF
- //-----[ENUMS]-----
- enum PlayerInfo
- {
- Pass[129],
- Adminlevel,
- VIPlevel,
- Money,
- Scores,
- Kills,
- Deaths,
- Warnings,
- }
- new pInfo[MAX_PLAYERS][PlayerInfo];
- //-----[FILTER]-----
- new Filter[][] =
- {
- "MotherFu",
- "puss",
- "bit",
- "Asshole",
- "Dic",
- "codw",
- "s0beit",
- "sobeit",
- "hack",
- "cheat",
- "h@ck",
- "/rcon login",
- ".rcon login",
- "&rcon login",
- "7rcon login"
- };
- //-----[VARIABLES]-----
- new
- bool:QuestionAsked[ MAX_PLAYERS ];
- new
- JailTimer[ MAX_PLAYERS ];
- new
- Jailed[ MAX_PLAYERS ];
- new
- hide[ MAX_PLAYERS ];
- new
- Question[ MAX_PLAYERS ][ 256 ];
- new
- bool: playerMuted[ MAX_PLAYERS char ];
- new
- bool: playerFrozen[ MAX_PLAYERS char ];
- new
- bool: playerGod[ MAX_PLAYERS ];
- new
- bool: playerAsked[ MAX_PLAYERS char ];
- new
- ChatDisabled;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Admin Filterscript by FunnyBear loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- if(fexist(Path(playerid)))
- {
- INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_WHITE"This account is {00FF22}already registered.\n{FFFFFF}Please login by entering your password in below","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid,dregister, DIALOG_STYLE_PASSWORD,""COL_RED"Register",""COL_WHITE"This account is{F81414} not yet registered \n{FFFFFF}Please create an account by typing your desired password below","Register","Quit");
- return 1;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- KillTimer(JailTimer[playerid]);
- QuestionAsked[playerid] = false;
- format(Question[playerid], 256, " ");
- if(fexist(Path(playerid)))
- {
- new INI:file = INI_Open(Path(playerid));
- INI_SetTag(file,"Player Data");
- INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
- INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);
- INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
- INI_WriteInt(file,"Scores",GetPlayerScore(playerid));
- INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
- INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
- INI_WriteInt(file,"Warnings",pInfo[playerid][Warnings]);
- INI_Close(file);
- return 1;
- }
- return 1;
- }
- stock SendMessageToAdmins(color,const msg[])
- {
- for (new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i)) if(pInfo[i][Adminlevel] > 1) SendClientMessage(i,color,msg);
- }
- }
- stock GetName(playerid)
- {
- new
- name[24];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- stock StartPlayerSpec(playerid, otherid)
- {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, otherid);
- SetPlayerInterior(playerid,GetPlayerInterior(otherid));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(otherid));
- return 1;
- }
- stock StopPlayerSpec(playerid)
- {
- TogglePlayerSpectating(playerid, 0);
- SetCameraBehindPlayer(playerid);
- return 1;
- }
- stock PlayerName(playerid)
- {
- new Name[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME + 1);
- return Name;
- }
- stock Path(playerid)
- {
- new str[128],name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(str,sizeof(str),UserPath,name);
- return str;
- }
- stock SendUsageError( playerid, const usage[ ] )
- {
- new
- str[ 128 ];
- format( str, sizeof ( str ), "USAGE: {FFFFFF}%s", usage );
- SendClientMessage( playerid, RED, str );
- return 1;
- }
- stock InvalidPlayerError( playerid )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is not connected to the server." );
- stock PlayerIsNotAdmin( playerid )
- return SendClientMessage(playerid, RED, "You are not authorised to use this command");
- public loadaccount_user(playerid, name[], value[])
- {
- INI_String("Password", pInfo[playerid][Pass],129);
- INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);
- INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);
- INI_Int("Money",pInfo[playerid][Money]);
- INI_Int("Scores",pInfo[playerid][Scores]);
- INI_Int("Kills",pInfo[playerid][Kills]);
- INI_Int("Deaths",pInfo[playerid][Deaths]);
- INI_Int("Warnings",pInfo[playerid][Warnings]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendDeathMessage(killerid, playerid, reason);
- if ( killerid != INVALID_PLAYER_ID )
- pInfo[killerid][Kills]++;
- pInfo[playerid][Deaths]++;
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- new
- str[ 1024 ], title[ 128 ], name[ 24 ];
- GetPlayerName( clickedplayerid, name, 24 );
- format( title, sizeof ( title ), "{FFFFFF}%s's Status", name );
- format( str, sizeof ( str ),
- "{FFFFFF}Admin Level: {33FF33}%d \n\
- {FFFFFF}VIP Level: {33FF33}%d \n\
- {FFFFFF}Total warnings: {33FF33}%d \n\
- {FFFFFF}Money: {33FF33}$%d \n\
- {FFFFFF}Score: {33FF33}%d \n\
- {FFFFFF}Kills: {33FF33}%d \n\
- {FFFFFF}Deaths: {33FF33}%d",
- pInfo[ clickedplayerid ][ Adminlevel ], pInfo[ clickedplayerid ][ VIPlevel ], pInfo[ clickedplayerid ][ Warnings ], GetPlayerMoney( clickedplayerid ), GetPlayerScore( clickedplayerid ), pInfo[ clickedplayerid ][ Kills ], pInfo[ clickedplayerid ][ Deaths ] );
- ShowPlayerDialog( playerid, 1337, DIALOG_STYLE_MSGBOX, title,
- str, "Okay", "" );
- return 1;
- }
- IsPlayerSpawned(playerid){
- new statex = GetPlayerState(playerid);
- if(statex != PLAYER_STATE_NONE && statex != PLAYER_STATE_WASTED && statex != PLAYER_STATE_SPAWNED) return true;
- return false;
- }
- public OnPlayerText(playerid, text[])
- {
- if ( !IsPlayerConnected( playerid ) )
- return 0;
- if ( !IsPlayerSpawned( playerid ) )
- return SendClientMessage( playerid, RED, "You must be spawned to talk!"), 0;
- if ( ChatDisabled == 1 )
- {
- if( pInfo[playerid][Adminlevel] == 0)
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Chat is disabled, only Administrators can talk!"), 0;
- }
- if ( playerMuted{ playerid } )
- return SendClientMessage( playerid, RED, "You are muted, you cannot talk!"), 0;
- if ( text[ 0 ] == '!' && pInfo[ playerid ][ Adminlevel ] > 0 )
- {
- new str[ 128 ], pName[ MAX_PLAYER_NAME ];
- GetPlayerName( playerid, pName, sizeof ( pName ) );
- format( str, sizeof ( str ), "[AdminChat] %s [%d] : %s", pName, playerid, text[ 1 ] );
- SendMessageToAdmins(-1, str );
- return 0;
- }
- for(new d; d<sizeof(Filter); d++)
- if(strfind(text,Filter[d],true) != -1)
- {
- SendClientMessage(playerid,RED,"ERROR:{FFFFFF} Censored word!");
- return 0;
- }
- new string[128];
- format(string, sizeof(string), "%s[%d]: {FFFFFF}%s", GetName( playerid ), playerid, text);
- SendClientMessageToAll( GetPlayerColor( playerid ), string );
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- if((pInfo[playerid][VIPlevel] == 0 || pInfo[playerid][Adminlevel] == 0))
- {
- for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE," ");
- new str[128],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[AUTO - BAN] %s has been automatically banned from the server. Reason: Spawning a jetpack!", name);
- SendClientMessageToAll(RED, str);
- SendClientMessage(playerid,RED, "------------------------------------------------------------------------------------");
- SendClientMessage(playerid,RED, "You were banned from the server due to spawning a jetpack!");
- SendClientMessage(playerid,RED, "If you think you were banned unfairly, you can make an unban appeal at our forums");
- SendClientMessage(playerid,RED, "We do not unban hackers, and we do not unban players who lie in their unban appeal.");
- SendClientMessage(playerid,RED, "------------------------------------------------------------------------------------");
- SetTimerEx( "BanPlayerJetpack",100, false, "i", playerid);
- SetTimerEx( "KickPlayer",100, false, "i", playerid);
- }
- }
- return 1;
- }
- forward BanPlayerJetpack( playerid );
- public BanPlayerJetpack( playerid )
- return BanEx( playerid, "Jetpack Hack" );
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == dregister)
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
- return 1;
- }
- new hashpass[129];
- WP_Hash(hashpass,sizeof(hashpass),inputtext);
- new INI:file = INI_Open(Path(playerid));
- INI_SetTag(file,"Player's Data");
- INI_WriteString(file,"Password",hashpass);
- INI_WriteInt(file,"AdminLevel",0);
- INI_WriteInt(file,"VIPLevel",0);
- INI_WriteInt(file,"Money",0);
- INI_WriteInt(file,"Scores",0);
- INI_WriteInt(file,"Kills",0);
- INI_WriteInt(file,"Deaths",0);
- INI_WriteInt(file,"Warnings",0);
- INI_Close(file);
- SendClientMessage(playerid, GREEN ,"You successfuly created an account!");
- new
- str[ 128 ];
- format(str, sizeof(str), "[NEW ACCOUNT] Player %s has registered a new account!", GetName(playerid));
- SendClientMessageToAll(GREEN, str);
- return 1;
- }
- }
- if(dialogid == dlogin)
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- new hashpass[129];
- WP_Hash(hashpass,sizeof(hashpass),inputtext);
- if(!strcmp(hashpass,pInfo[playerid][Pass]))
- {
- INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
- SetPlayerScore(playerid,pInfo[playerid][Scores]);
- GivePlayerMoney(playerid,pInfo[playerid][Money]);
- SendClientMessage(playerid, GREEN,"You have successfully logged in");
- new str[ 128 ], name[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, name, MAX_PLAYER_NAME );
- if ( pInfo[ playerid ][ Adminlevel ] > 0 )
- {
- format( str, sizeof ( str ), "Administrator %s has logged in!", name );
- SendClientMessageToAll( 0xFF9500FF, str);
- }
- }
- else
- {
- ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_RED"You have entered an{F81414} incorrect password.\n"COL_WHITE"Please try again","Login","Quit");
- return 1;
- }
- }
- }
- return 1;
- }
- /*___________________________________________________ ADMINISTRATOR COMMANDS___________________________ */
- CMD:acmds(playerid,params[])
- {
- if(pInfo[playerid][Adminlevel] < 1)
- return PlayerIsNotAdmin( playerid );
- ShowPlayerDialog(playerid,acmds,DIALOG_STYLE_MSGBOX,"{FFD000}Admin Commands"," Level 1: /answer, /announce, /slap, /ahide, /adisarm \n Level 2: /pgoto, /cc, /healme, /armourme, /fixme\n Level 3: /respawncars, /freeze, /unfreeze, /pget, /pheal, /parmour, /akill, /kick, /pget \n Level 4: /setmoney, /spec, /specoff, /jail, /unjail, /mute, /unmute, /ban, /godon, /godoff, /setscore, /givemoney \n Level 5: /warn, /setvip, /enablechat, /disablechat\n Level 6: /restart\n Level 7: /setlevel","Ok","");
- return 1;
- }
- CMD:announce(playerid,params[])
- {
- if ( pInfo[playerid][Adminlevel] < 1)
- return PlayerIsNotAdmin( playerid );
- new
- text[128];
- if(sscanf(params, "s", text))
- return SendUsageError( playerid, "/announce [Message]" );
- new
- Text1[128];
- format(Text1, sizeof(Text1), "%s",text);
- GameTextForAll(Text1,10000, 3);
- return 1;
- }
- CMD:answer( playerid, params[] )
- {
- if ( pInfo [ playerid ][ Adminlevel ] < 1 || pInfo [ playerid ] [ VIPlevel ] < 1 )
- return PlayerIsNotAdmin( playerid );
- new
- id,
- answer[ 128 ];
- if ( sscanf( params, "us", id, answer ) )
- return SendUsageError(playerid, "/answer [Name/ID] [Answer]");
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if ( id == playerid )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You cannot answer your own question!");
- if ( !playerAsked{ id } )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} That player hasn't asked a question yet!" );
- new
- str[ 128 ], pRank[ 128 ], pName[ MAX_PLAYER_NAME ];
- GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
- if ( pInfo[ playerid ][ Adminlevel ] > 0 && pInfo[ playerid ][ VIPlevel ] < 1 )
- format( pRank, sizeof ( pRank ), "Admin %s has answered your question!", pName );
- else if ( pInfo[ playerid ][ VIPlevel ] > 0 && pInfo[ playerid ][ VIPlevel ] < 1 )
- format( pRank, sizeof ( pRank ), "VIP %s has answered your question!", pName );
- else if ( pInfo[ playerid ][ Adminlevel ] > 0 && pInfo[ playerid ][ VIPlevel ] > 0 )
- format( pRank, sizeof ( pRank ), "Admin %s has answered your question!", pName );
- SendClientMessage( id, RED, pRank );
- format( str, sizeof ( str ), "Answer: %s", answer );
- SendClientMessage( id, 0x0DE011FF, str );
- SendClientMessage( playerid, 0xFF9500FF, "Your answer has been sent!" );
- playerAsked{ id } = false;
- return 1;
- }
- CMD:slap(playerid,params[])
- {
- if( pInfo[playerid][Adminlevel] < 1)
- return PlayerIsNotAdmin( playerid );
- new id,
- reason[128];
- if( sscanf(params,"us",id, reason))
- return SendUsageError( playerid, "/slap [ID] [Reason]" );
- if( playerid == id)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot slap yourself!");
- new str[128],
- name1[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name1,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof(str), "[SLAP] Administrator %s has slapped %s. Reason: %s", name1, name, reason);
- SendClientMessageToAll(RED,str);
- print(str);
- new Float:Pos[3];
- GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
- SetPlayerPos(id,Pos[0],Pos[1],Pos[2]+05.0);
- PlayerPlaySound(id,1130,Pos[0],Pos[1],Pos[2]+03.0);
- return 1;
- }
- CMD:adisarm(playerid, params[])
- {
- if( pInfo[playerid][Adminlevel] < 1)
- return PlayerIsNotAdmin( playerid );
- new id;
- if(sscanf(params, "u", id) )
- return SendUsageError( playerid, "/adisarm [ID]" );
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if(playerid == id)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot disarm yourself!");
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- ResetPlayerWeapons(id);
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[DISARM] You have sucesfully disarmed %s!", name);
- SendClientMessage(playerid, 0x008080FF, str);
- format(str, sizeof (str), "[DISARM] You have been disarmed by Administrator %s!", aname);
- SendClientMessage(id, 0x008080FF, str);
- return 1;
- }
- CMD:ahide(playerid,params[])
- {
- if ( pInfo[playerid][Adminlevel] < 1)
- return PlayerIsNotAdmin( playerid );
- {
- if(hide[playerid]== 0)
- {
- hide[playerid] = 1;
- return SendClientMessage(playerid, 0x008080FF,"[HIDDEN] You are now hidden in the list of Online Admins.");
- }
- else if(hide[playerid] == 1)
- {
- hide[playerid] = 0;
- return SendClientMessage(playerid,0x008080FF,"[VISIBLE] You are now in visible in the list of online Admins.");
- }
- }
- return 1;
- }
- /*_____________________________________________________________________________*/
- CMD:pgoto(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 2)
- return PlayerIsNotAdmin( playerid );
- new ID,
- pn[ MAX_PLAYER_NAME ],
- an[ MAX_PLAYER_NAME ],
- str[ 128 ];
- if(sscanf(params, "u", ID))
- return SendUsageError( playerid, "/pgoto [Name/ID]" );
- if ( ID == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if( ID == playerid)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot teleport to yourself!");
- GetPlayerName(playerid, an, MAX_PLAYER_NAME);
- GetPlayerName(ID, pn, MAX_PLAYER_NAME);
- new Float:x;
- new Float:y;
- new Float:z;
- GetPlayerPos(ID, x, y, z);
- SetPlayerPos(playerid, x+1, y+1, z);
- format(str, sizeof(str), "[TELEPORT] You have been teleported to %s", pn);
- SendClientMessage(playerid, 0x008080FF, str);
- format(str, sizeof(str), "[TELEPORT] Administrator %s has teleported to your location", an);
- SendClientMessage(ID, 0x008080FF, str);
- if(IsPlayerInAnyVehicle(playerid))
- {
- GetPlayerPos(ID, x, y, z);
- SetVehiclePos(playerid, x+1, y+1, z);
- }
- return 1;
- }
- CMD:cc(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 2)
- return PlayerIsNotAdmin( playerid );
- else
- {
- for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," ");
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"*Admin %s has cleared the chat!",pName);
- SendClientMessageToAll(0xFF9500FF,string);
- }
- return 1;
- }
- CMD:healme(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 2)
- return PlayerIsNotAdmin( playerid );
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, 0x008080FF, "[HEAL] You have healed yourself");
- return 1;
- }
- CMD:armourme(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 2)
- return PlayerIsNotAdmin( playerid );
- SetPlayerArmour(playerid, 100);
- SendClientMessage(playerid, 0x008080FF, "[ARMOUR] You have given yourself armour!");
- return 1;
- }
- CMD:fixme(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 2)
- return PlayerIsNotAdmin( playerid );
- if(!IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are not inside a vehicle!");
- SetVehicleHealth(playerid, 1000);
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, 0x008080FF, "[VEHICLE FIXED] You have successfully repaired your vehicle!");
- return 1;
- }
- /*______________________________________________________________________________*/
- CMD:akill(playerid, params[])
- {
- new id,
- reason[128];
- if( pInfo[playerid][Adminlevel] < 3)
- return PlayerIsNotAdmin( playerid );
- if( sscanf(params, "us", id, reason) )
- return SendUsageError( playerid, "/akill [ID] [Reason]" );
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if( playerid == id)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot kill yourself!");
- SetPlayerHealth(id, 0);
- new str[128],
- name1[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name1,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof(str), "[KILL] Administrator %s has killed %s. Reason: %s", name1, name, reason);
- SendClientMessageToAll(RED, str);
- return 1;
- }
- CMD:freeze( playerid, params[] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 3 )
- return SendClientMessage( playerid, RED, "You are not authorised to use this command" );
- new
- id,
- minutes,
- reason[ 128 ];
- if ( sscanf( params, "uis", id, minutes, reason ) )
- return SendUsageError( playerid, "/freeze [Name/ID] [Minutes] [Reason]" );
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if ( playerFrozen{ id } )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is already frozen!" );
- new
- time = ( minutes * 60000 );
- SetTimerEx( "FreezeTimer", time, false, "i", id );
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[FREEZE] Administrator %s has frozen %s for %i minutes. Reason: %s",
- GetName( playerid ), GetName( id ), minutes, reason );
- SendClientMessageToAll( RED, str );
- playerFrozen{ id } = true;
- TogglePlayerControllable(id,0);
- return 1;
- }
- forward FreezeTimer( playerid );
- public FreezeTimer( playerid )
- {
- if ( !playerFrozen{ playerid } )
- return 1;
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[AUTO - UNFREEZE] %s has been automatically unfrozen.", GetName( playerid ) );
- SendClientMessageToAll(RED, str);
- playerFrozen{ playerid } = false;
- TogglePlayerControllable(playerid,1);
- return 1;
- }
- CMD:unfreeze( playerid, params[ ] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 3 )
- return PlayerIsNotAdmin( playerid );
- new
- id;
- if ( sscanf( params, "u", id ) )
- return SendUsageError( playerid, "/unmute [Name/ID]" );
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if ( !playerFrozen{ id } )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is not frozen!" );
- new
- str6[ 128 ];
- format( str6, sizeof ( str6 ), "[UNFREEZE] Administrator %s has unfrozen %s.", GetName( playerid ), GetName( id ) );
- SendClientMessageToAll( RED, str6 );
- playerFrozen{ id } = false;
- TogglePlayerControllable(id, 1);
- return 1;
- }
- CMD:pget(playerid,params[])
- {
- if(pInfo[playerid][Adminlevel] < 3)
- return PlayerIsNotAdmin( playerid );
- new
- targetid,
- Float:x,
- Float:y,
- Float:z;
- if(sscanf(params, "u", targetid))
- return SendUsageError( playerid, "/pget [Name/ID]" );
- if ( targetid == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if( targetid == playerid)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot teleport to yourself!");
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(targetid, x+1, y+1, z);
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
- GetPlayerName(targetid, name, MAX_PLAYER_NAME);
- format(str, sizeof (str), "[TELEPORT] You have teleported %s to your current location!", name);
- SendClientMessage(playerid, 0x008080FF, str);
- format(str, sizeof (str), "[TELEPORT] Administrator %s has teleported you to his location!", aname);
- SendClientMessage(targetid, 0x008080FF, str);
- return 1;
- }
- CMD:respawncars(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 3)
- return PlayerIsNotAdmin( playerid );
- {
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- SetVehicleToRespawn(i);
- }
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"*Admin %s has re-spawned all vehicles!",pName);
- SendClientMessageToAll(0xFF9500FF,string);
- return 1;
- }
- }
- CMD:pheal(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 3)
- return PlayerIsNotAdmin( playerid );
- new
- playertoheal;
- if( sscanf(params, "u", playertoheal ) )
- return SendUsageError( playerid, "/pheal [ID]" );
- if( playertoheal == playerid )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot heal yourself using this command, please use /heal!");
- else if ( playertoheal == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- SetPlayerHealth(playertoheal, 100);
- new
- str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(playertoheal,name,MAX_PLAYER_NAME);
- format( str, sizeof (str), "[HEAL] You have healed %s!", name);
- SendClientMessage(playerid, 0x008080FF, str);
- format( str, sizeof (str), "[HEALED] You have been healed by Administrator %s",aname);
- SendClientMessage(playertoheal, 0x008080FF, str);
- return 1;
- }
- CMD:parmour(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 3)
- return PlayerIsNotAdmin( playerid );
- new
- playertoarmour;
- if(sscanf(params, "u", playertoarmour ) )
- return SendUsageError( playerid, "/parmour [ID]" );
- if( playertoarmour == playerid )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot give yourself armour using this command, please use /armour");
- else if ( playertoarmour == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- SetPlayerArmour(playertoarmour, 100);
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(playertoarmour,name,MAX_PLAYER_NAME);
- format( str, sizeof (str), "[ARMOUR] You have given %s full armour!", name);
- SendClientMessage(playerid, 0x008080FF, str);
- format( str, sizeof (str), "[ARMOUR] You were given full armour by Administrator %s",aname);
- SendClientMessage(playertoarmour, 0x008080FF, str);
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 3)
- return PlayerIsNotAdmin( playerid );
- new id,
- reason[128];
- if( sscanf(params, "us", id, reason))
- return SendUsageError( playerid, "/kick [Name/ID] [Reason]" );
- if( id == playerid)
- return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot kick yourself" );
- if(id == INVALID_PLAYER_ID)
- return InvalidPlayerError( playerid );
- new
- name1[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME],
- str[128];
- GetPlayerName(playerid,name1,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[KICK] Administrator %s has kicked %s. Reason: %s", name1, name, reason);
- SendClientMessageToAll(RED, str);
- SetTimerEx( "KickPlayer",100, false, "i", id);
- return 1;
- }
- forward KickPlayer( playerid );
- public KickPlayer( playerid )
- return Kick( playerid );
- /*_____________________________________________________________________________*/
- CMD:jail(playerid,params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- new
- id,
- time,
- reason[100],
- plname[MAX_PLAYER_NAME],
- GPlayerName[MAX_PLAYER_NAME],
- szString[128];
- if( sscanf(params,"dds",id,time,reason))
- return SendUsageError(playerid, "/jail [Name/ID] [Minutes] [Reason]");
- if( playerid == id )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot jail yourself!");
- if( playerid == INVALID_PLAYER_ID )
- return InvalidPlayerError(playerid);
- if( Jailed[id] == 1 )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} This player is already jailed!");
- GetPlayerName(id, plname, sizeof(plname));
- GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
- format(szString, sizeof(szString), "[JAIL] Administrator %s(%d) has jailed %s(%d) for %d minute(s). Reason: %s", GetName(playerid), playerid, plname, id, time, reason);
- SendClientMessageToAll(RED, szString);
- SetPlayerInterior(id, 3);
- SetPlayerVirtualWorld(id, 10);
- SetPlayerFacingAngle(id, 360.0);
- SetPlayerPos(id, 197.5662, 175.4800, 1004.0);
- SetPlayerHealth(id, 9999999999.0);
- ResetPlayerWeapons(id);
- Jailed[id] = 1;
- JailTimer[id] = SetTimerEx("Unjail",time*60000, false, "i", id);
- return 1;
- }
- CMD:unjail(playerid,params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- new id;
- if( sscanf(params,"u",id))
- return SendUsageError(playerid, "/unjail [Name/ID]");
- if( playerid == id )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot jail yourself!");
- if( playerid == INVALID_PLAYER_ID )
- return InvalidPlayerError(playerid);
- if( Jailed[id] == 0)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} This player is not jailed!");
- new name[MAX_PLAYER_NAME],
- aname[MAX_PLAYER_NAME],
- str[ 128 ];
- GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof ( str ), "[UNJAIL] Administrator %s(d) has unjailed %s{%d)", aname, playerid, name, id);
- SendClientMessageToAll(RED, str);
- Jailed[id] = 0;
- SetPlayerInterior(id, 0);
- SetPlayerVirtualWorld(id, 0);
- SpawnPlayer(id);
- SetPlayerHealth(id, 100);
- KillTimer(JailTimer[id]);
- return 1;
- }
- public Unjail(playerid)
- {
- if(Jailed[playerid] == 0)
- return 0;
- new
- playerName[24],
- String[128];
- GetPlayerName(playerid, playerName, sizeof(playerName));
- format(String, sizeof(String), "[AUTO - UNJAIL] %s(%d) has been automatically released from jail.", playerName);
- SendClientMessageToAll(RED, String);
- Jailed[playerid] = 0;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SpawnPlayer(playerid);
- SetPlayerHealth(playerid, 100);
- KillTimer(JailTimer[playerid]);
- return 1;
- }
- forward BanPlayer( playerid, reason[] );
- public BanPlayer( playerid, reason[] )
- return BanEx(playerid, reason);
- CMD:ban(playerid, params[])
- {
- new
- id,
- reason[ 50 ];
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- if(sscanf(params, "us", id, reason))
- return SendUsageError( playerid, "/ban [Name/ID] [Reason]" );
- if( playerid == id )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot ban yourself");
- if( playerid == INVALID_PLAYER_ID )
- return InvalidPlayerError(playerid);
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- for(new i = 0; i < 50; i++) SendClientMessage(id, COLOR_WHITE," ");
- format(str, sizeof (str), "[BAN] Administrator %s has banned %s. Reason: %s", aname, name, reason);
- SendClientMessageToAll(RED, str);
- new str1[128],
- str2[128];
- SendClientMessage(id,RED, "------------------------------------------------------------------------------------");
- format(str1, sizeof (str1), "You were banned from the server by Administrator %s!", aname);
- SendClientMessage(id, RED, str1);
- format(str2, sizeof (str2), "Reason: %s", reason);
- SendClientMessage(id, RED, str2);
- SendClientMessage(id,RED, "If you think you were banned unfairly, you can make an unban appeal at our forums");
- SendClientMessage(id,RED, "We do not unban hackers, and we do not unban players who lie in their unban appeal.");
- SendClientMessage(id,RED, "------------------------------------------------------------------------------------");
- SetTimerEx( "BanPlayer",100, false, "is[50]", id, reason);
- SetTimerEx( "KickPlayer",100, false, "i", id);
- return 1;
- }
- CMD:godon( playerid, params[] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 4 )
- return PlayerIsNotAdmin( playerid );
- if ( playerGod{ playerid } )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You already have god mode turned on!");
- SetPlayerHealth(playerid, 9999999999.0);
- SetPlayerArmour(playerid, 9999999999.0);
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[GODMODE - ON] Administrator %s has turned on Godmode.", GetName( playerid ) );
- SendClientMessageToAll(RED, str);
- playerGod{ playerid } = true;
- return 1;
- }
- CMD:godoff( playerid, params[] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 4 )
- return PlayerIsNotAdmin( playerid );
- if ( !playerGod{ playerid } )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You already have god mode turned off!");
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[GODMODE - OFF] Administrator %s has turned off his Godmode.", GetName( playerid ) );
- SendClientMessageToAll(RED, str);
- playerGod{ playerid } = false;
- return 1;
- }
- CMD:setscore(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- new id,
- score;
- if(sscanf(params, "ud", id, score))
- return SendUsageError( playerid, "/setscore [Name/ID] [Score]" );
- if( id == playerid )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot set your own score!");
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- SetPlayerScore(id, score);
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[SCORE] You have set %s's score to %i", name, score);
- SendClientMessage(playerid, 0x008080FF, str);
- format(str, sizeof (str), "[SCORE] Administrator %s has set your score to %i", aname, score);
- SendClientMessage(id, 0x008080FF, str);
- return 1;
- }
- CMD:setmoney(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- new id,
- amount;
- if( sscanf(params, "ui", id, amount))
- return SendUsageError( playerid, "/setmoney [Name/ID] [Cash]" );
- if( id == playerid)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot set your own cash!");
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[MONEY] You have set %s's cash to $%i", name, amount);
- SendClientMessage(playerid, 0x008080FF, str);
- format(str, sizeof (str), "[MONEY] Administrator %s has set your cash to $%i", aname, amount);
- SendClientMessage(id, 0x008080FF, str);
- GivePlayerMoney( id, - GetPlayerMoney( id ) + amount );
- return 1;
- }
- CMD:givemoney(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- new
- id,
- amount;
- if( sscanf(params, "ui", id, amount))
- return SendUsageError( playerid, "/givemoney [Name/ID] [Amount]" );
- if( id == playerid )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot give yourself money!");
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- GivePlayerMoney(id, amount);
- new str[128],
- aname[MAX_PLAYER_NAME],
- name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[MONEY] You have given %s, $%i", name, amount);
- SendClientMessage(playerid, 0x008080FF, str);
- format(str, sizeof (str), "[MONEY] Administrator %s, has given you $%i", aname, amount);
- SendClientMessage(id, 0x008080FF, str);
- return 1;
- }
- CMD:mute( playerid, params[] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 4 )
- return PlayerIsNotAdmin( playerid );
- new
- id,
- minutes,
- reason[ 128 ];
- if ( sscanf( params, "uis", id, minutes, reason ) )
- return SendUsageError(playerid, "/mute [Name/ID] [Minutes] [Reason]");
- if ( id == playerid )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot mute yourself!");
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError(playerid);
- if ( playerMuted{ id } )
- return SendClientMessage( playerid, RED, "ERROR{FFFFFF} Player is already muted." );
- new
- time = ( minutes * 60000 );
- SetTimerEx( "MuteTimer", time, false, "i", id );
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[MUTE] Administrator %s has muted %s for %i minutes. Reason: %s",
- GetName( playerid ), GetName( id ), minutes, reason );
- SendClientMessageToAll( RED, str );
- playerMuted{ id } = true;
- return 1;
- }
- forward MuteTimer( playerid );
- public MuteTimer( playerid )
- {
- if ( !playerMuted{ playerid } )
- return 1;
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[AUTO - UNMUTE] %s has been automatically unmuted.", GetName( playerid ) );
- SendClientMessageToAll(RED, str);
- playerMuted{ playerid } = false;
- return 1;
- }
- CMD:unmute( playerid, params[ ] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 4 )
- return PlayerIsNotAdmin( playerid );
- new
- id;
- if ( sscanf( params, "u", id ) )
- return SendClientMessage( playerid, RED, "USAGE : /unmute [id/name]" );
- if ( id == playerid )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You cannot unmute yourself." );
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError(playerid);
- if ( !playerMuted{ id } )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is not muted." );
- new
- str6[ 128 ];
- format( str6, sizeof ( str6 ), "[UNMUTE] Administrator %s has unmuted %s.", GetName( playerid ), GetName( id ) );
- SendClientMessageToAll( RED, str6 );
- playerMuted{ id } = false;
- return 1;
- }
- CMD:spec(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- new
- pid;
- if( sscanf(params,"d",pid))
- return SendUsageError( playerid, "/spec [ID]" );
- if ( pid == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if( pid == playerid)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot spectate yourself!");
- if(GetPVarInt(playerid, "Spectating") == 1)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are already spectating. (/specoff)");
- SetPVarInt(playerid, "Spectating", 1);
- StartPlayerSpec(playerid, pid);
- new str[128],
- name[MAX_PLAYER_NAME];
- GetPlayerName(pid,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[SPECTATING] You are now spectating %s!", name);
- SendClientMessage(playerid, 0x008080FF, str);
- return 1;
- }
- CMD:specoff(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 4)
- return PlayerIsNotAdmin( playerid );
- if(GetPVarInt(playerid, "Spectating") == 0)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are not spectating anyone.");
- DeletePVar(playerid, "Spectating");
- StopPlayerSpec(playerid);
- SendClientMessage(playerid, 0x008080FF, "[SPECTATE] You have stopped spectating!");
- return 1;
- }
- /*______________________________________________________________________________*/
- CMD:warn( playerid, params[ ] )
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 5)
- return PlayerIsNotAdmin( playerid );
- new
- id,
- reason[ 128 ];
- if ( sscanf( params, "us", id, reason ) )
- return SendClientMessage( playerid, RED, "USAGE: /warn [id/name] [reason]" );
- if ( id == INVALID_PLAYER_ID )
- return SendClientMessage( playerid, RED, "That player is not connected." );
- if ( id == playerid )
- return SendClientMessage( playerid, RED, "ERROR: You cannot warn yourself!" );
- pInfo[ id ][ Warnings ] ++;
- new
- str[ 128 ];
- format( str, sizeof ( str ), "[WARN] Administrator %s has warned %s. Reason: %s (Warning %i / 3)",
- GetName( playerid ), GetName( id ), reason, pInfo[ id ][ Warnings ] );
- SendClientMessageToAll( RED, str );
- if ( pInfo[ id ][ Warnings ] == 3 )
- {
- format( str, sizeof ( str ), "[AUTO - KICK] %s has been kicked due to having a total of 3 warnings.", GetName( id ) );
- SendClientMessageToAll( RED, str );
- pInfo[ id ][ Warnings ] = 0;
- SetTimerEx( "KickPlayer", 100, false, "i", id );
- }
- return 1;
- }
- CMD:setvip( playerid, params[ ] )
- {
- new
- targetid,
- level;
- if ( pInfo[ playerid ][ Adminlevel ] < 5 )
- return PlayerIsNotAdmin( playerid );
- if ( sscanf( params, "ui", targetid, level ) )
- return SendUsageError( playerid, "/setvip [Name/ID] [Level]" );
- if ( targetid == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if ( targetid == playerid )
- return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot set your own V.I.P level" );
- if ( level < 0 || level > 3 )
- return SendClientMessage ( playerid, RED, "ERROR: {FFFFFF}Invalid V.I.P level");
- new str[ 128 ];
- format( str, 128, "Your V.I.P level has been set to %i", level );
- SendClientMessage(targetid,RED, str );
- pInfo[ targetid ][ VIPlevel ] = level;
- format( str, sizeof ( str ), "%s's V.I.P level has been set to %i", GetName( targetid ), level );
- SendMessageToAdmins( RED, str );
- return 1;
- }
- CMD:disablechat(playerid, params[])
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 5 )
- return PlayerIsNotAdmin( playerid );
- if ( ChatDisabled == 1 )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Chat is already disabled!");
- ChatDisabled = 1;
- SendClientMessage(playerid, INFO, "[CHAT DISABLED] You have sucesfully disabled the chat!");
- new
- str[128];
- format(str, sizeof(str), "[CHAT DISABLED] Administrator %s has disabled the chat, only Administrators can now talk!", GetName(playerid));
- SendClientMessageToAll(RED, str);
- return 1;
- }
- CMD:enablechat(playerid, params[])
- {
- if ( pInfo[ playerid ][ Adminlevel ] < 5 )
- return PlayerIsNotAdmin( playerid );
- if ( ChatDisabled == 0 )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Chat is already enabled!");
- ChatDisabled = 0;
- SendClientMessage(playerid, INFO, "[CHAT ENABLED] You have sucesfully enabled the chat!");
- new
- str[128];
- format(str, sizeof(str), "[CHAT ENABLED] Administrator %s has enabled the chat, everyone can now talk!", GetName(playerid));
- SendClientMessageToAll(RED, str);
- return 1;
- }
- /*_____________________________________________________________________________*/
- CMD:restart(playerid, params[])
- {
- if(pInfo[playerid][Adminlevel] < 6)
- return PlayerIsNotAdmin( playerid );
- GameTextForAll("~r~THE SERVER IS RESTARTING",10000,5);
- for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," ");
- SendRconCommand("gmx");
- return 1;
- }
- /*_____________________________________________________________________________*/
- CMD:setlevel( playerid, params[ ] )
- {
- new
- targetid,
- level;
- if ( pInfo[ playerid ][ Adminlevel ] < 7 )
- return PlayerIsNotAdmin( playerid );
- if ( sscanf( params, "ui", targetid, level ) )
- return SendUsageError( playerid, "/setlevel [Name/ID] [Level]" );
- if ( targetid == playerid )
- return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot set your own Admin level" );
- if ( targetid == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if ( level < 0 || level > 6 )
- return SendClientMessage ( playerid, RED, "ERROR: {FFFFFF}Invalid Admin level");
- new str[ 128 ];
- format( str, 128, "[ADMIN LEVEL] Head Administrator %s has set %s's Admin status to %i", GetName ( playerid ), GetName ( targetid ), level );
- SendClientMessage(targetid,RED, str );
- pInfo[ targetid ][ Adminlevel ] = level;
- format( str, sizeof ( str ), "[ADMINS] %s changed %s's Admin level to %i", GetName ( playerid ), GetName ( targetid ), level );
- SendMessageToAdmins( RED, str );
- return 1;
- }
- /*_____________________________________________________________________________*/
- /*__________________________VIP COMMANDS___________________________________*/
- CMD:addnos( playerid, params[ ] )
- {
- if ( pInfo[ playerid ][ VIPlevel ] < 1 )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
- if ( !IsPlayerInAnyVehicle( playerid ) )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You must be inside a vehicle!");
- switch( GetVehicleModel( GetPlayerVehicleID( playerid ) ) )
- {
- case 448, 461, 462, 463, 468, 471, 509, 510, 521, 522, 523, 581, 586, 449:
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot tune this vehicle!");
- }
- AddVehicleComponent( GetPlayerVehicleID( playerid ), 1010 );
- PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
- return 1;
- }
- CMD:flip( playerid, params[ ] )
- {
- if ( pInfo[ playerid ][ VIPlevel ] < 1 )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
- new Float: zAng;
- GetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
- SetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
- SendClientMessage(playerid, RED, "[FLIPPED] Vehicle sucesfully flipped");
- return 1;
- }
- /*_____________________________________________________________________________*/
- CMD:vcmds(playerid, params[ ])
- {
- ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "VIP Commands", "Level 1: /nos, /flip \nLevel 2: /vspec, /vspecoff \nLevel 3: /jetpack", "Ok", "");
- }
- CMD:vspec(playerid, params[])
- {
- if ( pInfo[ playerid ][ VIPlevel ] < 2 )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
- new
- pid;
- if( sscanf(params,"d",pid))
- return SendUsageError( playerid, "/spec [ID]" );
- if ( pid == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if( pid == playerid)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot spectate yourself!");
- if( GetPVarInt(playerid, "Spectating") == 1)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are already spectating. (/specoff)");
- SetPVarInt(playerid, "Spectating", 1);
- StartPlayerSpec(playerid, pid);
- new str[128],
- name[MAX_PLAYER_NAME];
- GetPlayerName(pid,name,MAX_PLAYER_NAME);
- format(str, sizeof (str), "[SPECTATING] You are now spectating %s!", name);
- SendClientMessage(playerid, 0x008080FF, str);
- return 1;
- }
- CMD:vspecoff(playerid, params[])
- {
- if ( pInfo[ playerid ][ VIPlevel ] < 2 )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
- if(GetPVarInt(playerid, "Spectating") == 0)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are not spectating anyone.");
- DeletePVar(playerid, "Spectating");
- StopPlayerSpec(playerid);
- SendClientMessage(playerid, 0x008080FF, "[SPECTATE] You have stopped spectating!");
- return 1;
- }
- /*_____________________________________________________________________________*/
- CMD:jetpack(playerid, params[])
- {
- if ( pInfo[ playerid ][ VIPlevel ] < 2 )
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
- SendClientMessage(playerid, RED, "You have sucesfully spawned a jetpack!");
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
- return 1;
- }
- /*________________________________________________ NORMAL PLAYER COMMANDS ______________________________*/
- CMD:status( playerid, params[ ] )
- {
- new
- str[ 1024 ];
- format( str, sizeof ( str ),
- "{FFFFFF}Admin Level: {33FF33}%d \n\
- {FFFFFF}VIP Level: {33FF33}%d \n\
- {FFFFFF}Total warnings: {33FF33}%d \n\
- {FFFFFF}Money: {33FF33}$%d \n\
- {FFFFFF}Score: {33FF33}%d \n\
- {FFFFFF}Kills: {33FF33}%d \n\
- {FFFFFF}Deaths: {33FF33}%d",
- pInfo[ playerid ][ Adminlevel ], pInfo[ playerid ][ VIPlevel ], pInfo[ playerid ][ Warnings ], GetPlayerMoney( playerid ), GetPlayerScore( playerid ), pInfo[ playerid ][ Kills ], pInfo[ playerid ][ Deaths ] );
- ShowPlayerDialog( playerid, 1337, DIALOG_STYLE_MSGBOX, "{FFFFFF}Your stats",
- str, "Okay", "" );
- 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, 0x009DFFFF,"USAGE:{FFFFFF} /pm [ID] [Message]");
- return 1;
- }
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} This player is not connected");
- if(playerid == id)
- return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot send a PM yourself!");
- {
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "PM sent to %s(%d): %s", Name2, id, str2);
- SendClientMessage(playerid, 0xFFF700FF, str);
- format(str, sizeof(str), "PM from %s(%d): %s", Name1, playerid, str2);
- SendClientMessage(id, 0xFFF700FF, str);
- }
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- new count = 0, string[256];
- SendClientMessage(playerid, 0x0AFF1FFF,"-----|Current online Admins|------");
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- if(hide[i] == 0)
- {
- if(pInfo[i][Adminlevel] == 1)
- {
- format(string, sizeof(string),"Admin Rank 1:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 2)
- {
- format(string, sizeof(string),"Admin Rank 2:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 3)
- {
- format(string, sizeof(string),"Admin Rank 3:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 4)
- {
- format(string, sizeof(string),"Admin Rank 4:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 5)
- {
- format(string, sizeof(string),"Admin Rank 5:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 6)
- {
- format(string, sizeof(string),"Admin Rank 6:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 7)
- {
- format(string, sizeof(string),"Head Administrator:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0xFF1212FF, string);
- count++;
- }
- }
- }
- }
- if(count == 0)
- {
- SendClientMessage(playerid, 0x00B3FFFF,"----|There are currently no Admins online|----");
- }
- return 1;
- }
- CMD:vips(playerid, params[])
- {
- new count = 0, string[256];
- SendClientMessage(playerid, 0x0AFF1FFF,"-----|Current online VIPs|------");
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- if(hide[i] == 0)
- {
- if(pInfo[i][VIPlevel] == 1)
- {
- format(string, sizeof(string),"Silver VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][VIPlevel] == 2)
- {
- format(string, sizeof(string),"Platinum VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- if(pInfo[i][Adminlevel] == 3)
- {
- format(string, sizeof(string),"Gold VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
- SendClientMessage(playerid, 0x00B3FFFF, string);
- count++;
- }
- }
- }
- }
- if(count == 0)
- {
- SendClientMessage(playerid, 0x00B3FFFF,"----|There are currently no VIPs online|----");
- }
- return 1;
- }
- CMD:report( playerid, params[ ] )
- {
- new
- targetid,
- reason[ 128 ];
- if ( sscanf( params, "us", targetid, reason ) )
- return SendUsageError( playerid, "/report [Name/ID] [Reason]" );
- if ( targetid == playerid )
- return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot report yourself." );
- if ( targetid == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- SendClientMessage( playerid, RED, "Your report has been successfully been sent to all online Administrators!" );
- new
- playerName[ MAX_PLAYER_NAME ],
- targetName[ MAX_PLAYER_NAME ],
- str[ 128 ];
- GetPlayerName( playerid, playerName, MAX_PLAYER_NAME );
- GetPlayerName( targetid, targetName, MAX_PLAYER_NAME );
- format( str, 128, "[NEW REPORT] %s [%d] has reported %s [%d]",
- playerName, playerid, targetName, targetid );
- SendMessageToAdmins( 0xFF9500FF, str );
- format( str, 128, "[REPORT] %s", reason );
- SendMessageToAdmins( 0xFF9500FF, str );
- return 1;
- }
- CMD:ask( playerid, params[ ] )
- {
- if ( playerAsked{ playerid } )
- return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You have already asked a question, please wait patiently for your answer!");
- new
- str[ 128 ];
- if ( sscanf( params, "s", str ) )
- return SendUsageError( playerid, "/ask [Question]" );
- new
- str2[ 128 ], str3[ 128 ],
- pName[ MAX_PLAYER_NAME ],
- count = 0;
- GetPlayerName( playerid, pName, sizeof ( pName ) );
- format( str2, sizeof ( str2 ), "[NEW QUESTION] %s has asked a question", pName );
- format( str3, sizeof ( str3 ), "[QUESTION] %s", str );
- for ( new i, j = GetMaxPlayers (); i < j; i ++ )
- {
- if ( i == INVALID_PLAYER_ID )
- continue;
- if ( pInfo[ i ][ Adminlevel ] > 0 || pInfo[ i ][ VIPlevel ] > 0 )
- {
- count ++;
- SendClientMessage( i, 0xFF9500FF, str2 );
- SendClientMessage( i, 0xFF9500FF, str3 );
- }
- }
- if ( !count )
- SendClientMessage( playerid, RED, "ERROR:{FFFFFF} There are currently no helpers/VIPSs online." );
- else {
- SendClientMessage( playerid, RED, "Your question has been sent to all online Admins/VIPs, please wait!" );
- playerAsked{ playerid } = true;
- }
- return 1;
- }
- CMD:sendcash(playerid, params[])
- {
- new
- id,
- amount;
- if(sscanf(params, "ui", id, amount))
- return SendUsageError( playerid, "/sendcash [Name/ID] [Cash]" );
- if( id == playerid)
- return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot send yourself cash!");
- if ( id == INVALID_PLAYER_ID )
- return InvalidPlayerError( playerid );
- if ( amount > GetPlayerMoney( playerid ) )
- return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You don't have that much money!" );
- GivePlayerMoney( playerid, - amount);
- GivePlayerMoney ( id, amount );
- return 1;
- }cm
Advertisement
Add Comment
Please, Sign In to add comment