administration commands placed into modules
This commit is contained in:
parent
9d0d864f48
commit
984f154d93
@ -6,8 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// config
|
// config
|
||||||
#include "irresistible\config\database.pwn" // keep #1
|
#include "irresistible\config\_config.pwn"
|
||||||
#include "irresistible\config\colors.pwn"
|
|
||||||
|
|
||||||
// anticheat
|
// anticheat
|
||||||
#include "irresistible\anticheat\_anticheat.pwn"
|
#include "irresistible\anticheat\_anticheat.pwn"
|
||||||
@ -27,12 +26,9 @@
|
|||||||
#include "irresistible\gta\_gta.pwn"
|
#include "irresistible\gta\_gta.pwn"
|
||||||
|
|
||||||
// cnr configuration
|
// cnr configuration
|
||||||
#include "irresistible\cnr\player.pwn"
|
#include "irresistible\cnr\_cnr.pwn"
|
||||||
#include "irresistible\cnr\global.pwn"
|
|
||||||
#include "irresistible\cnr\classes.pwn"
|
// commands
|
||||||
#include "irresistible\cnr\cities.pwn"
|
|
||||||
#include "irresistible\cnr\dialog_ids.pwn"
|
|
||||||
#include "irresistible\cnr\vip.pwn"
|
|
||||||
|
|
||||||
// features
|
// features
|
||||||
#include "irresistible\features\fps.pwn"
|
#include "irresistible\features\fps.pwn"
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
* Irresistible Gaming (c) 2018
|
* Irresistible Gaming (c) 2018
|
||||||
* Developed by Lorenc Pekaj
|
* Developed by Lorenc Pekaj
|
||||||
* Module:
|
* Module: cnr/_cnr.pwn
|
||||||
* Purpose:
|
* Purpose: ecnloses all cnr related components (cnr)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* ** Includes ** */
|
/* ** Includes ** */
|
||||||
#include < YSI\y_hooks >
|
#include "irresistible\cnr\player.pwn"
|
||||||
|
#include "irresistible\cnr\global.pwn"
|
||||||
/* ** Definitions ** */
|
#include "irresistible\cnr\classes.pwn"
|
||||||
|
#include "irresistible\cnr\textdraws.pwn"
|
||||||
/* ** Variables ** */
|
#include "irresistible\cnr\cities.pwn"
|
||||||
|
#include "irresistible\cnr\dialog_ids.pwn"
|
||||||
/* ** Hooks ** */
|
#include "irresistible\cnr\vip.pwn"
|
||||||
|
#include "irresistible\cnr\commands\_commands.pwn"
|
||||||
/* ** Functions ** */
|
|
||||||
|
9
gamemodes/irresistible/cnr/commands/_commands.pwn
Normal file
9
gamemodes/irresistible/cnr/commands/_commands.pwn
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/_admin.pwn
|
||||||
|
* Purpose: encloses all commands
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Includes ** */
|
||||||
|
#include "irresistible\cnr\commands\admin\_admin.pwn"
|
45
gamemodes/irresistible/cnr/commands/admin/_admin.pwn
Normal file
45
gamemodes/irresistible/cnr/commands/admin/_admin.pwn
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/_admin.pwn
|
||||||
|
* Purpose: encloses all admin related commands
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Definitions ** */
|
||||||
|
#define ADMIN_COMMAND_REJECT "You don't have an appropriate administration level to use this command."
|
||||||
|
#define ADMIN_COMMAND_TIME 4
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:acommands( playerid, params[ ] ) return cmd_acmds( playerid, params );
|
||||||
|
CMD:acmds( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
SendClientMessage( playerid, COLOR_GREY, "|______________________________________| Admin Commands |_____________________________________|" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " " );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /goto, /spec(off), /(un)jail, /asay, /slap, /a, /getstats, /stpfr, /setskin, /frules, /fpc, /ticketlog" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /pinfo, /warn, /aspawn, /ans, /stpfa, /alog, /(un)freeze, /aod, /respawnalluv, /reports, /questions" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /respond, /mutelist, /aka, /arepair, /viewdeathmsg" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 2: /kick, /vdestroy, /(un)mute, /explode, /vrespawn, /arenas, /suspend, /viewnotes, /slay" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /ban, /bring, /clearchat, /(ann)ounce, /giveweapon, /vadminpark, /vcreate, /healall, /getip, /smlog, /iclog" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /vadminstats, /pingimmune, /vbring, /countdown, /forcecoptutorial, /vgoto, /copwarn, /armywarn, /resetwep" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /venter, /geolocate" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 4: /circleall, /giveweaponall, /resetwepall, /motd, /uncopban, /unarmyban, /setworld, /destroyallav, /gotopos" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 4: /addnote, /removenote" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /createhouse, /destroyhouse, /respawnallv, /achangename, /toggleviewpm, /unban(ip)" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /createcar, /destroycar, /stripcarmods, /createbribe, /destroybribe, /doublexp, /(h/v)adminsell" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /autovehrespawn, /megaban, /acunban, /creategate, /editgate, /connectsong, /discordurl" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /creategarage, /destroygarage, /check" );
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] > 5 ) {
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 6: /setirc, /seteventhost, /setlevel, /setleveloffline, /svrstats, /playaction, /playanimation" );
|
||||||
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 6: /updaterules, /truncate, /broadcast, /setgangleader, /viewgangtalk, /createentrance, /destroyentrance" );
|
||||||
|
}
|
||||||
|
|
||||||
|
SendClientMessage( playerid, COLOR_GREY, "|_____________________________________________________________________________________________|" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ** Modules ** */
|
||||||
|
#include "irresistible\cnr\commands\admin\admin_one.pwn"
|
||||||
|
#include "irresistible\cnr\commands\admin\admin_two.pwn"
|
||||||
|
|
750
gamemodes/irresistible/cnr/commands/admin/admin_five.pwn
Normal file
750
gamemodes/irresistible/cnr/commands/admin/admin_five.pwn
Normal file
@ -0,0 +1,750 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_five.pwn
|
||||||
|
* Purpose: level five administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:armorall( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
new world = GetPlayerVirtualWorld( playerid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given armor to everybody in their world", ReturnPlayerName( playerid ), playerid );
|
||||||
|
foreach ( new i : Player ) {
|
||||||
|
if ( !p_Jailed{ i } && world == GetPlayerVirtualWorld( i ) ) SetPlayerArmour( i, 100.0 );
|
||||||
|
}
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" Everyone has been given armor by %s(%d) in their world!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:check( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/check [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
playerserial[ 45 ];
|
||||||
|
|
||||||
|
gpci( pID, playerserial, sizeof( playerserial ) ); // playerserial
|
||||||
|
|
||||||
|
format( szNormalString, sizeof( szNormalString ), "SELECT `NAME`,`IP`,`COUNTRY` FROM `BANS` WHERE `SERIAL`='%s' LIMIT 32", mysql_escape( playerserial ) );
|
||||||
|
mysql_function_query( dbHandle, szNormalString, true, "readgpcibans", "dd", playerid, pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread readgpcibans( playerid, searchid )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
rows, fields
|
||||||
|
;
|
||||||
|
cache_get_data( rows, fields );
|
||||||
|
|
||||||
|
if ( rows )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szName[ MAX_PLAYER_NAME ],
|
||||||
|
szIP[ 16 ],
|
||||||
|
szCountry[ 3 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
szLargeString = ""COL_GREY"Username\t"COL_GREY"IP Address\t"COL_GREY"Country (XX)\n";
|
||||||
|
|
||||||
|
for( new i = 0; i < rows; i++ )
|
||||||
|
{
|
||||||
|
cache_get_field_content( i, "COUNTRY", szCountry );
|
||||||
|
cache_get_field_content( i, "NAME", szName );
|
||||||
|
cache_get_field_content( i, "IP", szIP );
|
||||||
|
|
||||||
|
if ( isnull( szCountry ) )
|
||||||
|
szCountry = "-";
|
||||||
|
|
||||||
|
format( szLargeString, sizeof( szLargeString ), "%s%s\t%s\t%s\n", szLargeString, szName, szIP, szCountry );
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST_HEADERS, sprintf( "{FFFFFF}Serial check on %s(%d)", ReturnPlayerName( searchid ), searchid ), szLargeString, "Okay", "" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
SendError( playerid, "This user looks clean!" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:c( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
msg[ 90 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return 0;
|
||||||
|
else if ( sscanf( params, "s[90]", msg ) ) return SendUsage( playerid, "/c [MESSAGE]" );
|
||||||
|
else if ( textContainsIP( msg ) ) return SendServerMessage( playerid, "Please do not advertise." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach(new councilid : Player)
|
||||||
|
if ( p_AdminLevel[ councilid ] >= 5 || IsPlayerUnderCover( councilid ) )
|
||||||
|
SendClientMessageFormatted( councilid, -1, "{00CCFF}<Council Chat> %s(%d):"COL_GREY" %s", ReturnPlayerName( playerid ), playerid, msg );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:creategarage( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
cost, iTmp, iVehicle,
|
||||||
|
Float: X, Float: Y, Float: Z, Float: Angle
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", cost ) ) return SendUsage( playerid, "/creategarage [COST]" );
|
||||||
|
else if ( cost < 100 ) return SendError( playerid, "The price must be located above 100 dollars." );
|
||||||
|
else if ( !( iVehicle = GetPlayerVehicleID( playerid ) ) ) return SendError( playerid, "You are not in any vehicle." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has created a garage", ReturnPlayerName( playerid ), playerid );
|
||||||
|
|
||||||
|
if ( GetVehiclePos( iVehicle, X, Y, Z ) && GetVehicleZAngle( iVehicle, Angle ) )
|
||||||
|
{
|
||||||
|
if ( ( iTmp = CreateGarage( 0, cost, 0, X, Y, Z, Angle ) ) != -1 )
|
||||||
|
{
|
||||||
|
SaveToAdminLog( playerid, iTmp, "created garage" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" You have created a %s garage taking up garage id %d.", number_format( cost ), iTmp );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" Unable to create a garage due to a unexpected error." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroygarage( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iGarage
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", iGarage ) ) return SendUsage( playerid, "/destroygarage [GARAGE_ID]" );
|
||||||
|
else if ( iGarage < 0 || iGarage >= MAX_GARAGES ) return SendError( playerid, "Invalid Garage ID." );
|
||||||
|
else if ( !Iter_Contains( garages, iGarage ) ) return SendError( playerid, "Invalid Garage ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLog( playerid, iGarage, "destroy garage" );
|
||||||
|
format( szBigString, sizeof( szBigString ), "[DG] [%s] %s | %d | %d\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), g_garageData[ iGarage ] [ E_OWNER_ID ], iGarage );
|
||||||
|
AddFileLogLine( "log_garages.txt", szBigString );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a garage", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GARAGE]"COL_WHITE" You have destroyed the garage ID %d.", iGarage );
|
||||||
|
DestroyGarage( iGarage );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:connectsong( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szURL[ 128 ];
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[128]", szURL ) ) return SendUsage( playerid, "/connectsong [SONG_URL]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "updated connection song to %s", szURL );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has set the connection song to: "COL_GREY"%s", ReturnPlayerName( playerid ), playerid, szURL );
|
||||||
|
UpdateServerVariable( "connectsong", 0, 0.0, szURL, GLOBAL_VARTYPE_STRING );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:discordurl( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szURL[ 128 ];
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[128]", szURL ) ) return SendUsage( playerid, "/discordurl [DISCORD_URL]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "updated discord url to %s", szURL );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has set the discord url to: "COL_GREY"%s", ReturnPlayerName( playerid ), playerid, szURL );
|
||||||
|
UpdateServerVariable( "discordurl", 0, 0.0, szURL, GLOBAL_VARTYPE_STRING );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:creategate( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID, password[ 8 ], model, Float: speed, Float: range,
|
||||||
|
Float: X, Float: Y, Float: Z
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"dffs[8]", pID, model, speed, range, password ) ) return SendUsage( playerid, "/creategate [PLAYER_ID] [MODEL_ID] [SPEED] [RANGE] [PASSWORD]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( model < 0 || model > 20000 ) return SendError( playerid, "Invalid Object Model." );
|
||||||
|
else if ( speed < 1.0 || speed > 100.0 ) return SendError( playerid, "Please specify a speed between 1.0 and 100.0." );
|
||||||
|
else if ( range < 2.5 || speed > 500.0 ) return SendError( playerid, "Please specify a range between 2.5 and 500.0." );
|
||||||
|
else if ( strlen( password ) > 4 ) return SendError( playerid, "Password length can be only a maximum of four characters." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetXYInFrontOfPlayer( playerid, X, Y, Z, 5.0 );
|
||||||
|
new iTmp = CreateGate( pID, password, model, speed, range, X, Y, Z, 0.0, 0.0, 0.0 );
|
||||||
|
if ( iTmp != -1 ) {
|
||||||
|
SaveToAdminLog( playerid, iTmp, "created gate" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GATE]"COL_WHITE" You have created a gate taking place of ID: %d", iTmp );
|
||||||
|
}
|
||||||
|
else SendClientMessage( playerid, -1, ""COL_PINK"[GATE]"COL_WHITE" Unable to create a gate due to a unexpected error." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:editgate( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
gID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", gID ) ) return SendUsage( playerid, "/editgate [GATE_ID]" );
|
||||||
|
else if ( !Iter_Contains( gates, gID ) ) return SendError( playerid, "Invalid Gate ID" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szLargeString, sizeof( szLargeString ),
|
||||||
|
""COL_RED"Remove This Gate?\t \nOwner ID\t"COL_GREY"%d\nName\t"COL_GREY"%s\nPassword\t"COL_GREY"%s\nModel\t"COL_GREY"%d\nSpeed\t"COL_GREY"%f\nRange\t"COL_GREY"%f\nPause\t"COL_GREY"%d MS\nGang ID\t%d\nChange Closed Positioning\t \nChange Opened Positioning\t ",
|
||||||
|
g_gateData[ gID ] [ E_OWNER ], g_gateData[ gID ] [ E_NAME ], g_gateData[ gID ] [ E_PASS ], g_gateData[ gID ] [ E_MODEL ], g_gateData[ gID ] [ E_SPEED ], g_gateData[ gID ] [ E_RANGE ], g_gateData[ gID ] [ E_TIME ], g_gateData[ gID ] [ E_GANG_SQL_ID ]
|
||||||
|
);
|
||||||
|
|
||||||
|
SetPVarInt( playerid, "gate_editing", gID );
|
||||||
|
SaveToAdminLog( playerid, gID, "editing gate" );
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_GATE, DIALOG_STYLE_TABLIST, "{FFFFFF}Edit Gate", szLargeString, "Select", "Cancel" );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:acunban( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
address[ 16 ];
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf(params, "s[16]", address ) ) SendUsage( playerid, "/acunban [IP_ADDRESS]" );
|
||||||
|
else if ( !textContainsIP( params ) ) return SendError( playerid, "This is not an IP address." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UnBlockIpAddress( address );
|
||||||
|
SetServerRule( "unbanip", address );
|
||||||
|
SetServerRule( "reloadbans", "" );
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "acunban %s", address );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[AC UNBAN]{FFFFFF} You've unbanned %s from the anti-cheat.", address );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has un-banned %s", ReturnPlayerName( playerid ), playerid, address );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:safeisbugged( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
new
|
||||||
|
Float: distance = 99999.99,
|
||||||
|
robberyid = getClosestRobberySafe( playerid, distance )
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( robberyid != INVALID_OBJECT_ID )
|
||||||
|
{
|
||||||
|
SendClientMessage( playerid, COLOR_GOLD, "___ SAFE DATA ___");
|
||||||
|
SendClientMessageFormatted( playerid, -1, "OPEN : %d | ROBBED : %d | C4 : %d | DRILL : %d | DRILL PLACER : %d | DRILL EFFECT : %d",
|
||||||
|
g_robberyData[ robberyid ] [ E_OPEN ], g_robberyData[ robberyid ] [ E_ROBBED ], g_robberyData[ robberyid ] [ E_C4 ],
|
||||||
|
g_robberyData[ robberyid ] [ E_DRILL ], g_robberyData[ robberyid ] [ E_DRILL_PLACER ], g_robberyData[ robberyid ] [ E_DRILL_EFFECT ] );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, "REPLENISH : %d | RAW TIMESTAMP : %d | CURRENT TIME: %d | ID : %d | NAME : %s",
|
||||||
|
g_robberyData[ robberyid ] [ E_ROB_TIME ] - g_iTime, g_robberyData[ robberyid ] [ E_ROB_TIME ], g_iTime, robberyid, g_robberyData[ robberyid ] [ E_NAME ] );
|
||||||
|
}
|
||||||
|
else return SendError( playerid, "You're not near any safe." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:autovehrespawn( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
#if defined _vsync_included
|
||||||
|
#pragma unused rl_AutoVehicleRespawner
|
||||||
|
SendError( playerid, "This feature is disabled as protection for car warping is enabled (VehicleSync)." );
|
||||||
|
#else
|
||||||
|
new tick;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", tick ) ) return SendUsage( playerid, "/autovehrespawn [MILLISECONDS (0 = DISABLE)]" );
|
||||||
|
else if ( tick != 0 && tick < 2500 ) return SendError( playerid, "The respawn tick cannot be less than 2500ms." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( tick == 0 ) {
|
||||||
|
KillTimer( rl_AutoVehicleRespawner );
|
||||||
|
rl_AutoVehicleRespawner = 0xFF;
|
||||||
|
SendServerMessage( playerid, "Auto vehicle spawner disabled." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
KillTimer( rl_AutoVehicleRespawner );
|
||||||
|
rl_AutoVehicleRespawner = SetTimer( "autoVehicleSpawn", tick, true );
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "autovehrespawn %d", tick );
|
||||||
|
SendClientMessageFormatted( playerid, COLOR_WHITE, ""COL_GREY"[SERVER]"COL_WHITE" The auto vehicle spawner has been set to %dms.", tick );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function autoVehicleSpawn( )
|
||||||
|
{
|
||||||
|
for( new i; i < MAX_VEHICLES; i++ ) if ( IsValidVehicle( i ) )
|
||||||
|
{
|
||||||
|
if ( IsVehicleOccupied( i, .include_vehicle_interior = true ) == -1 )
|
||||||
|
{
|
||||||
|
if ( g_buyableVehicle{ i } == true )
|
||||||
|
RespawnBuyableVehicle( i );
|
||||||
|
else
|
||||||
|
SetVehicleToRespawn( i );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*CMD:megaban( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 50 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"S(No Reason)[50]", pID, reason ) ) SendUsage( playerid, "/megaban [PLAYER_ID] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
//else if ( pID == playerid ) return SendError( playerid, "You cannot ban yourself." );
|
||||||
|
//else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "megaban %s (reason: %s)", ReturnPlayerName( pID ), reason );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has mega-banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has mega-banned %s(%d) "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason );
|
||||||
|
BanPlayerISP( pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
CMD:achangename( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
nName[ 24 ],
|
||||||
|
szQuery[ 100 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"s[24]", pID, nName ) ) return SendUsage( playerid, "/achangename [PLAYER_ID] [NEW_NAME]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !isValidPlayerName( nName ) ) return SendError( playerid, "Invalid Name Character." );
|
||||||
|
else if ( p_OwnedHouses[ pID ] > 0 || GetPlayerOwnedApartments( pID ) > 0 ) return SendError( playerid, "This player has a house and/or apartment." ), SendError( pID, ""COL_ORANGE"In order to change your name, you must sell your houses and/or apartment.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szQuery, sizeof( szQuery ), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s'", mysql_escape( nName ) );
|
||||||
|
mysql_function_query( dbHandle, szQuery, true, "OnAdminChangePlayerName", "dds", playerid, pID, nName );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread OnAdminChangePlayerName( playerid, pID, nName[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
rows, fields
|
||||||
|
;
|
||||||
|
cache_get_data( rows, fields );
|
||||||
|
|
||||||
|
if ( !rows )
|
||||||
|
{
|
||||||
|
mysql_single_query( sprintf( "UPDATE `USERS` SET `NAME` = '%s' WHERE `NAME` = '%s'", mysql_escape( nName ), mysql_escape( ReturnPlayerName( pID ) ) ) );
|
||||||
|
mysql_single_query( sprintf( "INSERT INTO `NAME_CHANGES`(`USER_ID`,`ADMIN_ID`,`NAME`) VALUES (%d,%d,'%s')", p_AccountID[ pID ], p_AccountID[ playerid ], mysql_escape( ReturnPlayerName( pID ) ) ) );
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "changename %s to %s", ReturnPlayerName( pID ), nName );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have changed %s(%d)'s name to %s!", ReturnPlayerName( pID ), pID, nName );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Your name has been changed to %s by %s(%d)!", nName, ReturnPlayerName( playerid ), playerid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed %s(%d)'s name to %s", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, nName );
|
||||||
|
|
||||||
|
SetPlayerName( pID, nName );
|
||||||
|
|
||||||
|
// Update New Things
|
||||||
|
foreach(new g : garages)
|
||||||
|
if ( g_garageData[ g ] [ E_OWNER_ID ] == p_AccountID[ playerid ] )
|
||||||
|
UpdateGarageTitle( g );
|
||||||
|
}
|
||||||
|
else SendError( playerid, "This name is taken already." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:unbanip( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
address[16],
|
||||||
|
Query[70]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if (sscanf(params, "s[16]", address)) SendUsage(playerid, "/unbanip [IP_ADDRESS]");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( Query, sizeof( Query ), "SELECT `IP` FROM `BANS` WHERE `IP` = '%s'", mysql_escape( address ) );
|
||||||
|
mysql_function_query( dbHandle, Query, true, "OnPlayerUnbanIP", "dds", playerid, 0, address );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread OnPlayerUnbanIP( playerid, irc, address[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
rows, fields
|
||||||
|
;
|
||||||
|
cache_get_data( rows, fields );
|
||||||
|
if ( rows )
|
||||||
|
{
|
||||||
|
if ( !irc )
|
||||||
|
{
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "unbanip %s", address );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has un-banned IP %s", ReturnPlayerName( playerid ), playerid, address );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} IP %s has been un-banned from the server.", address );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DCC_SendChannelMessageFormatted( discordGeneralChan, "**(UNBANNED)** IP %s has been un-banned from the server.", address );
|
||||||
|
}
|
||||||
|
format( szNormalString, sizeof( szNormalString ), "DELETE FROM `BANS` WHERE `IP` = '%s'", mysql_escape( address ) );
|
||||||
|
mysql_single_query( szNormalString );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( !irc ) SendError(playerid, "This IP Address is not recognised!");
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:unban( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
player[24],
|
||||||
|
Query[70]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[24]", player ) ) SendUsage( playerid, "/unban [NAME]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( Query, sizeof( Query ), "SELECT `NAME` FROM `BANS` WHERE `NAME` = '%s'", mysql_escape( player ) );
|
||||||
|
mysql_function_query( dbHandle, Query, true, "OnPlayerUnbanPlayer", "dds", playerid, 0, player );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread OnPlayerUnbanPlayer( playerid, irc, player[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
rows, fields
|
||||||
|
;
|
||||||
|
cache_get_data( rows, fields );
|
||||||
|
if ( rows )
|
||||||
|
{
|
||||||
|
if ( !irc ) AddAdminLogLineFormatted( "%s(%d) has un-banned %s", ReturnPlayerName( playerid ), playerid, player );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format(szNormalString, sizeof(szNormalString),"**(UNBANNED)** %s has been un-banned from the server.", player);
|
||||||
|
DCC_SendChannelMessage( discordGeneralChan, szNormalString );
|
||||||
|
}
|
||||||
|
format(szNormalString, sizeof(szNormalString), "DELETE FROM `BANS` WHERE `NAME` = '%s'", mysql_escape( player ) );
|
||||||
|
mysql_single_query( szNormalString );
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "unban %s", player );
|
||||||
|
SendClientMessageToAllFormatted(-1, ""COL_PINK"[ADMIN]{FFFFFF} \"%s\" has been un-banned from the server.", player);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( !irc ) SendError(playerid, "This player is not recognised!");
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:doublexp( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
//g_doubleXP
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
UpdateServerVariable( "doublexp", IsDoubleXP( ) ? 0 : 1, 0.0, "", GLOBAL_VARTYPE_INT );
|
||||||
|
|
||||||
|
if ( IsDoubleXP( ) )
|
||||||
|
{
|
||||||
|
TextDrawShowForAll( g_DoubleXPTD );
|
||||||
|
GameTextForAll( "~w~DOUBLE ~y~~h~XP~g~~h~~h~ ACTIVATED!", 6000, 3 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextDrawHideForAll( g_DoubleXPTD );
|
||||||
|
GameTextForAll( "~w~DOUBLE ~y~~h~XP~r~~h~~h~ DEACTIVATED!", 6000, 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "doublexp %s", IsDoubleXP( ) ? ("toggled") : ("un-toggled") );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s double XP!", IsDoubleXP( ) ? ("toggled") : ("un-toggled") );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has %s double xp", ReturnPlayerName( playerid ), playerid, IsDoubleXP( ) ? ("toggled") : ("un-toggled") );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:toggleviewpm( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
p_ToggledViewPM{ playerid } = !p_ToggledViewPM{ playerid };
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s viewing peoples private messages.", p_ToggledViewPM{ playerid } == true ? ("toggled") : ("un-toggled") );
|
||||||
|
if ( !IsPlayerUnderCover( playerid ) ) {
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has %s viewing pm's", ReturnPlayerName( playerid ), playerid, p_ToggledViewPM{ playerid } == true ? ("toggled") : ("un-toggled") );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:respawnallv( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for( new i; i < MAX_VEHICLES; i++ ) if ( IsValidVehicle( i ) ) {
|
||||||
|
#if ENABLED_SECURE_TRUCK
|
||||||
|
if ( g_secureTruckVehicle == i ) continue;
|
||||||
|
#endif
|
||||||
|
SetVehicleToRespawn( i );
|
||||||
|
}
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has respawned all vehicles", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendServerMessage( playerid, "You have respawned all vehicles." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:createbribe( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
Float: X, Float: Y, Float: Z
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetPlayerPos( playerid, X, Y, Z );
|
||||||
|
new iTmp = CreateBribe( X, Y, Z );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has created a bribe", ReturnPlayerName( playerid ), playerid );
|
||||||
|
if ( iTmp != -1 ) {
|
||||||
|
SaveToAdminLog( playerid, iTmp, "created bribe" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BRIBE]"COL_WHITE" You have created a bribe taking place of ID: %d.", iTmp );
|
||||||
|
}
|
||||||
|
else SendClientMessage( playerid, -1, ""COL_PINK"[BRIBE]"COL_WHITE" Unable to create a bribe due to a unexpected error." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroybribe( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
bID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", bID ) ) return SendUsage( playerid, "/destroybribe [BRIBE_ID]" );
|
||||||
|
else if ( bID < 0 || bID > MAX_BRIBES ) return SendError( playerid, "Invalid Bribe ID." );
|
||||||
|
else if ( !Iter_Contains( BribeCount, bID ) ) return SendError( playerid, "Invalid Bribe ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLog( playerid, bID, "destroyed bribe" );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a bribe", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BRIBE]"COL_WHITE" You have destroyed a bribe pickup which was the ID of %d.", bID);
|
||||||
|
DestroyBribe( bID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:createcar( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
vName[ 24 ], pID,
|
||||||
|
Float: X, Float: Y, Float: Z, Float: Angle
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"s[24]", pID, vName ) ) return SendUsage( playerid, "/createcar [PLAYER_ID] [VEHICLE_NAME]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_OwnedVehicles[ pID ] >= GetPlayerVehicleSlots( pID ) ) return SendError( playerid, "This player has too many vehicles." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iModel, iTmp;
|
||||||
|
|
||||||
|
if ( ( iModel = GetVehicleModelFromName( vName ) ) != -1 ) {
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has created a vehicle for %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
GetPlayerPos( playerid, X, Y, Z );
|
||||||
|
GetPlayerFacingAngle( playerid, Angle );
|
||||||
|
|
||||||
|
if ( ( iTmp = CreateBuyableVehicle( pID, iModel, 0, 0, X, Y, Z, Angle, 1337 ) ) != -1 ) {
|
||||||
|
SaveToAdminLogFormatted( playerid, iTmp, "created car (model id %d) for %s (acc id %d)", iModel, ReturnPlayerName( pID ), p_AccountID[ pID ] );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" You have created a vehicle in the name of %s(%d).", ReturnPlayerName( pID ), pID );
|
||||||
|
PutPlayerInVehicle( playerid, g_vehicleData[ pID ] [ iTmp ] [ E_VEHICLE_ID ], 0 );
|
||||||
|
}
|
||||||
|
else SendClientMessage( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" Unable to create a vehicle due to a unexpected error." );
|
||||||
|
}
|
||||||
|
else SendError( playerid, "Invalid Vehicle Model." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroycar( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
ownerid, slotid
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You must be in a vehicle to use this command." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new v = getVehicleSlotFromID( GetPlayerVehicleID( playerid ), ownerid, slotid );
|
||||||
|
|
||||||
|
if ( v == -1 ) return SendError( playerid, "This vehicle doesn't look like it can be destroyed. (0xAA)" );
|
||||||
|
if ( g_vehicleData[ ownerid ] [ slotid ] [ E_CREATED ] == false ) return SendError( playerid, "This vehicle doesn't look like it can be destroyed. (0xAF)" );
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, slotid, "destroycar (model id %d) for %s (acc id %d)", g_vehicleData[ slotid ] [ slotid ] [ E_MODEL ], ReturnPlayerName( ownerid ), p_AccountID[ ownerid ] );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a car", ReturnPlayerName( playerid ), playerid );
|
||||||
|
format( szBigString, sizeof( szBigString ), "[DC] [%s] %s | %s | %s\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), ReturnPlayerName( ownerid ), GetVehicleName( GetVehicleModel( g_vehicleData[ ownerid ] [ slotid ] [ E_VEHICLE_ID ] ) ) );
|
||||||
|
AddFileLogLine( "log_destroycar.txt", szBigString );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" You have destroyed a "COL_GREY"%s"COL_WHITE" owned by "COL_GREY"%s"COL_WHITE".", GetVehicleName( GetVehicleModel( g_vehicleData[ ownerid ] [ slotid ] [ E_VEHICLE_ID ] ) ), ReturnPlayerName( ownerid ) );
|
||||||
|
DestroyBuyableVehicle( ownerid, slotid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:stripcarmods( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
ownerid, slotid
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You must be in a vehicle to use this command." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new v = getVehicleSlotFromID( GetPlayerVehicleID( playerid ), ownerid, slotid );
|
||||||
|
|
||||||
|
if ( v == -1 ) return SendError( playerid, "This vehicle doesn't look like it can be stripped of its components. (0xAA)" );
|
||||||
|
if ( g_vehicleData[ ownerid ] [ slotid ] [ E_CREATED ] == false ) return SendError( playerid, "This vehicle doesn't look like it can be destroyed. (0xAF)" );
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, slotid, "stripcarmods on %s (acc id %d, model id %d)", ReturnPlayerName( ownerid ), p_AccountID[ ownerid ], g_vehicleData[ ownerid ] [ slotid ] [ E_MODEL ] );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a car's mods", ReturnPlayerName( playerid ), playerid );
|
||||||
|
format( szBigString, sizeof( szBigString ), "[DC_MODS] [%s] %s | %s | %s\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), ReturnPlayerName( ownerid ), GetVehicleName( GetVehicleModel( g_vehicleData[ ownerid ] [ slotid ] [ E_VEHICLE_ID ] ) ) );
|
||||||
|
AddFileLogLine( "log_destroycar.txt", szBigString );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[VEHICLE]"COL_WHITE" You have removed the mods of %s's "COL_GREY"%s"COL_WHITE".", ReturnPlayerName( ownerid ), GetVehicleName( GetVehicleModel( g_vehicleData[ ownerid ] [ slotid ] [ E_VEHICLE_ID ] ) ) );
|
||||||
|
DestroyVehicleCustomComponents( ownerid, slotid, .destroy_db = true );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:createhouse( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
cost, iTmp,
|
||||||
|
Float: X, Float: Y, Float: Z
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", cost ) ) return SendUsage( playerid, "/createhouse [COST]" );
|
||||||
|
else if ( cost < 100 ) return SendError( playerid, "The price must be located above 100 dollars." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has created a house", ReturnPlayerName( playerid ), playerid );
|
||||||
|
if ( GetPlayerPos( playerid, X, Y, Z ) )
|
||||||
|
{
|
||||||
|
if ( ( iTmp = CreateHouse( "Home", cost, X, Y, Z ) ) != -1 )
|
||||||
|
{
|
||||||
|
SaveToAdminLogFormatted( playerid, iTmp, "created house for %s", number_format( cost ) );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a %s house taking up house id %d.", number_format( cost ), iTmp );
|
||||||
|
}
|
||||||
|
else SendClientMessage( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" Unable to create a house due to a unexpected error." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroyhouse( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
hID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", hID ) ) return SendUsage( playerid, "/destroyhouse [HOUSE_ID]" );
|
||||||
|
else if ( hID < 0 || hID > MAX_HOUSES ) return SendError( playerid, "Invalid house ID." );
|
||||||
|
else if ( ! Iter_Contains( houses, hID ) ) return SendError( playerid, "Invalid house ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLog( playerid, hID, "destroy house" );
|
||||||
|
format( szBigString, sizeof( szBigString ), "[DH] [%s] %s | %s | %d\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), g_houseData[ hID ][ E_OWNER ], hID );
|
||||||
|
AddFileLogLine( "log_houses.txt", szBigString );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a house", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have destroyed \"%s\" which was the ID of %d.", g_houseData[ hID ] [ E_HOUSE_NAME ], hID );
|
||||||
|
DestroyHouse( hID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:hadminsell( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
hID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", hID ) ) return SendUsage( playerid, "/hadminsell [HOUSE_ID]" );
|
||||||
|
else if ( hID < 0 || hID > MAX_HOUSES ) return SendError( playerid, "Invalid house ID." );
|
||||||
|
else if ( ! Iter_Contains( houses, hID ) ) return SendError( playerid, "Invalid house ID." );
|
||||||
|
else if ( strmatch( g_houseData[ hID ] [ E_OWNER ], "No-one" ) ) return SendError( playerid, "This house is not owned by anyone." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetHouseForAuction( hID );
|
||||||
|
SaveToAdminLog( playerid, hID, "hadminsell" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You made "COL_GREY"House ID %d"COL_WHITE" go for sale.", hID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:forceac( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) SendUsage( playerid, "/forceac [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cant kick yourself." );
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." );
|
||||||
|
//else if ( GetPlayerScore( pID ) < 100 ) return SendError( playerid, "This player's score is under 100, please spectate instead." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_forcedAnticheat[ pID ] <= 0 )
|
||||||
|
{
|
||||||
|
p_forcedAnticheat[ pID ] = p_AccountID[ playerid ];
|
||||||
|
mysql_single_query( sprintf( "UPDATE `USERS` SET `FORCE_AC`=%d WHERE `ID`=%d", p_AccountID[ playerid ], p_AccountID[ pID ] ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has forced ac on %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_GREY" %s is required to use an anticheat to play by %s. "COL_YELLOW"("AC_WEBSITE")", ReturnPlayerName( pID ), ReturnPlayerName( playerid ) );
|
||||||
|
if ( ! IsPlayerUsingSampAC( pID ) ) KickPlayerTimed( pID );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_forcedAnticheat[ pID ] = 0;
|
||||||
|
mysql_single_query( sprintf( "UPDATE `USERS` SET `FORCE_AC`=0 WHERE `ID`=%d", p_AccountID[ pID ] ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has removed forced ac on %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_GREY" %s has removed the anticheat requirement on %s.", ReturnPlayerName( playerid ), ReturnPlayerName( pID ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
362
gamemodes/irresistible/cnr/commands/admin/admin_four.pwn
Normal file
362
gamemodes/irresistible/cnr/commands/admin/admin_four.pwn
Normal file
@ -0,0 +1,362 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_four.pwn
|
||||||
|
* Purpose: level four administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:destroyallav( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for( new i; i < MAX_VEHICLES; i++ )
|
||||||
|
{
|
||||||
|
if ( IsValidVehicle( i ) && g_adminSpawnedCar{ i } == true ) {
|
||||||
|
g_adminSpawnedCar{ i } = false;
|
||||||
|
DestroyVehicle( i );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SendServerMessage( playerid, "You have succesfully destroyed all admin spawned vehicles." );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has destroyed all spawned vehicles", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:event( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed his world to 69", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have your world to 69." );
|
||||||
|
return SetPlayerVirtualWorld( playerid, 69 );
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setworld( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID, worldid;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, worldid ) ) return SendUsage( playerid, "/setworld [PLAYER_ID] [WORLD_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerVirtualWorld( pID, worldid );
|
||||||
|
|
||||||
|
if ( pID != playerid )
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Your world has been set to %d by %s(%d)!", worldid, ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have changed %s(%d)'s world to %d!", ReturnPlayerName( pID ), pID, worldid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed %s(%d)'s world to %d", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, worldid );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have set your world to %d.", worldid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed their world to %d", ReturnPlayerName( pID ), pID, worldid );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setinterior( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID, worldid;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, worldid ) ) return SendUsage( playerid, "/setinterior [PLAYER_ID] [INTERIOR_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerInterior( pID, worldid );
|
||||||
|
|
||||||
|
if ( pID != playerid )
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Your interior has been set to %d by %s(%d)!", worldid, ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have changed %s(%d)'s interior to %d!", ReturnPlayerName( pID ), pID, worldid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed %s(%d)'s interior to %d", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, worldid );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have your interior to %d.", worldid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed his interior to %d", ReturnPlayerName( pID ), pID, worldid );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:uncopban( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage( playerid, "/uncopban [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_CopBanned{ pID } == 0 ) return SendError( playerid, "This player is not cop-banned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has un-cop-banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has un-cop-banned %s(%d).", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID );
|
||||||
|
p_CopBanned{ pID } = 0;
|
||||||
|
format( szNormalString, sizeof( szNormalString ), "UPDATE `USERS` SET `COP_BAN`=0 WHERE ID=%d", p_AccountID[ pID ] ), mysql_single_query( szNormalString );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:unarmyban( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage( playerid, "/unarmyban [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_ArmyBanned{ pID } == 0 ) return SendError( playerid, "This player is not army-banned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has un-army-banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has un-army-banned %s(%d).", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID );
|
||||||
|
p_ArmyBanned{ pID } = 0;
|
||||||
|
format( szNormalString, sizeof( szNormalString ), "UPDATE `USERS` SET `ARMY_BAN`=0 WHERE ID=%d", p_AccountID[ pID ] ), mysql_single_query( szNormalString );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:motd( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
string[ 90 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[90]", string ) ) return SendUsage( playerid, "/motd [MESSAGE]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//strreplacechar ( string, '~', ']' );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has set the motd", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendServerMessage( playerid, "The MOTD has been changed." );
|
||||||
|
TextDrawSetString( g_MotdTD, string );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:resetwepall( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iWorld = GetPlayerVirtualWorld( playerid );
|
||||||
|
|
||||||
|
foreach(new pID : Player)
|
||||||
|
{
|
||||||
|
if ( !IsPlayerSpawned( pID ) || p_PlayerSettings[ pID ] { SETTING_EVENT_TP } )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( IsPlayerAFK( playerid ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( iWorld != GetPlayerVirtualWorld( pID ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ResetPlayerWeapons( pID );
|
||||||
|
}
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has reset all player weapons", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" All player weapons have been reset in %s's world.", ReturnPlayerName( playerid ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:giveweaponall( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
wep,
|
||||||
|
ammo,
|
||||||
|
gunname[ 32 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "dd", wep, ammo ) ) return SendUsage(playerid, "/giveweaponall [WEAPON_ID] [AMMO]");
|
||||||
|
else if ( wep > MAX_WEAPONS || wep <= 0 || wep == 47 ) return SendError(playerid, "Invalid weapon id");
|
||||||
|
else if ( IsWeaponBanned( wep ) ) return SendError( playerid, "This weapon is a banned weapon, you cannot spawn this." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iWorld = GetPlayerVirtualWorld( playerid );
|
||||||
|
|
||||||
|
foreach(new pID : Player)
|
||||||
|
{
|
||||||
|
if ( !IsPlayerSpawned( pID ) || IsPlayerJailed( pID ) || p_PlayerSettings[ pID ] { SETTING_EVENT_TP } )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( IsPlayerAFK( playerid ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( iWorld != 0 && iWorld != GetPlayerVirtualWorld( pID ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
GivePlayerWeapon( pID, wep, ammo );
|
||||||
|
}
|
||||||
|
|
||||||
|
GetWeaponName( wep, gunname, sizeof( gunname ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given everyone a %s", ReturnPlayerName( playerid ), playerid, gunname );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" Everyone has been given a %s in %s(%d)'s world.", gunname, ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:circleall( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new seconds = 3, allowcop, noarmour;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "D(3)D(0)D(1)", seconds, allowcop, noarmour ) ) return SendUsage(playerid, "/circleall [SECONDS] [ALLOW_COPS 0|1] [REMOVE ARMOUR 0|1]" );
|
||||||
|
else if ( g_circleall_CD ) return SendError( playerid, "There is already a countdown on-going." );
|
||||||
|
else if ( seconds > 60 ) return SendError( playerid, "You must specifiy the amount of seconds from 0 to 60." );
|
||||||
|
else if ( allowcop < 0 || allowcop > 1 ) return SendError( playerid, "0 or 1 can only be the cop allowance parameter value!" );
|
||||||
|
else if ( noarmour < 0 || noarmour > 1 ) return SendError( playerid, "0 or 1 can only be the remove armour parameter value!" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_circleall_CD = true;
|
||||||
|
|
||||||
|
new
|
||||||
|
Float: nX, Float: nY, Float: nZ,
|
||||||
|
Float: Armour, Float: deg// = 360.0 / float(Iter_Count(Player))
|
||||||
|
;
|
||||||
|
GetPlayerPos( playerid, nX, nY, nZ );
|
||||||
|
foreach(new i : Player)
|
||||||
|
{
|
||||||
|
if ( IsPlayerSpawned( i ) && i != playerid && !IsPlayerJailed( i ) && !p_PlayerSettings[ i ] { SETTING_EVENT_TP } )
|
||||||
|
{
|
||||||
|
if ( !allowcop && p_Class[ i ] == CLASS_POLICE )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( IsPlayerAFK( i ) ) {
|
||||||
|
SendServerMessage( i, "As you're AFK, you have not been teleported to the event/mass teleportation." );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( IsPlayerInPaintBall( i ) || IsPlayerDueling( i ) ) {
|
||||||
|
SendServerMessage( i, "As you're in paintball, you have not been teleported to the event/mass teleportation." );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( noarmour ) {
|
||||||
|
GetPlayerArmour( i, Armour );
|
||||||
|
if ( Armour > 0.0 ) SetPlayerArmour( i, 0.0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
deg += 3.6;
|
||||||
|
nX += 10 * floatsin( deg, degrees );
|
||||||
|
nY += 10 * floatcos( deg, degrees );
|
||||||
|
SetPlayerPos( i, nX, nY, nZ );
|
||||||
|
GetPlayerPos( playerid, nX, nY, nZ );
|
||||||
|
SetPlayerInterior( i, GetPlayerInterior( playerid ) );
|
||||||
|
SetPlayerVirtualWorld( i, GetPlayerVirtualWorld( playerid ) );
|
||||||
|
TogglePlayerControllable( i, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SetTimerEx( "circleall_Countdown", 960, false, "dd", seconds, 0 );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has circled everybody", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vc( playerid, params [ ] ) return cmd_vcreate( playerid, params );
|
||||||
|
CMD:vcreate( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
vName[ 24 ],
|
||||||
|
vCar,
|
||||||
|
Float: X,
|
||||||
|
Float: Y,
|
||||||
|
Float: Z,
|
||||||
|
Float: Angle
|
||||||
|
;
|
||||||
|
GetPlayerPos( playerid, X, Y, Z );
|
||||||
|
GetPlayerFacingAngle(playerid, Angle);
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[24]", vName ) ) SendUsage( playerid, "/(vc)reate [VEHICLE_NAME]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( strmatch( vName, "jetpack" ) && p_AdminLevel[ playerid ] >= 4 )
|
||||||
|
return SetPlayerSpecialAction( playerid, SPECIAL_ACTION_USEJETPACK );
|
||||||
|
|
||||||
|
new iCarModel = GetVehicleModelFromName( vName );
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 )
|
||||||
|
{
|
||||||
|
if ( iCarModel == 435 || iCarModel == 450 || iCarModel == 584 || iCarModel == 591 || iCarModel == 606 || iCarModel == 607 || iCarModel == 608 || iCarModel == 610 || iCarModel == 611 ) return SendError( playerid, "You cannot spawn trailers." );
|
||||||
|
if ( iCarModel == 449 || iCarModel == 537 || iCarModel == 538 || iCarModel == 569 || iCarModel == 570 ) return SendError( playerid, "You cannot spawn trains." );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( iCarModel != -1 ) {
|
||||||
|
if ( ( vCar = CreateVehicle( iCarModel, X, Y, Z, Angle, -1, -1, 9999999999999999 ) ) ) {
|
||||||
|
g_adminSpawnedCar{ vCar } = true;
|
||||||
|
LinkVehicleToInterior( vCar, GetPlayerInterior( playerid ) );
|
||||||
|
SetVehicleVirtualWorld( vCar, GetPlayerVirtualWorld( playerid ) );
|
||||||
|
PutPlayerInVehicle( playerid, vCar, 0 );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have spawned an "COL_GREY"%s"COL_WHITE".", GetVehicleName( iCarModel ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else SendError( playerid, "Invalid vehicle name written." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:gotopos( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
Float: X, Float: Y, Float: Z, interior;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "fffD(0)", X, Y, Z, interior ) ) return SendUsage( playerid, "/gotopos [POS_X] [POS_Y] [POS_Z] [INTERIOR (= 0)]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerPosition( playerid, X, Y, Z, interior );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have teleported to "COL_GREY"%f, %f, %f"COL_WHITE" Interior: "COL_GREY"%d", X, Y, Z, interior );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:addnote( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
note[ 72 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"s[72]", pID, note ) ) return SendUsage( playerid, "/addnote [PLAYER_ID] [NOTE]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( strlen( note ) < 3 ) return SendError( playerid, "Keep your note's character count within the range of 3 - 72." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddPlayerNote( pID, playerid, note );
|
||||||
|
SendServerMessage( playerid, "You have added a note to %s (Account ID %d)."COL_RED" Do understand that what you add is logged.", ReturnPlayerName( pID ), pID, p_AccountID[ pID ] );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has added a note to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:removenote( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
note
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", note ) ) return SendUsage( playerid, "/removenote [NOTE_ID]" );
|
||||||
|
else if ( note < 0 ) return SendError( playerid, "Invalid note ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] > 4 )
|
||||||
|
{
|
||||||
|
format( szNormalString, 64, "SELECT `ID` FROM `NOTES` WHERE `ID`=%d AND `DELETED` IS NULL", note );
|
||||||
|
mysql_function_query( dbHandle, szNormalString, true, "deleteplayernote", "dd", playerid, note );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szNormalString, 96, "SELECT `ID` FROM `NOTES` WHERE `ID`=%d AND `ADDED_BY`=%d AND `DELETED` IS NULL", note, p_AccountID[ playerid ] );
|
||||||
|
mysql_function_query( dbHandle, szNormalString, true, "deleteplayernote", "dd", playerid, note );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
694
gamemodes/irresistible/cnr/commands/admin/admin_one.pwn
Normal file
694
gamemodes/irresistible/cnr/commands/admin/admin_one.pwn
Normal file
@ -0,0 +1,694 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_one.pwn
|
||||||
|
* Purpose: level one administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:viewdeathmsg( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
new targetid;
|
||||||
|
|
||||||
|
if ( sscanf( params, "u", targetid ) ) return SendUsage( playerid, "/viewdeathmsg [PLAYER_ID]" );
|
||||||
|
else if ( ! IsPlayerConnected( targetid ) || IsPlayerNPC( targetid ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( ! strlen( p_DeathMessage[ targetid ] ) ) {
|
||||||
|
SendError( playerid, "This player does not have an active death message." );
|
||||||
|
} else {
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d)'s death message is: "COL_GREY"%s", ReturnPlayerName( targetid ), targetid, p_DeathMessage[ targetid ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:arepair( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( !IsPlayerInEvent( playerid ) )
|
||||||
|
return SendError( playerid, "You cannot use this command since you're not in an event world." );
|
||||||
|
|
||||||
|
new
|
||||||
|
iVehicle = GetPlayerVehicleID( playerid );
|
||||||
|
|
||||||
|
if ( IsValidVehicle( iVehicle ) )
|
||||||
|
{
|
||||||
|
if ( !g_adminSpawnedCar{ iVehicle } )
|
||||||
|
return SendError( playerid, "This is not an admin spawned vehicle." );
|
||||||
|
|
||||||
|
p_DamageSpamCount{ playerid } = 0;
|
||||||
|
RepairVehicle( iVehicle );
|
||||||
|
PlayerPlaySound( playerid, 1133, 0.0, 0.0, 5.0 );
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has repaired their vehicle", ReturnPlayerName( playerid ), playerid );
|
||||||
|
return SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have repaired this vehicle." );
|
||||||
|
}
|
||||||
|
return SendError( playerid, "You are not in any vehicle." );
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:aka( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/aka [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szNormalString, 96, "SELECT `NAME`,`TIME` FROM `NAME_CHANGES` WHERE `USER_ID`=%d ORDER BY `TIME` DESC", p_AccountID[ pID ] );
|
||||||
|
mysql_function_query( dbHandle, szNormalString, true, "readnamechanges", "dd", playerid, pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:pinfo( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/pinfo [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d): "COL_GREY"%0.2f%s packetloss, %d FPS, %d ping, from %s, SA-MP AC %s", ReturnPlayerName( pID ), pID, NetStats_PacketLossPercent( pID ), "%%", GetPlayerFPS( pID ), GetPlayerPing( pID ), GetPlayerCountryName( pID ), IsPlayerUsingSampAC( pID ) ? ( COL_GREEN # "ENABLED" ) : ( COL_RED # "DISABLED" ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:reports( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( !strlen( szReportsLog[ 7 ] ) )
|
||||||
|
szLargeString = "None at the moment.";
|
||||||
|
else
|
||||||
|
format( szLargeString, sizeof( szLargeString ), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", szReportsLog[ 0 ], szReportsLog[ 1 ], szReportsLog[ 2 ], szReportsLog[ 3 ], szReportsLog[ 4 ], szReportsLog[ 5 ], szReportsLog[ 6 ], szReportsLog[ 7 ] );
|
||||||
|
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Report Log", szLargeString, "Okay", "" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:questions( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( !strlen( szQuestionsLog[ 7 ] ) )
|
||||||
|
szLargeString = "None at the moment.";
|
||||||
|
else
|
||||||
|
format( szLargeString, sizeof( szLargeString ), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", szQuestionsLog[ 0 ], szQuestionsLog[ 1 ], szQuestionsLog[ 2 ], szQuestionsLog[ 3 ], szQuestionsLog[ 4 ], szQuestionsLog[ 5 ], szQuestionsLog[ 6 ], szQuestionsLog[ 7 ] );
|
||||||
|
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Question Log", szLargeString, "Okay", "" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:respawnalluv( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for( new i = 0; i < MAX_VEHICLES; i++ ) if ( IsValidVehicle( i ) )
|
||||||
|
{
|
||||||
|
// keep trailers
|
||||||
|
if ( IsTrailerVehicle( GetVehicleModel( i ) ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
new
|
||||||
|
occupierid = IsVehicleOccupied( i, .include_vehicle_interior = true );
|
||||||
|
|
||||||
|
// skip npcs
|
||||||
|
if ( IsPlayerNPC( occupierid ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// unoccupied vehicles
|
||||||
|
if ( occupierid == -1 )
|
||||||
|
SetVehicleToRespawn( i );
|
||||||
|
}
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has respawned all unoccupied vehicles", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendServerMessage( playerid, "You have respawned all unoccupied vehicles." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:aod( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
if ( !p_AdminOnDuty{ playerid } )
|
||||||
|
{
|
||||||
|
TextDrawShowForPlayer( playerid, g_AdminOnDutyTD );
|
||||||
|
Delete3DTextLabel( p_AdminLabel[ playerid ] );
|
||||||
|
p_AdminLabel[ playerid ] = Create3DTextLabel( "Admin on Duty!", COLOR_PINK, 0.0, 0.0, 0.0, 15.0, 0 );
|
||||||
|
Attach3DTextLabelToPlayer( p_AdminLabel[ playerid ], playerid, 0.0, 0.0, 0.5 );
|
||||||
|
SetPlayerHealth( playerid, INVALID_PLAYER_ID );
|
||||||
|
DisableRemoteVehicleCollisions( playerid, 1 );
|
||||||
|
p_AdminOnDuty{ playerid } = true;
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have enabled administration mode." );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextDrawHideForPlayer( playerid, g_AdminOnDutyTD );
|
||||||
|
Delete3DTextLabel( p_AdminLabel[ playerid ] );
|
||||||
|
p_AdminLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID;
|
||||||
|
p_AdminOnDuty{ playerid } = false;
|
||||||
|
SetPlayerHealth( playerid, 100 );
|
||||||
|
DisableRemoteVehicleCollisions( playerid, 0 );
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have disabled administration mode." );
|
||||||
|
}
|
||||||
|
SetPlayerColorToTeam( playerid );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:asay( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
string[ 100 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[100]", string ) ) return SendUsage( playerid, "/asay [MESSAGE]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has used /asay", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s", string );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:frules( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/frules [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsPlayerSpawned( pID ) ) return SendError( playerid, "This player isn't spawned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmd_rules( pID, "" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have shown %s(%d) the /rules", ReturnPlayerName( pID ), pID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has shown the rules to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:fpc( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/fpc [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsPlayerSpawned( pID ) ) return SendError( playerid, "This player isn't spawned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmd_pc( pID, "" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have shown %s(%d) the player colors (/pc)", ReturnPlayerName( pID ), pID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has shown the player colors to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:freeze( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/freeze [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsPlayerSpawned( pID ) ) return SendError( playerid, "This player isn't spawned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has frozen %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been frozen by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have frozen %s(%d)!", ReturnPlayerName( pID ), pID );
|
||||||
|
TogglePlayerControllable( pID, 0 );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CMD:unfreeze( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/unfreeze [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsPlayerSpawned( pID ) ) return SendError( playerid, "This player isn't spawned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has unfrozen %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been unfrozen by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have unfrozen %s(%d)!", ReturnPlayerName( pID ), pID );
|
||||||
|
TogglePlayerControllable( pID, 1 );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:awep( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
static
|
||||||
|
iAmmo,
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/awep [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsPlayerSpawned( pID ) ) return SendError( playerid, "This player isn't spawned." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
szLargeString[ 0 ] = '\0';
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You are now viewing "COL_GREY"%s(%d){FFFFFF}'s weapons.", ReturnPlayerName( pID ), pID );
|
||||||
|
for(new i; i < MAX_WEAPONS; i++)
|
||||||
|
{
|
||||||
|
if ( IsWeaponInAnySlot( pID, i ) )
|
||||||
|
{
|
||||||
|
GetPlayerWeaponData( pID, GetWeaponSlot( i ), iAmmo, iAmmo );
|
||||||
|
if ( iAmmo > 0x7FFF || iAmmo < -100 ) iAmmo = 0x7FFF;
|
||||||
|
if ( iAmmo == 0 || i == 0 ) continue;
|
||||||
|
|
||||||
|
format( szLargeString, sizeof( szLargeString ), "%s%s(%d)\n", szLargeString, ReturnWeaponName( i ), iAmmo );
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Weapon Data", szLargeString, "Okay", "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:alog( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminLog{ playerid } )
|
||||||
|
{
|
||||||
|
p_AdminLog{ playerid } = false;
|
||||||
|
TextDrawHideForPlayer( playerid, g_AdminLogTD );
|
||||||
|
SendServerMessage( playerid, "You have un-toggled the administration log." );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_AdminLog{ playerid } = true;
|
||||||
|
TextDrawShowForPlayer( playerid, g_AdminLogTD );
|
||||||
|
SendServerMessage( playerid, "You have toggled the administration log." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:stpfa( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage(playerid, "/stpfa [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected(pID) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cannot apply this to yourself." );
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_CantUseAsk{ pID } = ( p_CantUseAsk{ pID } == true ? false : true );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has been %s from using /ask by %s(%d)", ReturnPlayerName( pID ), pID, p_CantUseAsk{ pID } == true ? ( "blocked" ) : ( "unblocked" ), ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s %s(%d) from using the ask command.", p_CantUseAsk{ pID } == true ? ( "blocked" ) : ( "unblocked" ), ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:ans( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID, msg[ 90 ], iTime = g_iTime
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"s[90]", pID, msg ) ) return SendUsage( playerid, "/ans [PLAYER_ID] [ANSWER]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cannot answer yourself." );
|
||||||
|
else if ( iTime < p_AnswerDelay[ pID ] ) return SendError( playerid, "Please wait another %d seconds to answer this person.", p_AnswerDelay[ pID ] - iTime );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageToAdmins( -1, ""COL_PINK"[ANSWER]"COL_GREY" (%s >> %s):"COL_WHITE" %s", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), msg );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has answered %s(%d)'s question", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, "{FE5700}[ANSWER] From %s(%d):{FFFFFF} %s", ReturnPlayerName( playerid ), playerid, msg );
|
||||||
|
p_AnswerDelay[ pID ] = iTime + 4;
|
||||||
|
Beep( pID ), Beep( playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:respond( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/respond [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cannot respond to yourself." );
|
||||||
|
else if ( g_iTime < p_RespondDelay[ pID ] ) return SendError( playerid, "Please wait another %d seconds to respond to this person.", p_RespondDelay[ pID ] - g_iTime );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) is responding to %s(%d)'s report", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageToAdmins( -1, ""COL_PINK"[REPORT]"COL_GREY" %s(%d) responded to %s(%d)'s report!", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_GREY" %s(%d) is now looking into your report. Please wait!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
p_RespondDelay[ pID ] = g_iTime + 4;
|
||||||
|
Beep( pID ), Beep( playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:aspawn( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/aspawn [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_PlayerLogged{ pID } == false ) return SendError( playerid, "This player is not logged in." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SyncObject( pID );
|
||||||
|
SpawnPlayer( pID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has spawned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have spawned %s(%d)!", ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been spawned by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:warn( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 32 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"S(No Reason)[32]", pID, reason ) ) return SendUsage( playerid, "/warn [PLAYER_ID] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You can't warn your self." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminCommandPause[ pID ] > g_iTime )
|
||||||
|
return SendError( playerid, "You must wait %d seconds before using this admin command on the player.", p_AdminCommandPause[ pID ] - g_iTime );
|
||||||
|
|
||||||
|
p_AdminCommandPause[ pID ] = g_iTime + ADMIN_COMMAND_TIME;
|
||||||
|
|
||||||
|
p_Warns[ pID ] ++;
|
||||||
|
GameTextForPlayer( pID, "~r~WARNED!", 4000, 4 );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has warned %s(%d) [%d/3]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, p_Warns[ pID ] );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has been warned by %s(%d) "COL_GREEN"[REASON: %s]", ReturnPlayerName( pID ), pID, ReturnPlayerName( playerid ), playerid, reason );
|
||||||
|
if ( p_Warns[ pID ] >= 3 )
|
||||||
|
{
|
||||||
|
p_Warns[ pID ] = 0;
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has been kicked from the server. "COL_GREEN"[REASON: Excessive Warns]", ReturnPlayerName( pID ), pID );
|
||||||
|
KickPlayerTimed( pID );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setskin( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
skin
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, skin ) ) SendUsage(playerid, "/setskin [PLAYER_ID] [SKIN_ID]");
|
||||||
|
else if ( !IsPlayerConnected(pID) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else if ( !IsValidSkin( skin ) ) return SendError( playerid, "Invalid Skin ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( GetPlayerState( pID ) == PLAYER_STATE_ENTER_VEHICLE_DRIVER || GetPlayerState( pID ) == PLAYER_STATE_ENTER_VEHICLE_PASSENGER ) return SendError( playerid, "You cannot set your skin if you're entering a vehicle." );
|
||||||
|
if ( GetPlayerState( pID ) == PLAYER_STATE_EXIT_VEHICLE ) return SendError( playerid, "You cannot set your skin if you're exiting a vehicle." );
|
||||||
|
if ( GetPlayerAnimationIndex( pID ) == 1660 ) return SendError( playerid, "The player specified is currently using a vending machine." );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed %s(%d)'s skin id to %d", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, skin );
|
||||||
|
SyncObject( pID );
|
||||||
|
SetPlayerSkin( pID, skin );
|
||||||
|
if ( pID != playerid ) {
|
||||||
|
SendClientMessageFormatted( pID, COLOR_PINK, "[ADMIN]"COL_WHITE" %s(%d) has changed your skin ID to %d.", ReturnPlayerName( playerid ), playerid, skin );
|
||||||
|
SendClientMessageFormatted( playerid, COLOR_PINK, "[ADMIN]"COL_WHITE" You have changed %s(%d)'s skin to ID %d.", ReturnPlayerName( pID ), pID, skin );
|
||||||
|
}
|
||||||
|
else SendClientMessageFormatted( playerid, COLOR_PINK, "[ADMIN]"COL_WHITE" You have changed your skin to ID %d.", skin );
|
||||||
|
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:stpfr( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage(playerid, "/stpfr [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected(pID) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cannot apply this to yourself." );
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_CantUseReport{ pID } = ( p_CantUseReport{ pID } == true ? false : true );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has been %s from using /report by %s(%d)", ReturnPlayerName( pID ), pID, p_CantUseReport{ pID } == true ? ( "blocked" ) : ( "unblocked" ), ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s %s(%d) from using the report command.", p_CantUseReport{ pID } == true ? ( "blocked" ) : ( "unblocked" ), ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:getstats( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage(playerid, "/getstats [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected(pID) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( !p_PlayerLogged{ pID } ) return SendError( playerid, "This player is not logged in." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_ViewingStats[ playerid ] = pID;
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_STATS, DIALOG_STYLE_LIST, "{FFFFFF}Statistics", "General Statistics\nGame Statistics\nItem Statistics\nStreak Statistics\nWeapon Statistics\nAchievements", "Okay", "Cancel" );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:a( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
msg[ 90 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return 0;
|
||||||
|
else if ( sscanf( params, "s[90]", msg ) ) return SendUsage( playerid, "/a [MESSAGE]" );
|
||||||
|
else if ( textContainsIP( msg ) ) return SendServerMessage( playerid, "Please do not advertise." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageToAdmins( -1, ""COL_PINK"<Admin Chat> %s(%d):"COL_GREY" %s", ReturnPlayerName( playerid ), playerid, msg );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:adminmanual( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) used /adminmanual", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageToAdmins( -1, ""COL_PINK"[ADMIN]"COL_GREY" Read the admin manual on the forum or you might be demoted (%s)!", "Help and Information > Administration Manual" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:slap( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
Float: offset,
|
||||||
|
Float: X,
|
||||||
|
Float: Y,
|
||||||
|
Float: Z
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"F(10.0)", pID, offset ) ) return SendUsage(playerid, "/slap [PLAYER_ID] [OFFSET (= 10.0)]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError(playerid, "You cannot use this command on admins higher than your level.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has slapped %s(%d) %0.1f units", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, offset );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have slapped %s(%d) %0.1f units", ReturnPlayerName( pID ), pID, offset );
|
||||||
|
GetPlayerPos( pID, X, Y, Z );
|
||||||
|
SetPlayerPos( pID, X, Y, Z + offset );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:jail( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
Seconds,
|
||||||
|
reason[ 50 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"dS(No Reason)[50]", pID, Seconds, reason ) ) return SendUsage( playerid, "/jail [PLAYER_ID] [SECONDS] [REASON]");
|
||||||
|
else if ( Seconds > 20000 || Seconds < 1 ) return SendError( playerid, "You're misleading the seconds limit ( 0 - 20000 )");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminCommandPause[ pID ] > g_iTime )
|
||||||
|
return SendError( playerid, "You must wait %d seconds before using this admin command on the player.", p_AdminCommandPause[ pID ] - g_iTime );
|
||||||
|
|
||||||
|
p_AdminCommandPause[ pID ] = g_iTime + ADMIN_COMMAND_TIME;
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has jailed %s(%d) for %d seconds", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, Seconds );
|
||||||
|
JailPlayer( pID, Seconds, 1 );
|
||||||
|
if ( Seconds > 60 ) cmd_rules( pID, "" ); // Force rules
|
||||||
|
SendGlobalMessage( -1, ""COL_GOLD"[JAIL]{FFFFFF} %s(%d) has been sent to jail for %d seconds by %s "COL_GREEN"[REASON: %s]", ReturnPlayerName( pID ), pID, Seconds, ReturnPlayerName( playerid ), reason );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:unjail( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/unjail [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsPlayerJailed( pID ) ) return SendError( playerid, "This player is not jailed." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CallLocalFunction( "OnPlayerUnjailed", "dd", pID, 3 );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has unjailed %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_GOLD"[JAIL]{FFFFFF} %s(%d) has been unjailed by %s(%d).", ReturnPlayerName( pID ), pID, ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:spec( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage(playerid, "/spec [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError(playerid, "You cannot spectate yourself.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_Spectating{ playerid } == true )
|
||||||
|
{
|
||||||
|
if ( IsPlayerConnected( p_whomSpectating[ playerid ] ) ) {
|
||||||
|
p_beingSpectated[ p_whomSpectating[ playerid ] ] = false;
|
||||||
|
p_whomSpectating[ playerid ] = INVALID_PLAYER_ID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( new i; i < sizeof( p_SpectateWeapons[ ] ); i++ )
|
||||||
|
{
|
||||||
|
GetPlayerWeaponData( playerid, i, p_SpectateWeapons[ playerid ] [ i ] [ 0 ], p_SpectateWeapons[ playerid ] [ i ] [ 1 ] );
|
||||||
|
if ( p_SpectateWeapons[ playerid ] [ i ] [ 1 ] > 10000 ) p_SpectateWeapons[ playerid ] [ i ] [ 1 ] = 15000;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetPlayerInterior( playerid, GetPlayerInterior( pID ) );
|
||||||
|
SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld( pID ) );
|
||||||
|
|
||||||
|
if ( !IsPlayerUnderCover( playerid ) ) {
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) is spectating %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
|
||||||
|
p_Spectating{ playerid } = true;
|
||||||
|
p_whomSpectating[ playerid ] = pID;
|
||||||
|
p_beingSpectated[ pID ] = true;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You are now spectating %s(%d).", ReturnPlayerName( pID ), pID );
|
||||||
|
if ( IsPlayerInAnyVehicle( pID ) )
|
||||||
|
{
|
||||||
|
TogglePlayerSpectating(playerid, 1),
|
||||||
|
PlayerSpectateVehicle( playerid, GetPlayerVehicleID( pID ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TogglePlayerSpectating( playerid, 1 ),
|
||||||
|
PlayerSpectatePlayer( playerid, pID );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:specoff( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 && !IsPlayerUnderCover( playerid ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
if ( p_Spectating{ playerid } == true )
|
||||||
|
{
|
||||||
|
TogglePlayerSpectating( playerid, 0 );
|
||||||
|
if ( IsPlayerConnected( p_whomSpectating[ playerid ] ) ) {
|
||||||
|
p_beingSpectated[ p_whomSpectating[ playerid ] ] = false;
|
||||||
|
p_whomSpectating[ playerid ] = INVALID_PLAYER_ID;
|
||||||
|
}
|
||||||
|
p_Spectating{ playerid } = false;
|
||||||
|
SendServerMessage( playerid, "Spectation has been closed." );
|
||||||
|
}
|
||||||
|
else SendError(playerid, "You're not spectating!");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:goto( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
Float: X,
|
||||||
|
Float: Y,
|
||||||
|
Float: Z
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/goto [PLAYER_ID]" );
|
||||||
|
else if ( ! IsPlayerConnected( pID ) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError(playerid, "You cannot go to yourself.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetPlayerPos( pID, X, Y, Z );
|
||||||
|
SetPlayerPosition( playerid, X, Y + 2, Z, GetPlayerInterior( pID ), GetPlayerVirtualWorld( pID ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has teleported to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
if ( p_InHouse[ playerid ] != -1 ) p_InHouse[ playerid ] = -1;
|
||||||
|
if ( p_InGarage[ playerid ] != -1 ) p_InGarage[ playerid ] = -1;
|
||||||
|
if ( p_inPaintBall{ playerid } ) LeavePlayerPaintball( playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:mutelist( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
count = 0, time = g_iTime;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
SendClientMessage( playerid, COLOR_PINK, ".: Mute List :." );
|
||||||
|
foreach(new i : Player)
|
||||||
|
{
|
||||||
|
if ( p_Muted{ i } == true && time < p_MutedTime[ i ] )
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( playerid, COLOR_GREY, "%s (%s)", ReturnPlayerName( i ), secondstotime( p_MutedTime[ i ] - time ) );
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( count == 0 ) SendClientMessage( playerid, COLOR_GREY, "There are no muted players online." );
|
||||||
|
return 1;
|
||||||
|
}
|
606
gamemodes/irresistible/cnr/commands/admin/admin_rcon.pwn
Normal file
606
gamemodes/irresistible/cnr/commands/admin/admin_rcon.pwn
Normal file
@ -0,0 +1,606 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_rcon.pwn
|
||||||
|
* Purpose: level rcon administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:resetgangrespect( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( ! IsPlayerAdmin( playerid ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// reset preloaded and database
|
||||||
|
foreach ( new g : gangs ) {
|
||||||
|
g_gangData[ g ] [ E_RESPECT ] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mysql_single_query( "UPDATE `GANGS` SET `RESPECT` = 0" );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has reset all gang respect!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:hitmanbudget( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( ! IsPlayerAdmin( playerid ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
new
|
||||||
|
amount;
|
||||||
|
|
||||||
|
if ( sscanf( params, "d", amount ) )
|
||||||
|
return SendUsage( playerid, "/hitmanbudget [AMOUNT]" );
|
||||||
|
|
||||||
|
UpdateServerVariable( "hitman_budget", GetGVarInt( "hitman_budget" ) + amount, 0.0, "", GLOBAL_VARTYPE_INT );
|
||||||
|
SendServerMessage( playerid, "Hitman budget now currently at %s.", number_format( GetGVarInt( "hitman_budget" ) ) );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:explosiverounds( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( ! IsPlayerAdmin( playerid ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
new
|
||||||
|
targetid, rounds;
|
||||||
|
|
||||||
|
if ( sscanf( params, "ud", targetid, rounds ) )
|
||||||
|
return SendUsage( playerid, "/explosiverounds [PLAYER_ID] [ROUNDS]" );
|
||||||
|
|
||||||
|
p_ExplosiveBullets[ targetid ] += rounds;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've given %s(%d) %d explosive rounds.", ReturnPlayerName( targetid ), targetid, rounds );
|
||||||
|
ShowPlayerHelpDialog( targetid, 1500, "You have %d explosive bullets remaining.", p_ExplosiveBullets[ targetid ] );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*CMD:furnishhomes( playerid, params[ ] ) {
|
||||||
|
if ( ! IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
for ( new i = 0; i < MAX_HOUSES; i ++ ) if ( g_houseData[ i ] [ E_CREATED ] ) {
|
||||||
|
new interior = GetInteriorType( i );
|
||||||
|
if ( interior != -1 ) FillHomeWithFurniture( i, interior );
|
||||||
|
else SendServerMessage( playerid, "House ID %d has an invalid inteiror", i );
|
||||||
|
}
|
||||||
|
SendServerMessage( playerid, "All houses have been furnished." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
stock GetInteriorType( houseid ) {
|
||||||
|
for ( new i = 0; i < sizeof( g_houseInteriors ); i ++ ) {
|
||||||
|
if ( IsPointToPoint( 2.0, g_houseInteriors[ i ] [ E_EX ], g_houseInteriors[ i ] [ E_EY ], g_houseInteriors[ i ] [ E_EZ ], g_houseData[ houseid ] [ E_TX ], g_houseData[ houseid ] [ E_TY ], g_houseData[ houseid ] [ E_TZ ] ) )
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
CMD:updatepool( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
poolid, pool, win, gamble;
|
||||||
|
|
||||||
|
if ( ! IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "ddD(0)D(0)", poolid, pool, win, gamble ) ) return SendError( playerid, "/updatepool [POOL_ID] [POOL_INCREMENT] [TOTAL_WON] [TOTAL_GAMBLED]" );
|
||||||
|
else if ( !Iter_Contains( CasinoPool, poolid ) ) return SendError( playerid, "This Pool ID does not exist!" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateCasinoPoolData( poolid, pool, win, gamble );
|
||||||
|
SendServerMessage( playerid, "You have updated pool id %d", poolid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:updatedonortd( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
targetid, Float: amount, reset;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "D(0)D(65535)F(0.0)", reset, targetid, amount ) ) return SendUsage( playerid, "/updatedonortd [RESET] [PLAYER_ID] [AMOUNT]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Reset the top donor
|
||||||
|
if ( reset ) {
|
||||||
|
TextDrawSetString( g_TopDonorTD, "Nobody Donated :(" );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update it incase
|
||||||
|
UpdateGlobalDonated( targetid, amount );
|
||||||
|
SendServerMessage( playerid, "Updating latest donor now (player id %d, amount %f)", targetid, amount );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroygang( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
gID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "d", gID ) ) return SendUsage( playerid, "/destroygang [GANG_ID]" );
|
||||||
|
else if ( gID < 0 || gID > MAX_GANGS ) return SendError( playerid, "Invalid gang ID." );
|
||||||
|
else if ( !Iter_Contains( gangs, gID ) ) return SendError( playerid, "Invalid gang ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a gang", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GANG]"COL_WHITE" You have destroyed \"%s\" which was the ID of %d.", g_gangData[ gID ] [ E_NAME ], gID );
|
||||||
|
DestroyGang( gID, false );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:time( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
new
|
||||||
|
timeid;
|
||||||
|
|
||||||
|
if ( sscanf( params, "d", timeid ) )
|
||||||
|
return SendUsage( playerid, "/time [SECONDS]" );
|
||||||
|
|
||||||
|
g_WorldClockSeconds = timeid;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:playsound( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
sound;
|
||||||
|
|
||||||
|
if ( sscanf( params, ""#sscanf_u"d", pID, sound ) )
|
||||||
|
return SendUsage( playerid, "/playsound [PLAYER_ID] [SOUND]" );
|
||||||
|
|
||||||
|
PlayerPlaySound( pID, sound, 0.0, 0.0, 0.0 );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:addgpci( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) SendUsage( playerid, "/addgpci [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
playerserial[ 45 ];
|
||||||
|
|
||||||
|
gpci( pID, playerserial, sizeof( playerserial ) );
|
||||||
|
AddFileLogLine( "gpci.txt", sprintf( "USER : %s , GPCI : %s\r\n", ReturnPlayerName( pID ), playerserial ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vipdiscount( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new Float: percent;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "f", percent ) ) return SendUsage( playerid, "/vipdiscount [PERCENTAGE]" );
|
||||||
|
// else if ( percent < 50.0 || percent > 100.0 ) return SendError( playerid, "The percentage must be over 50 and less than 100." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendServerMessage( playerid, "V.I.P discount percentage set to %f! (old = %f)", percent, GetGVarFloat( "vip_discount" ) );
|
||||||
|
UpdateServerVariable( "vip_discount", 0, ( 1 - ( percent / 100 ) ), "", GLOBAL_VARTYPE_FLOAT );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vipbonus( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new Float: percent;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "f", percent ) ) return SendUsage( playerid, "/vipbonus [PERCENTAGE]" );
|
||||||
|
else if ( percent < 0.0 || percent > 100.0 ) return SendError( playerid, "The percentage must be over 0 and less than 100." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendServerMessage( playerid, "V.I.P bonus percentage set to %f! (old = %f)", percent, GetGVarFloat( "vip_bonus" ) );
|
||||||
|
UpdateServerVariable( "vip_bonus", 0, ( percent / 100 ), "", GLOBAL_VARTYPE_FLOAT );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:blockip( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new address[16], timems;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if (sscanf(params, "ds[16]", timems, address)) SendUsage(playerid, "/blockip [TIME_MS] [IP_ADDRESS]");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[BLOCKED]"COL_WHITE" IP %s has been blocked (%d timems).", address, timems );
|
||||||
|
BlockIpAddress( address, timems );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:unblockip( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new address[16];
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if (sscanf(params, "s[16]", address)) SendUsage(playerid, "/unblockip [IP_ADDRESS]");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[BLOCKED]"COL_WHITE" IP %s has been unblocked.", address );
|
||||||
|
UnBlockIpAddress( address );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:svrquery( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szQuery[ 144 ];
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "s[144]", szQuery ) ) return SendUsage( playerid, "/svrquery [QUERY]" );
|
||||||
|
else if ( p_AccountID[ playerid ] != 1 ) return SendError( playerid, "No." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendServerMessage( playerid, "%s", szQuery );
|
||||||
|
mysql_function_query( dbHandle, szQuery, true, "OnQueryServerViaRCON", "i", playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread OnQueryServerViaRCON( playerid )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
rows, fields, affected = cache_affected_rows( );
|
||||||
|
|
||||||
|
cache_get_data( rows, fields );
|
||||||
|
SendClientMessageFormatted( playerid, COLOR_YELLOW, "Query Sent. (Rows: %d, Fields: %d, Affected: %d)", rows, fields, affected );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ENABLED_SECURE_TRUCK == true
|
||||||
|
CMD:connectnpc( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
ConnectNPC( SECURE_TRUCK_DRIVER_NAME, "secureguard" );
|
||||||
|
SendServerMessage( playerid, "Connecting NPC now." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED_EASTER_EGG == true
|
||||||
|
CMD:setegg( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
if ( g_EasterHunt ) return SendError( playerid, "The " #EASTEREGG_NAME " hunt has already started." );
|
||||||
|
|
||||||
|
new
|
||||||
|
Float: X, Float: Y, Float: Z;
|
||||||
|
|
||||||
|
if ( GetPlayerPos( playerid, X, Y, Z ) ) {
|
||||||
|
if ( CreateEasterEgg( X, Y, Z ) != -1 ) {
|
||||||
|
SendServerMessage( playerid, "Planted " #EASTEREGG_NAME " at your current position." );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has set a " #EASTEREGG_NAME "", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
else SendError( playerid, "There isn't enough room for another " #EASTEREGG_NAME "." );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:treasurehunt( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if ( Iter_Count(eastereggs) < 1 )
|
||||||
|
return SendError( playerid, "There are not enough " #EASTEREGG_NAME "s planted to start the treasure hunt." );
|
||||||
|
|
||||||
|
// if its false, destroy all egs
|
||||||
|
if ( ( g_EasterHunt = ! g_EasterHunt ) == false )
|
||||||
|
{
|
||||||
|
for ( new i = 0; i < MAX_EGGS; i ++)
|
||||||
|
DestroyEasterEgg( i );
|
||||||
|
}
|
||||||
|
|
||||||
|
// alert admin log
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has started a treasurehunt", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_GOLD" Treasure Hunt has been %s", g_EasterHunt == true ? ("activated, look around for " #EASTEREGG_NAME "s and get a free gift.") : ("de-activated.") );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
CMD:addcomponent( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
componentid;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "d", componentid ) ) return SendUsage( playerid, "/addcomponent [COMPONENT_ID]" );
|
||||||
|
else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You need to be in a vehicle." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new vehicleid = GetPlayerVehicleID( playerid );
|
||||||
|
AddVehicleComponent( vehicleid, componentid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Added componentid id %d to this vehicle.", componentid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:replenishsafe( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
rID;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "d", rID ) ) return SendUsage( playerid, "/replenishsafe [SAFE_ID]" );
|
||||||
|
else if (!Iter_Contains(RobberyCount, rID)) return SendError( playerid, "This is an invalid Safe ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf( "[GM:ADMIN] %s has replenished %d! (Success: %d)", ReturnPlayerName( playerid ), rID, setSafeReplenished( rID ) );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You've replenished Safe ID %d: "COL_GREY"%s"COL_WHITE".", rID, g_robberyData[ rID ] [ E_NAME ] );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:driveby( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
g_Driveby = !g_Driveby;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s driveby.", g_Driveby == false ? ("enabled") : ("disabled"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:debug( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
g_Debugging = !g_Debugging;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s debugging.", g_Debugging == true ? ("enabled") : ("disabled"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vippm( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
g_VipPrivateMsging = !g_VipPrivateMsging;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have %s vip only messaging.", g_VipPrivateMsging == true ? ("enabled") : ("disabled"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:logcmd( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
g_CommandLogging = !g_CommandLogging;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You are %s commands.", g_CommandLogging == true ? ("logging") : ("not logging"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:logdialog( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
g_DialogLogging = !g_DialogLogging;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You are %s dialogs.", g_CommandLogging == true ? ("logging") : ("not logging"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:settaxrate( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new Float: rate;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "f", rate ) ) return SendUsage( playerid, "/settaxrate [PERCENTAGE]" );
|
||||||
|
else if ( rate < 0 || rate > 10.0 ) return SendError( playerid, "The rate must be over 0 and less than 10." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendServerMessage( playerid, "You have changed the tax rate from "COL_GREY"%0.2f"COL_WHITE" to "COL_GREY"%0.2f"COL_WHITE".", GetGVarFloat( "taxrate" ), rate );
|
||||||
|
UpdateServerVariable( "taxrate", 0, rate, "", GLOBAL_VARTYPE_FLOAT );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:settaxtime( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new time;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "d", time ) ) return SendUsage( playerid, "/settaxrate [TIMESTAMP]" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( time < g_iTime ) {
|
||||||
|
SendServerMessage( playerid, "Tax time updated. Players to be taxed A.S.A.P.", secondstotime( time - g_iTime ) );
|
||||||
|
} else {
|
||||||
|
SendServerMessage( playerid, "Tax time updated. %s until tax.", secondstotime( time - g_iTime ) );
|
||||||
|
}
|
||||||
|
UpdateServerVariable( "taxtime", time, 0.0, "", GLOBAL_VARTYPE_INT );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:givewanted( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID, wantedlvl
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, wantedlvl ) ) SendUsage( playerid, "/givewanted [PLAYER_ID] [WANTED_LVL]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has gave %s(%d) %d wanted level", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, wantedlvl );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have modified %s(%d)'s wanted level by %d.", ReturnPlayerName( pID ), pID, wantedlvl );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Your wanted level has been modified by %s(%d).", ReturnPlayerName( playerid ), playerid );
|
||||||
|
GivePlayerWantedLevel( pID, wantedlvl );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:givescore( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID, score
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, score ) ) SendUsage( playerid, "/givescore [PLAYER_ID] [SCORE]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given %s(%d)'s %d score", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, score );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have given %s(%d) %d score!", ReturnPlayerName( pID ), pID, score );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been given %d score from %s(%d)!", score, ReturnPlayerName( playerid ), playerid );
|
||||||
|
SetPlayerScore( pID, GetPlayerScore( pID ) + score );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:ping( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new ping;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, "d", ping ) ) return SendUsage( playerid, "/ping [PING]" );
|
||||||
|
else if ( ping < 200 ) return SendError( playerid, "The ping cannot be under 200." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_PingLimit = ping;
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) set the ping limit to %d", ReturnPlayerName( playerid ), playerid, ping );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) set the ping limit to %d", ReturnPlayerName( playerid ), playerid, ping );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:givexp( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
xp
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) || !IsPlayerLorenc( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, xp ) ) SendUsage( playerid, "/givexp [PLAYER_ID] [XP_AMOUNT]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GivePlayerXP( pID, xp );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given %s(%d) %d XP", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, xp );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has given you %d XP.", ReturnPlayerName( playerid ), playerid, xp );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've given %s(%d) %d XP.", ReturnPlayerName( pID ), pID, xp );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:giveip( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
ip
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) || !IsPlayerLorenc( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, ip ) ) SendUsage( playerid, "/giveip [PLAYER_ID] [IP_AMOUNT]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GivePlayerIrresistiblePoints( pID, ip );
|
||||||
|
//AddAdminLogLineFormatted( "%s(%d) has given %s(%d) %d IP", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, ip );
|
||||||
|
//SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has given you %d IP.", ReturnPlayerName( playerid ), playerid, ip );
|
||||||
|
//SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've given %s(%d) %d IP.", ReturnPlayerName( pID ), pID, ip );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:givecoins( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
sendtoid,
|
||||||
|
Float: coins
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) || !IsPlayerLorenc( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"f", sendtoid, coins ) ) SendUsage( playerid, "/givecoins [PLAYER_ID] [COINS]" );
|
||||||
|
else if ( !IsPlayerConnected( sendtoid ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_IrresistibleCoins[ sendtoid ] += coins;
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given %s(%d) %0.2f IC", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( sendtoid ), sendtoid, coins );
|
||||||
|
SendClientMessageFormatted( sendtoid, -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has given you %0.2f IC.", ReturnPlayerName( playerid ), playerid, coins );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've given %s(%d) %0.2f IC.", ReturnPlayerName( sendtoid ), sendtoid, coins );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:givecash( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
cash
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) || !IsPlayerLorenc( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, cash ) ) SendUsage( playerid, "/givecash [PLAYER_ID] [CASH]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GivePlayerCash( pID, cash );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given %s(%d) %d dollars", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, cash );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has given you "COL_GOLD"%s", ReturnPlayerName( playerid ), playerid, number_format( cash ) );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've given %s(%d) "COL_GOLD"%s", ReturnPlayerName( pID ), pID, number_format( cash ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setviplevel( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
level
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) || !IsPlayerLorenc( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, level ) ) return SendUsage( playerid, "/setviplevel [PLAYER_ID] [VIP_LEVEL]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_PlayerLogged{ pID } == false ) return SendError( playerid, "This player is not logged in." );
|
||||||
|
else if ( level > VIP_DIAMOND || level < 0 ) return SendError( playerid, "Specify a level between 0 - 5 please!" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerVipLevel( pID, level );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_GOLD"[VIP LEVEL]"COL_WHITE" You have set %s(%d)'s VIP package to %s.", ReturnPlayerName( pID ), pID, VIPToString( level ) );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_GOLD"[VIP LEVEL]"COL_WHITE" Your VIP package has been set to %s by %s(%d)", VIPToString( level ), ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:extendvip( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
days
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, days ) ) return SendUsage( playerid, "/extendvip [PLAYER_ID] [DAYS]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_VIPLevel[ pID ] < VIP_REGULAR ) return SendError( playerid, "This player doesn't have a V.I.P level." );
|
||||||
|
else if ( days < -365 || days > 365 ) return SendError( playerid, "Extension can only vary from -365 to 365 days." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_VIPExpiretime[ pID ] += ( days ) * 86400;
|
||||||
|
if ( days >= 0 )
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_GOLD"[VIP EXTENSION]"COL_WHITE" You have had your V.I.P extended for "COL_GREEN"%d days"COL_WHITE" by %s(%d).", days, ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_GOLD"[VIP EXTENSION]"COL_WHITE" You have extended %s(%d)'s V.I.P for "COL_GREEN"%d days"COL_WHITE".", ReturnPlayerName( pID ), pID, days );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
days = days * -1; // conversion to whole number
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_GOLD"[VIP EXTENSION]"COL_WHITE" You have had your V.I.P decremented for "COL_RED"%d days"COL_WHITE" by %s(%d).", days, ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_GOLD"[VIP EXTENSION]"COL_WHITE" You have decremented %s(%d)'s V.I.P for "COL_RED"%d days"COL_WHITE".", ReturnPlayerName( pID ), pID, days );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:kickall( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( !IsPlayerAdmin( playerid ) ) return 0;
|
||||||
|
SetServerRule( "password", "updating" );
|
||||||
|
SendClientMessageToAll( -1, ""COL_PINK"[ADMIN]"COL_WHITE" Everyone has been kicked from the server due to a server update." );
|
||||||
|
for( new i; i < MAX_PLAYERS; i++ ) if ( IsPlayerConnected( i ) && ! IsPlayerNPC( i ) && p_AccountID[ i ] != 1 ) {
|
||||||
|
Kick( i );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
430
gamemodes/irresistible/cnr/commands/admin/admin_six.pwn
Normal file
430
gamemodes/irresistible/cnr/commands/admin/admin_six.pwn
Normal file
@ -0,0 +1,430 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_six.pwn
|
||||||
|
* Purpose: level six administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:createbusiness( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
Float: X, Float: Y, Float: Z, cost, type
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "dd", cost, type ) ) return SendUsage( playerid, "/createbusiness [COST] [TYPE]" );
|
||||||
|
else if ( cost < 100 ) return SendError( playerid, "The price must be located above 100 dollars." );
|
||||||
|
else if ( ! ( 0 <= type <= 3 ) ) return SendError( playerid, "Invalid business type (Weed=0, Meth=1, Coke=2, Weapons=3)." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetPlayerPos( playerid, X, Y, Z );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has created a business", ReturnPlayerName( playerid ), playerid );
|
||||||
|
|
||||||
|
new
|
||||||
|
iTmp = CreateBusiness( 0, "Business", cost, type, X, Y, Z );
|
||||||
|
|
||||||
|
if ( iTmp != ITER_NONE ) {
|
||||||
|
SaveToAdminLog( playerid, iTmp, "created business" );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" You have created a %s business taking up business id %d.", number_format( cost ), iTmp );
|
||||||
|
} else {
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" Unable to create a business due to a unexpected error." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroybusiness( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iBusiness;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", iBusiness ) ) return SendUsage( playerid, "/destroybusiness [BUSINESS_ID]" );
|
||||||
|
else if ( iBusiness < 0 || iBusiness >= MAX_BUSINESSES ) return SendError( playerid, "Invalid Business ID." );
|
||||||
|
else if ( !Iter_Contains( business, iBusiness ) ) return SendError( playerid, "Invalid Business ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLog( playerid, iBusiness, "destroy business" );
|
||||||
|
format( szBigString, sizeof( szBigString ), "[DG] [%s] %s | %d | %d\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), g_businessData[ iBusiness ] [ E_OWNER_ID ], iBusiness );
|
||||||
|
AddFileLogLine( "log_business.txt", szBigString );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted a business", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[BUSINESS]"COL_WHITE" You have destroyed the business ID %d.", iBusiness );
|
||||||
|
DestroyBusiness( iBusiness );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:reloadeditor( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
SetServerRule( "reloadfs", "objecteditor" );
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have successfully reloaded the object editor." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:createentrance( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
Float: X, Float: Y, Float: Z,
|
||||||
|
Float: toX, Float: toY, Float: toZ,
|
||||||
|
ownerid, interior, world, customInterior, vipOnly, label[32]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, sscanf_u # "fffdddds[32]", ownerid, toX, toY, toZ, interior, world, customInterior, vipOnly, label ) ) return SendUsage( playerid, "/createhouse [OWNER] [TO_X] [TO_Y] [TO_Z] [INTERIOR] [WORLD] [CUSTOM_INTERIOR] [VIP_ONLY] [LABEL]" );
|
||||||
|
else if ( !IsPlayerConnected( ownerid ) || IsPlayerNPC( ownerid ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has created an entrance", ReturnPlayerName( playerid ), playerid );
|
||||||
|
|
||||||
|
if ( GetPlayerPos( playerid, X, Y, Z ) ) {
|
||||||
|
new
|
||||||
|
entranceid = CreateEntrance( label, X, Y, Z, toX, toY, toZ, interior, world, customInterior > 0, vipOnly > 0 );
|
||||||
|
|
||||||
|
if ( entranceid == -1 )
|
||||||
|
return SendClientMessage( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" Unable to create a entrance due to a unexpected error." );
|
||||||
|
|
||||||
|
SaveToAdminLog( playerid, entranceid, "created entrance" );
|
||||||
|
g_entranceData[ entranceid ] [ E_SAVED ] = true;
|
||||||
|
|
||||||
|
format( szBigString, 256, "INSERT INTO `ENTRANCES` (`OWNER`, `LABEL`, `X`, `Y`, `Z`, `EX`, `EY`, `EZ`, `INTERIOR`, `WORLD`, `CUSTOM`, `VIP_ONLY`) VALUES ('%s','%s',%f,%f,%f,%f,%f,%f,%d,%d,%d,%d)", mysql_escape( ReturnPlayerName( ownerid ) ), mysql_escape( label ), X, Y, Z, toX, toY, toZ, interior, world, customInterior, vipOnly );
|
||||||
|
mysql_single_query( szBigString );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[HOUSE]"COL_WHITE" You have created a entrance using id %d.", entranceid );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:destroyentrance( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
Float: distance = FLOAT_INFINITY, confirm,
|
||||||
|
entranceid = GetClosestEntrance( playerid, distance );
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", confirm ) ) return SendUsage( playerid, "/destroyentrance [ARE_YOU_SURE (0 or 1)]" );
|
||||||
|
else if ( confirm < 1 ) return SendError( playerid, "Must confirm by typing a number above 0." );
|
||||||
|
else if ( entranceid < 0 || entranceid > MAX_ENTERS ) return SendError( playerid, "Invalid entrance ID." );
|
||||||
|
else if ( !Iter_Contains( entrances, entranceid ) ) return SendError( playerid, "Invalid entrance ID." );
|
||||||
|
else if ( !g_entranceData[ entranceid ] [ E_SAVED ] ) return SendError( playerid, "Must be a saved entrance." );
|
||||||
|
else if ( distance > 100.0 ) return SendError( playerid, "Must be within 10m of the nearest entrance." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// log deletions
|
||||||
|
format( szBigString, sizeof( szBigString ), "[DE] [%s] %s | %f,%f,%f | %d\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), g_entranceData[ entranceid ] [ E_EX ], g_entranceData[ entranceid ] [ E_EY ], g_entranceData[ entranceid ] [ E_EZ ], entranceid );
|
||||||
|
AddFileLogLine( "log_entrances.txt", szBigString );
|
||||||
|
|
||||||
|
// delete and log
|
||||||
|
SaveToAdminLog( playerid, entranceid, "destroy entrance" );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has deleted an entrance", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ENTRANCE]"COL_WHITE" You have destroyed entrance id %d", entranceid );
|
||||||
|
DestroyEntrance( entranceid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setgangleader( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
sqlid, pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d" #sscanf_u, sqlid, pID ) ) return SendUsage( playerid, "/setgangleader [GANG_ID] [PLAYER_ID]" );
|
||||||
|
//else if ( !Iter_Contains( gangs, gID ) ) return SendError( playerid, "Invalid Gang ID." );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
// else if ( p_GangID[ pID ] != gID ) return SendError( playerid, "This player isn't in this gang." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
gid = -1;
|
||||||
|
|
||||||
|
foreach ( new g : gangs ) if ( g_gangData[ g ] [ E_SQL_ID ] == sqlid ) {
|
||||||
|
gid = g;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! Iter_Contains( gangs, gid ) )
|
||||||
|
return SendError( playerid, "Invalid Gang ID." );
|
||||||
|
|
||||||
|
SetPlayerGang( pID, gid );
|
||||||
|
g_gangData[ gid ] [ E_LEADER ] = p_AccountID[ pID ];
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, gid, "setgangleader to %s (acc id %d)", ReturnPlayerName( pID ), p_AccountID[ pID ] );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GANG]"COL_WHITE" %s(%d) is now the leader of %s.", ReturnPlayerName( pID ), pID, g_gangData[ gid ] [ E_NAME ] );
|
||||||
|
SendClientMessageToGang( gid, g_gangData[ gid ] [ E_COLOR ], "[GANG]{FFFFFF} %s(%d) is the new gang leader, forcefully by %s.", ReturnPlayerName( pID ), pID, ReturnPlayerName( playerid ) );
|
||||||
|
SaveGangData( gid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:viewgangtalk( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
gID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", gID ) )
|
||||||
|
{
|
||||||
|
if ( p_ViewingGangTalk[ playerid ] != -1 )
|
||||||
|
{
|
||||||
|
p_ViewingGangTalk[ playerid ] = -1;
|
||||||
|
return SendServerMessage( playerid, "You have stopped viewing other gang messages." );
|
||||||
|
}
|
||||||
|
return SendUsage( playerid, "/viewgangtalk [GANG_ID]" );
|
||||||
|
}
|
||||||
|
else if ( gID < 0 || gID > MAX_GANGS ) return SendError( playerid, "Invalid Gang ID." );
|
||||||
|
else if ( !Iter_Contains( gangs, gID ) ) return SendError( playerid, "Invalid Gang ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_ViewingGangTalk[ playerid ] = gID;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[GANG]"COL_WHITE" You are now viewing gang messages of %s.", g_gangData[ gID ] [ E_NAME ] );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:broadcast( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szURL[ 128 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[128]", szURL ) ) return SendUsage( playerid, "/broadcast [MP3_URL]");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
bStopped = strmatch( szURL, "stop" );
|
||||||
|
|
||||||
|
foreach(new i : Player)
|
||||||
|
{
|
||||||
|
if ( !IsPlayerUsingRadio( i ) )
|
||||||
|
{
|
||||||
|
if ( bStopped )
|
||||||
|
{
|
||||||
|
StopAudioStreamForPlayer( i );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PlayAudioStreamForPlayer( i, szURL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( bStopped )
|
||||||
|
{
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have stopped broadcasting your audio to players." );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "broadcast %s", szURL );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Broadcasting "COL_GREY"%s"COL_WHITE".", szURL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:seteventhost( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 && p_AccountID[ playerid ] != GetGVarInt( "eventhost" ) ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) SendUsage( playerid, "/seteventhost [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_AdminLevel[ pID ] < 4 ) return SendError( playerid, "The user you specify must have an administration level 4 or above." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateServerVariable( "eventhost", p_AccountID[ pID ], 0.0, "", GLOBAL_VARTYPE_INT );
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "seteventhost to %s (acc id %d)", ReturnPlayerName( pID ), p_AccountID[ pID ] );
|
||||||
|
|
||||||
|
if ( playerid != pID )
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has set %s(%d) as event host", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has designated %s(%d) as the event host!", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has set himself as event host", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has designated himself as the event host!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setlevel( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
iLevel
|
||||||
|
;
|
||||||
|
if ( !IsPlayerAdmin( playerid ) && p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, iLevel ) ) SendUsage( playerid, "/setlevel [PLAYER_ID] [LEVEL]");
|
||||||
|
else if ( iLevel < 0 || iLevel > 6 ) return SendError( playerid, "Please specify an administration level between 0 and 6." );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !IsPlayerLorenc( playerid ) && p_AdminLevel[ playerid ] >= 6 && iLevel > 5 )
|
||||||
|
return SendError( playerid, "You maximum level you are able to promote a person to is 5." );
|
||||||
|
|
||||||
|
// Log level
|
||||||
|
mysql_single_query( sprintf( "INSERT INTO `ADMIN_LEVELS`(`USER_ID`,`EXEC_ID`,`LEVEL`) VALUES (%d,%d,%d)", p_AccountID[ pID ], p_AccountID[ playerid ], iLevel ) );
|
||||||
|
|
||||||
|
// Set level
|
||||||
|
p_AdminLevel[ pID ] = iLevel;
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has set %s(%d)'s admin level to %d", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iLevel );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]{FFFFFF} %s(%d) has set your admin level to %d!", ReturnPlayerName( playerid ), playerid, iLevel );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've set %s(%d)'s admin level to %d!", ReturnPlayerName( pID ), pID, iLevel );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:setleveloffline( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iLevel, szName[ 24 ];
|
||||||
|
|
||||||
|
if ( !IsPlayerAdmin( playerid ) && p_AdminLevel[ playerid ] < 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "ds[24]", iLevel, szName ) ) SendUsage( playerid, "/setleveloffline [LEVEL] [PLAYER_NAME]");
|
||||||
|
else if ( iLevel < 0 || iLevel > 6 ) return SendError( playerid, "Please specify an administration level between 0 and 6." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !IsPlayerLorenc( playerid ) && p_AdminLevel[ playerid ] >= 6 && iLevel > 4 )
|
||||||
|
return SendError( playerid, "You maximum level you are able to promote a person to is 4." );
|
||||||
|
|
||||||
|
mysql_function_query( dbHandle, sprintf( "UPDATE `USERS` SET `ADMINLEVEL`=%d WHERE `NAME`='%s'", iLevel, mysql_escape( szName ) ), true, "OnPlayerUpdateAdminLevel", "iis", playerid, iLevel, szName );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread OnPlayerUpdateAdminLevel( playerid, level, name[ ] )
|
||||||
|
{
|
||||||
|
if ( cache_affected_rows( ) )
|
||||||
|
{
|
||||||
|
// Log level
|
||||||
|
format( szBigString, sizeof( szBigString ), "INSERT INTO `ADMIN_LEVELS`(`USER_ID`,`EXEC_ID`,`LEVEL`) VALUES ((SELECT `ID` FROM `USERS` WHERE `NAME`='%s'),%d,%d)", name, p_AccountID[ playerid ], level );
|
||||||
|
mysql_single_query( szBigString );
|
||||||
|
|
||||||
|
// Set level
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has set %s's admin level to %d", ReturnPlayerName( playerid ), playerid, name, level );
|
||||||
|
return SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've set %s's admin level to %d!", name, level );
|
||||||
|
}
|
||||||
|
|
||||||
|
return SendError( playerid, "This user does not exist." );
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:svrstats( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( strmatch( params, "version" ) )
|
||||||
|
return SendServerMessage( playerid, "Current version is "COL_GREY"%s", FILE_BUILD ), 1;
|
||||||
|
|
||||||
|
if ( strmatch( params, "ticks" ) )
|
||||||
|
return SendServerMessage( playerid, "Current tick rate of server is: %d", GetServerTickRate( ) ), 1;
|
||||||
|
|
||||||
|
if ( strmatch( params, "uptime" ) )
|
||||||
|
return SendServerMessage( playerid, "Server online for "COL_GREY"%s", secondstotime( g_iTime - g_ServerUptime ) ), 1;
|
||||||
|
|
||||||
|
return SendUsage( playerid, "/svrstats [VERSION/TICKS/UPTIME]" ), 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:playaction( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
new
|
||||||
|
pID, action;
|
||||||
|
|
||||||
|
if ( sscanf(params, ""#sscanf_u"d", pID, action ) )
|
||||||
|
return SendUsage( playerid, "/playaction [PLAYER_ID] [SPECIAL_ACTION]");
|
||||||
|
|
||||||
|
SetPlayerSpecialAction( pID, action );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:playanimation( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 && p_AccountID[ playerid ] != 819507 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
new pID;
|
||||||
|
new szAnimation[ 2 ][ 64 ];
|
||||||
|
new loop, lockx, locky, freeze, time, force_sync;
|
||||||
|
|
||||||
|
if ( sscanf(params, ""#sscanf_u"s[64]s[64]D(0)D(0)D(0)D(0)D(0)D(0)", pID, szAnimation[ 0 ], szAnimation[ 1 ], loop, lockx, locky, freeze, time, force_sync ) )
|
||||||
|
return SendUsage( playerid, "/playanimation [PLAYER_ID] [LIBRARY] [ANIM_NAME] [LOOP (0)] [LOCK_X (0)] [LOCK_Y (0)] [FREEZE (0)] [TIME (0)] [FORCE_SYNC (0)]" );
|
||||||
|
|
||||||
|
ApplyAnimation( pID, szAnimation[0], szAnimation[1], 4.1, loop, lockx, locky, freeze, time, force_sync );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) played animation %s %s on %s(%d)", ReturnPlayerName( playerid ), playerid, szAnimation[0], szAnimation[1], ReturnPlayerName( pID ), pID );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:updaterules( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
HTTP( 0, HTTP_GET, "files.sfcnr.com/en_rules.txt", "", "OnRulesHTTPResponse" );
|
||||||
|
SendServerMessage( playerid, "Rules should be updated now." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:truncate( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
bDebt,
|
||||||
|
szName[ 24 ];
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 6 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( sscanf( params, "ds[24]", bDebt, szName ) )
|
||||||
|
return SendUsage( playerid, "/truncate [DEBT (=1 OR 0)] [PLAYER_NAME]");
|
||||||
|
|
||||||
|
if ( bDebt != 0 && bDebt != 1 )
|
||||||
|
return SendError( playerid, "Debt value must be either 1 or 0." );
|
||||||
|
|
||||||
|
mysql_function_query( dbHandle, sprintf( "UPDATE `USERS` SET `CASH`=%d,`BANKMONEY`=0 WHERE `NAME`='%s' AND `ADMINLEVEL` < %d", bDebt ? -250000 : 0, mysql_escape( szName ), p_AdminLevel[ playerid ] ), true, "OnPlayerTruncateUser", "isi", playerid, szName, bDebt );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread OnPlayerTruncateUser( playerid, name[ ], debt )
|
||||||
|
{
|
||||||
|
if ( cache_affected_rows( ) )
|
||||||
|
{
|
||||||
|
AddFileLogLine( "log_admin.txt", sprintf( "[TRUNCATE] [%s] %s -> %s\r\n", getCurrentDate( ), ReturnPlayerName( playerid ), name ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has truncated %s's money", ReturnPlayerName( playerid ), playerid, name );
|
||||||
|
|
||||||
|
if ( debt ) {
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "truncate %s (with debt)", name );
|
||||||
|
return SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've truncated %s and issued them a 250K debt.", name );
|
||||||
|
} else {
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "truncate %s", name );
|
||||||
|
return SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]{FFFFFF} You've truncated %s.", name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SendError( playerid, "This user does not exist." );
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:weather( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 5 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
new
|
||||||
|
weatherid;
|
||||||
|
|
||||||
|
if ( sscanf( params, "d", weatherid ) )
|
||||||
|
return SendUsage( playerid, "/weather [WEATHER_ID]" );
|
||||||
|
|
||||||
|
g_WorldWeather = weatherid;
|
||||||
|
|
||||||
|
SaveToAdminLogFormatted( playerid, 0, "weather %d", weatherid );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has changed the weather to %d", ReturnPlayerName( playerid ), playerid, weatherid );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has changed the weather to %d!", ReturnPlayerName( playerid ), playerid, weatherid );
|
||||||
|
return 1;
|
||||||
|
}
|
568
gamemodes/irresistible/cnr/commands/admin/admin_three.pwn
Normal file
568
gamemodes/irresistible/cnr/commands/admin/admin_three.pwn
Normal file
@ -0,0 +1,568 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_three.pwn
|
||||||
|
* Purpose: level three administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:smlog( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/smlog [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szBigString, 160, "SELECT u.`NAME`,t.`CASH`,t.`DATE` FROM `TRANSACTIONS` t INNER JOIN `USERS` u ON t.`TO_ID`=u.`ID` WHERE FROM_ID=%d ORDER BY DATE DESC LIMIT 10", p_AccountID[ pID ] );
|
||||||
|
mysql_function_query( dbHandle, szBigString, true, "readmoneylog", "dd", playerid, pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:iclog( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/iclog [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szBigString, 160, "SELECT u.`NAME`,t.`IC`,t.`DATE` FROM `TRANSACTIONS_IC` t INNER JOIN `USERS` u ON t.`TO_ID`=u.`ID` WHERE FROM_ID=%d ORDER BY DATE DESC LIMIT 10", p_AccountID[ pID ] );
|
||||||
|
mysql_function_query( dbHandle, szBigString, true, "readiclog", "dd", playerid, pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:resetwep( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/resetwep [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ResetPlayerWeapons( pID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has reset %s(%d)'s weapons", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have reset %s(%d)'s weapons.", ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" Your weapons have been reset by %s(%d).", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:getip( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/getip [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_AdminLevel[ pID ] >= 5 || IsPlayerLorenc( pID ) ) return SendError( playerid, "I love this person so much that I wont give you his IP :)");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d): "COL_GREY"%s", ReturnPlayerName( pID ), pID, ReturnPlayerIP( pID ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:geolocate( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/geolocate [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsProxyEnabledForPlayer( pID ) ) return SendError( playerid, "The server has failed to fetch geographical data. Please use a 3rd party." );
|
||||||
|
else if ( p_AdminLevel[ pID ] >= 5 || IsPlayerLorenc( pID ) ) return SendError( playerid, "I love this person so much that I wont give you his geographical data! :)");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( playerid, COLOR_PINK, "[ADMIN]"COL_WHITE" %s(%d) is from %s (%s) [%s]", ReturnPlayerName( pID ), pID, GetPlayerCountryName( pID ), GetPlayerCountryCode( pID ), ReturnPlayerIP( pID ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:copwarn( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 32 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"S(No Reason)[32]", pID, reason ) ) return SendUsage( playerid, "/copwarn [PLAYER_ID] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_CopBanned{ pID } >= MAX_CLASS_BAN_WARNS ) return SendError( playerid, "This player is cop-banned." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminCommandPause[ pID ] > g_iTime )
|
||||||
|
return SendError( playerid, "You must wait %d seconds before using this admin command on the player.", p_AdminCommandPause[ pID ] - g_iTime );
|
||||||
|
|
||||||
|
p_AdminCommandPause[ pID ] = g_iTime + ADMIN_COMMAND_TIME;
|
||||||
|
|
||||||
|
new
|
||||||
|
iWarns = WarnPlayerClass( pID, .bArmy = false );
|
||||||
|
|
||||||
|
if ( iWarns >= MAX_CLASS_BAN_WARNS )
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has cop-banned %s(%d) [%d/" #MAX_CLASS_BAN_WARNS "]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iWarns );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has cop-banned %s(%d) due to excessive cop-warnings "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has cop-warned %s(%d) [%d/" #MAX_CLASS_BAN_WARNS "]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iWarns );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has cop-warned %s(%d) "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:armywarn( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 32 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"S(No Reason)[32]", pID, reason ) ) return SendUsage( playerid, "/armywarn [PLAYER_ID] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_ArmyBanned{ pID } >= MAX_CLASS_BAN_WARNS ) return SendError( playerid, "This player is army-banned." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminCommandPause[ pID ] > g_iTime )
|
||||||
|
return SendError( playerid, "You must wait %d seconds before using this admin command on the player.", p_AdminCommandPause[ pID ] - g_iTime );
|
||||||
|
|
||||||
|
p_AdminCommandPause[ pID ] = g_iTime + ADMIN_COMMAND_TIME;
|
||||||
|
|
||||||
|
new
|
||||||
|
iWarns = WarnPlayerClass( pID, .bArmy = true );
|
||||||
|
|
||||||
|
if ( iWarns >= MAX_CLASS_BAN_WARNS )
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has army-banned %s(%d) [%d/" #MAX_CLASS_BAN_WARNS "]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iWarns );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has army-banned %s(%d) due to excessive army-warnings "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has army-warned %s(%d) [%d/" #MAX_CLASS_BAN_WARNS "]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iWarns );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has army-warned %s(%d) "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:rcopwarn( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/rcopwarn [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !p_CopBanned{ pID } ) return SendError( playerid, "This player does not have any cop warns." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iWarns = WarnPlayerClass( pID, .bArmy = false, .iPoints = -1 );
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has removed a cop-warn from %s(%d) [%d/" #MAX_CLASS_BAN_WARNS "]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iWarns );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has removed a cop-warn from %s(%d)!", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:rarmywarn( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/rarmywarn [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !p_ArmyBanned{ pID } ) return SendError( playerid, "This player does not have any army warns." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new
|
||||||
|
iWarns = WarnPlayerClass( pID, .bArmy = true, .iPoints = -1 );
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has removed an army-warn from %s(%d) [%d/" #MAX_CLASS_BAN_WARNS "]", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, iWarns );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has removed an army-warn from %s(%d)!", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*CMD:forcecoptutorial( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) SendUsage( playerid, "/forcecoptutorial [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has forced you to view the law enforcement officer tutorial.", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have forced the law enforcement officer tutorial on %s(%d).", ReturnPlayerName( pID ), pID );
|
||||||
|
p_CopTutorial{ pID } = 0;
|
||||||
|
if ( p_Class[ pID ] == CLASS_POLICE ) SpawnPlayer( pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
CMD:ann( playerid, params[ ] ) return cmd_announce( playerid, params );
|
||||||
|
CMD:announce( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new Message[60];
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "s[60]", Message ) ) SendUsage(playerid, "/announce [MESSAGE]");
|
||||||
|
else if ( !IsSafeGameText( Message ) ) return SendError( playerid, "Your message is not safe for players to view." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameTextForAll( sprintf( "~w~%s", Message ), 6000, 3 );
|
||||||
|
printf( "[ANNOUNCEMENT]: %s(%d) has announced \"%s\"", ReturnPlayerName( playerid ), playerid, Message );
|
||||||
|
|
||||||
|
strreplacechar ( Message, '~', ']' );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has announced \"%s\"", ReturnPlayerName( playerid ), playerid, Message );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:aheal( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) SendUsage( playerid, "/aheal [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( IsPlayerJailed( pID ) ) return SendError( playerid, "This player is jailed, you cannot do this." );
|
||||||
|
else if ( IsPlayerAdminOnDuty( pID ) ) return SendError( playerid, "This player is an admin on duty, you cannot do this." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) healed you.", ReturnPlayerName( playerid ), playerid );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have healed %s(%d).", ReturnPlayerName( pID ), pID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has healed %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SetPlayerHealth( pID, 100.0 );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:healall( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has healed everybody", ReturnPlayerName( playerid ), playerid );
|
||||||
|
foreach(new i : Player) {
|
||||||
|
if ( !p_Jailed{ i } ) SetPlayerHealth( i, p_AdminOnDuty{ i } == true ? float( INVALID_PLAYER_ID ) : 100.0 );
|
||||||
|
}
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" Everyone has been healed by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vadminstats( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( !IsPlayerInAnyVehicle( playerid ) )
|
||||||
|
return SendError( playerid, "You are not in any vehicle." );
|
||||||
|
|
||||||
|
if ( g_buyableVehicle{ GetPlayerVehicleID( playerid ) } == false )
|
||||||
|
return SendError( playerid, "This vehicle isn't a buyable vehicle." );
|
||||||
|
|
||||||
|
new
|
||||||
|
ownerid, slotid,
|
||||||
|
v = getVehicleSlotFromID( GetPlayerVehicleID( playerid ), ownerid, slotid )
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( v == -1 ) return SendError( playerid, "This vehicle doesn't look like it can be examined. (0xAA)" );
|
||||||
|
if ( g_vehicleData[ ownerid ] [ slotid ] [ E_CREATED ] == false ) return SendError( playerid, "This vehicle doesn't look like it can be examined. (0xAF)" );
|
||||||
|
|
||||||
|
format( szBigString, sizeof( szBigString ), ""COL_GREY"Vehicle Owner:"COL_WHITE" %s\n"\
|
||||||
|
""COL_GREY"Vehicle Type:"COL_WHITE" %s\n"\
|
||||||
|
""COL_GREY"Vehicle ID:"COL_WHITE" %d\n"\
|
||||||
|
""COL_GREY"Vehicle Price:"COL_WHITE" %s",
|
||||||
|
ReturnPlayerName( ownerid ), GetVehicleName( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ),
|
||||||
|
g_vehicleData[ ownerid ] [ slotid ] [ E_SQL_ID ], number_format( g_vehicleData[ ownerid ] [ slotid ] [ E_PRICE ] ) );
|
||||||
|
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, "{FFFFFF}Vehicle Data", szBigString, "Okay", "" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vadminpark( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 )
|
||||||
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
|
||||||
|
if ( !IsPlayerInAnyVehicle( playerid ) )
|
||||||
|
return SendError( playerid, "You are not in any vehicle." );
|
||||||
|
|
||||||
|
if ( g_buyableVehicle{ GetPlayerVehicleID( playerid ) } == false )
|
||||||
|
return SendError( playerid, "This vehicle isn't a buyable vehicle." );
|
||||||
|
|
||||||
|
new
|
||||||
|
ownerid, slotid, vehicleid = GetPlayerVehicleID( playerid ),
|
||||||
|
v = getVehicleSlotFromID( vehicleid, ownerid, slotid ),
|
||||||
|
Float: X, Float: Y, Float: Z, Float: Angle
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( v == -1 ) return SendError( playerid, "This vehicle doesn't look like it can be parked. (0xAA)" );
|
||||||
|
if ( g_vehicleData[ ownerid ] [ slotid ] [ E_CREATED ] == false ) return SendError( playerid, "This vehicle doesn't look like it can be parked. (0xAF)" );
|
||||||
|
|
||||||
|
new
|
||||||
|
iBreach = PlayerBreachedGarageLimit( playerid, v, .admin_place = true );
|
||||||
|
|
||||||
|
if ( iBreach == -1 ) return SendError( playerid, "You cannot park vehicles that are not owned by the owner of this garage." );
|
||||||
|
if ( iBreach == -2 ) return SendError( playerid, "This garage has already reached its capacity of %d vehicles.", g_garageInteriorData[ g_garageData[ p_InGarage[ playerid ] ] [ E_INTERIOR_ID ] ] [ E_VEHICLE_CAPACITY ] );
|
||||||
|
|
||||||
|
GetVehiclePos( vehicleid, X, Y, Z );
|
||||||
|
GetVehicleZAngle( vehicleid, Angle );
|
||||||
|
|
||||||
|
g_vehicleData[ ownerid ] [ slotid ] [ E_X ] = X, g_vehicleData[ ownerid ] [ slotid ] [ E_Y ] = Y, g_vehicleData[ ownerid ] [ slotid ] [ E_Z ] = Z, g_vehicleData[ ownerid ] [ slotid ] [ E_ANGLE ] = Angle;
|
||||||
|
|
||||||
|
PutPlayerInVehicle( playerid, RespawnBuyableVehicle( vehicleid, playerid ), 0 );
|
||||||
|
SaveVehicleData( ownerid, slotid );
|
||||||
|
|
||||||
|
SendClientMessage( playerid, -1, ""COL_GREY"[VEHICLE]"COL_WHITE" You have parked this vehicle via administration." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:givewep( playerid, params[ ] ) return cmd_giveweapon( playerid, params );
|
||||||
|
CMD:giveweapon( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
wep,
|
||||||
|
ammo,
|
||||||
|
gunname[ 32 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"dd", pID, wep, ammo ) ) return SendUsage(playerid, "/giveweapon [PLAYER_ID] [WEAPON_ID] [AMMO]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !( 0 <= wep < MAX_WEAPONS ) || wep == 47 ) return SendError(playerid, "Invalid weapon id");
|
||||||
|
else if ( IsWeaponBanned( wep ) && p_AdminLevel[ pID ] < 5 ) return SendError( playerid, "This weapon is a banned weapon, you cannot spawn this." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//printf("%s banned wep %d - admin level %d", ReturnPlayerName( pID ), wep, p_AdminLevel[ playerid ]);
|
||||||
|
GetWeaponName( wep, gunname, sizeof( gunname ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has given %s(%d) a %s", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, gunname );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have given %s(%d) a %s(%d)", ReturnPlayerName( pID ), pID, gunname, wep );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been given a %s from %s(%d)", gunname, ReturnPlayerName( playerid ), playerid );
|
||||||
|
GivePlayerWeapon( pID, wep, ammo );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:cc( playerid, params[ ] ) return cmd_clearchat( playerid, params );
|
||||||
|
CMD:clearchat( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
for( new i = 0; i < 50; i++ ) {
|
||||||
|
SendClientMessageToAll( -1, " " );
|
||||||
|
}
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s cleared the chat.", ReturnPlayerName( playerid ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has cleared the chat", ReturnPlayerName( playerid ), playerid );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vbring( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new vID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", vID ) ) return SendUsage( playerid, "/vbring [VEHICLE_ID]" );
|
||||||
|
else if ( !IsValidVehicle( vID ) ) return SendError( playerid, "Invalid Vehicle ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new Float: X, Float: Y, Float: Z;
|
||||||
|
GetPlayerPos( playerid, X, Y, Z );
|
||||||
|
LinkVehicleToInterior( vID, GetPlayerInterior( playerid ) );
|
||||||
|
SetVehicleVirtualWorld( vID, GetPlayerVirtualWorld( playerid ) );
|
||||||
|
SetVehiclePos( vID, X + 1, Y + 1, Z );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have brought vehicle id %d to you.", vID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has brought vehicle id %d to them", ReturnPlayerName( playerid ), playerid, vID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vgoto( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new vID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", vID ) ) return SendUsage( playerid, "/vgoto [VEHICLE_ID]" );
|
||||||
|
else if ( !IsValidVehicle( vID ) ) return SendError( playerid, "Invalid Vehicle ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new Float: X, Float: Y, Float: Z;
|
||||||
|
GetVehiclePos( vID, X, Y, Z );
|
||||||
|
SetPlayerPos( playerid, X + 1, Y + 1, Z );
|
||||||
|
SetPlayerInterior( playerid, 0 );
|
||||||
|
SetPlayerVirtualWorld( playerid, 0 );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have gone to vehicle id %d.", vID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has gone to vehicle id %d", ReturnPlayerName( playerid ), playerid, vID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:venter( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new vID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", vID ) ) return SendUsage( playerid, "/venter [VEHICLE_ID]" );
|
||||||
|
else if ( !IsValidVehicle( vID ) ) return SendError( playerid, "Invalid Vehicle ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Maybe virtual world support
|
||||||
|
SetPlayerVirtualWorld( playerid, GetVehicleVirtualWorld( vID ) );
|
||||||
|
PutPlayerInVehicle( playerid, vID, 0 );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have entered the vehicle id %d.", vID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has entered the vehicle id %d", ReturnPlayerName( playerid ), playerid, vID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vforce( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID, vID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"d", pID, vID ) ) return SendUsage( playerid, "/vforce [PLAYER_ID] [VEHICLE_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( !IsValidVehicle( vID ) ) return SendError( playerid, "Invalid Vehicle ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Maybe virtual world support
|
||||||
|
SetPlayerVirtualWorld( pID, GetVehicleVirtualWorld( vID ) );
|
||||||
|
PutPlayerInVehicle( pID, vID, 0 );
|
||||||
|
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have forced %s(%d) to enter the vehicle id %d.", ReturnPlayerName( pID ), pID, vID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has forced %s to enter the vehicle id %d.", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), vID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:hgoto( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new hID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", hID ) ) return SendUsage( playerid, "/hgoto [HOUSE_ID]" );
|
||||||
|
else if ( hID < 0 || hID >= MAX_HOUSES ) return SendError( playerid, "Invalid House ID." );
|
||||||
|
else if ( ! Iter_Contains( houses, hID ) ) return SendError( playerid, "Invalid House ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerPos( playerid, g_houseData[ hID ] [ E_EX ], g_houseData[ hID ] [ E_EY ], g_houseData[ hID ] [ E_EZ ] );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have went to house id %d.", hID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has went to house id %d", ReturnPlayerName( playerid ), playerid, hID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:bgoto( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new bID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", bID ) ) return SendUsage( playerid, "/bgoto [BUSINESS_ID]" );
|
||||||
|
else if ( bID < 0 || bID >= MAX_BUSINESSES ) return SendError( playerid, "Invalid Business ID." );
|
||||||
|
else if ( ! Iter_Contains( business, bID ) ) return SendError( playerid, "Invalid Business ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerPos( playerid, g_businessData[ bID ] [ E_X ], g_businessData[ bID ] [ E_Y ], g_businessData[ bID ] [ E_Z ] );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have went to business id %d.", bID );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has went to business id %d", ReturnPlayerName( playerid ), playerid, bID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:cd( playerid, params[ ] ) return cmd_countdown( playerid, params );
|
||||||
|
CMD:countdown( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new seconds;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", seconds ) ) return SendUsage( playerid, "/countdown [SECONDS]" );
|
||||||
|
else if ( seconds < 0 || seconds > 30 ) return SendError( playerid, "Please specify a time between 0 and 30 seconds." );
|
||||||
|
else if ( g_circleall_CD ) return SendError( playerid, "Countdown is already in progress." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_circleall_CD = true;
|
||||||
|
SetTimerEx( "circleall_Countdown", 960, false, "dd", seconds, 1 );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has initiated a countdown starting from %d.", ReturnPlayerName( playerid ), playerid, seconds );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has initiated a countdown from %d", ReturnPlayerName( playerid ), playerid, seconds );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:pingimmune( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/pingimmune [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected(pID) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_AdminLevel[ pID ] > 0 ) return SendError( playerid, "Admins already have immunity." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p_PingImmunity{ pID } = ( p_PingImmunity{ pID } == 0 ? 1 : 0 );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has made %s(%d) %s to the ping kicker.", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, p_PingImmunity{ pID } == 0 ? ("prone") : ("immune") );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has made %s(%d) %s to the ping kicker", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, p_PingImmunity{ pID } == 0 ? ("prone") : ("immune") );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:ban( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 50 ]
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"S(No Reason)[50]", pID, reason ) ) return SendUsage( playerid, "/ban [PLAYER_ID] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
// else if ( pID == playerid ) return SendError( playerid, "You cannot ban yourself." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
adhereBanCodes( reason );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has banned %s(%d) "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, reason );
|
||||||
|
AdvancedBan( pID, ReturnPlayerName( playerid ), reason, ReturnPlayerIP( pID ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:bring( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
Float: X,
|
||||||
|
Float: Y,
|
||||||
|
Float: Z
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/bring [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected(pID) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError(playerid, "You cannot bring your self.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*if ( IsPlayerInAnyVehicle( playerid ) ) {
|
||||||
|
if ( PutPlayerInEmptyVehicleSeat( GetPlayerVehicleID( playerid ), pID ) )
|
||||||
|
return 1;
|
||||||
|
}*/
|
||||||
|
GetPlayerPos( playerid, X, Y, Z );
|
||||||
|
SetPlayerPos( pID, X, Y + 2, Z );
|
||||||
|
SetPlayerInterior( pID, GetPlayerInterior( playerid ) );
|
||||||
|
SetPlayerVirtualWorld( pID, GetPlayerVirtualWorld( playerid ) );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has brought %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
if ( p_InHouse[ pID ] != -1 ) p_InHouse[ pID ] = -1;
|
||||||
|
if ( p_InGarage[ pID ] != -1 ) p_InGarage[ pID ] = -1;
|
||||||
|
if ( p_inPaintBall{ pID } ) LeavePlayerPaintball( pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
234
gamemodes/irresistible/cnr/commands/admin/admin_two.pwn
Normal file
234
gamemodes/irresistible/cnr/commands/admin/admin_two.pwn
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/commands/admin/admin_two.pwn
|
||||||
|
* Purpose: level two administrator commands (cnr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Commands ** */
|
||||||
|
CMD:slay( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID ) ) return SendUsage( playerid, "/slay [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( p_PlayerLogged{ pID } == false ) return SendError( playerid, "This player is not logged in." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPlayerHealth( pID, -1 );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has slain %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have slain %s(%d)!", ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been slain by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:viewnotes( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, #sscanf_u, pID ) ) return SendUsage( playerid, "/viewnotes [PLAYER_ID]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format( szNormalString, 96, "SELECT `ID`,`TIME`,`NOTE`,`DELETED` FROM `NOTES` WHERE `USER_ID`=%d AND DELETED IS NULL", p_AccountID[ pID ] );
|
||||||
|
mysql_function_query( dbHandle, szNormalString, true, "readplayernotes", "d", playerid );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:suspend( playerid, params [ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 50 ],
|
||||||
|
hours, days
|
||||||
|
;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"ddS(No Reason)[50]", pID, hours, days, reason ) ) SendUsage( playerid, "/suspend [PLAYER_ID] [HOURS] [DAYS] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( hours < 0 || hours > 24 ) return SendError( playerid, "Please specify an hour between 0 and 24." );
|
||||||
|
else if ( days < 0 || days > 60 ) return SendError( playerid, "Please specifiy the amount of days between 0 and 60." );
|
||||||
|
else if ( days == 0 && hours == 0 ) return SendError( playerid, "Invalid time specified." );
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cannot suspend yourself." );
|
||||||
|
else if ( p_AdminLevel[ playerid ] < p_AdminLevel[ pID ] ) return SendError( playerid, "This player has a higher administration level than you." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
adhereBanCodes( reason );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has suspended %s(%d) for %d h %d d", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, hours, days );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has suspended %s(%d) for %d hour(s) and %d day(s) "COL_GREEN"[REASON: %s]", ReturnPlayerName( playerid ), ReturnPlayerName( pID ), pID, hours, days, reason );
|
||||||
|
//GetPlayerIp( pID, ip, sizeof( ip ) );
|
||||||
|
new time = g_iTime + ( hours * 3600 ) + ( days * 86400 );
|
||||||
|
AdvancedBan( pID, ReturnPlayerName( playerid ), reason, ReturnPlayerIP( pID ), time );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:arenas( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
ShowPlayerDialog( playerid, DIALOG_ARENAS, DIALOG_STYLE_LIST, "{FFFFFF}Arena Selection", "Warehouse 1\nWarehouse 2\nBloodbowl\n8-Track\nRC Battlefield\nBar\nCrack Factory\nLiberty City Inside\nLV Warehouse\nKickstart\nDirt Track\nDodge The Plane", "Select", "Cancel" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:explode( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID, Float: offset;
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if (sscanf( params, ""#sscanf_u"F(0.0)", pID, offset)) SendUsage(playerid, "/explode [PLAYER_ID] [VEHICLE OFFSET (= 0.0)]");
|
||||||
|
else if ( !IsPlayerConnected(pID) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError(playerid, "You cannot use this command on admins higher than your level.");
|
||||||
|
else {
|
||||||
|
new Float: X, Float: Y, Float: Z;
|
||||||
|
GetPlayerPos( pID, X, Y, Z );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has exploded %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have exploded %s(%d)", ReturnPlayerName( pID ), pID );
|
||||||
|
|
||||||
|
if ( IsPlayerInAnyVehicle( pID ) )
|
||||||
|
{
|
||||||
|
new Float: Angle;
|
||||||
|
GetVehicleZAngle( GetPlayerVehicleID( pID ), Angle );
|
||||||
|
X += ( offset * floatsin( -Angle, degrees ) );
|
||||||
|
Y += ( offset * floatcos( -Angle, degrees ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateExplosion( X, Y, Z, 12, 10.0 );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vrespawn( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
vID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", vID ) )
|
||||||
|
{
|
||||||
|
if ( ( vID = GetPlayerVehicleID( playerid ) ) != 0 ) {
|
||||||
|
SetVehicleToRespawn( vID );
|
||||||
|
return SendServerMessage( playerid, "You have respawned your vehicle." );
|
||||||
|
}
|
||||||
|
return SendUsage( playerid, "/vrespawn [VEHICLE_ID]" );
|
||||||
|
}
|
||||||
|
else if ( !IsValidVehicle( vID ) ) return SendError( playerid, "Invalid Vehicle ID" );
|
||||||
|
else if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetVehicleToRespawn( vID );
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have set the vehicle ID %d to respawn.", vID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:vdestroy( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
vID
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, "d", vID ) )
|
||||||
|
{
|
||||||
|
if ( GetPlayerSpecialAction( playerid ) == SPECIAL_ACTION_USEJETPACK )
|
||||||
|
{
|
||||||
|
SetPlayerSpecialAction( playerid, SPECIAL_ACTION_NONE );
|
||||||
|
return SendServerMessage( playerid, "You have destroyed the jetpack you were using." );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You're not in any vehicle." );
|
||||||
|
vID = GetPlayerVehicleID( playerid );
|
||||||
|
if ( IsBuyableVehicle( vID ) ) return SendError( playerid, "You cannot use this command to destroy buyable vehicles." );
|
||||||
|
if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
|
||||||
|
if ( g_TrolleyVehicles[ 0 ] == vID || g_TrolleyVehicles[ 1 ] == vID || g_TrolleyVehicles[ 2 ] == vID || g_TrolleyVehicles[ 3 ] == vID || g_TrolleyVehicles[ 4 ] == vID ) return SendError( playerid, "This vehicle is prohibited." );
|
||||||
|
DestroyVehicle( vID );
|
||||||
|
if ( g_adminSpawnedCar{ vID } ) g_adminSpawnedCar{ vID } = false;
|
||||||
|
SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have destroyed the vehicle you were using." );
|
||||||
|
printf( "[DESTROY VEHICLE] %s has destroyed a %d (id %d) - ADMIN: %s", ReturnPlayerName( playerid ), GetVehicleModel( vID ), vID, g_adminSpawnedCar{ vID } == true ? ( "true" ) : ( "false" ) );
|
||||||
|
}
|
||||||
|
else if ( !IsValidVehicle( vID ) ) return SendError( playerid, "Invalid Vehicle ID" );
|
||||||
|
else if ( IsBuyableVehicle( vID ) ) return SendError( playerid, "You cannot use this command to destroy buyable vehicles." );
|
||||||
|
else if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
|
||||||
|
else if ( g_TrolleyVehicles[ 0 ] == vID || g_TrolleyVehicles[ 1 ] == vID || g_TrolleyVehicles[ 2 ] == vID || g_TrolleyVehicles[ 3 ] == vID || g_TrolleyVehicles[ 4 ] == vID ) return SendError( playerid, "This vehicle is prohibited." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DestroyVehicle( vID );
|
||||||
|
if ( g_adminSpawnedCar{ vID } ) g_adminSpawnedCar{ vID } = false;
|
||||||
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have destroyed the vehicle ID %d.", vID );
|
||||||
|
printf( "[DESTROY VEHICLE] %s has destroyed a %d (id %d) - ADMIN: %s", ReturnPlayerName( playerid ), GetVehicleModel( vID ), vID, g_adminSpawnedCar{ vID } == true ? ( "true" ) : ( "false" ) );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:mute( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID, seconds, reason[ 32 ];
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"dS(No Reason)[32]", pID, seconds, reason ) ) return SendUsage(playerid, "/mute [PLAYER_ID] [SECONDS] [REASON]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError(playerid, "You cannot mute yourself.");
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError(playerid, "You cannot use this command on admins higher than your level.");
|
||||||
|
else if ( seconds < 0 || seconds > 10000000 ) return SendError( playerid, "Specify the amount of seconds from 1 - 10000000." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( p_AdminCommandPause[ pID ] > g_iTime )
|
||||||
|
return SendError( playerid, "You must wait %d seconds before using this admin command on the player.", p_AdminCommandPause[ pID ] - g_iTime );
|
||||||
|
|
||||||
|
p_AdminCommandPause[ pID ] = g_iTime + ADMIN_COMMAND_TIME;
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has muted %s(%d) for %d seconds", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID, seconds );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has been muted by %s for %d seconds "COL_GREEN"[REASON: %s]", ReturnPlayerName( pID ), ReturnPlayerName( playerid ), seconds, reason );
|
||||||
|
GameTextForPlayer( pID, "~r~Muted!", 4000, 4 );
|
||||||
|
p_Muted{ pID } = true;
|
||||||
|
p_MutedTime[ pID ] = g_iTime + seconds;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:unmute( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new pID;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"", pID )) SendUsage(playerid, "/mute [PLAYER_ID]");
|
||||||
|
else if ( !IsPlayerConnected( pID ) ) return SendError(playerid, "Invalid Player ID.");
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cannot un-mute yourself." );
|
||||||
|
else if ( !p_Muted{ pID } ) return SendError( playerid, "This player isn't muted" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has un-muted %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has been un-muted by %s.", ReturnPlayerName(pID), ReturnPlayerName( playerid ));
|
||||||
|
GameTextForPlayer( pID, "~g~Un-Muted!", 4000, 4 );
|
||||||
|
p_Muted{ pID } = false;
|
||||||
|
p_MutedTime[ pID ] = 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD:kick( playerid, params[ ] )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
pID,
|
||||||
|
reason[ 70 ]
|
||||||
|
;
|
||||||
|
|
||||||
|
if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
|
else if ( sscanf( params, ""#sscanf_u"S(No reason)[70]", pID, reason ) ) SendUsage( playerid, "/kick [PLAYER_ID] [REASON]" );
|
||||||
|
else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
|
||||||
|
else if ( pID == playerid ) return SendError( playerid, "You cant kick yourself." );
|
||||||
|
else if ( p_AdminLevel[ pID ] > p_AdminLevel[ playerid ] ) return SendError( playerid, "You cannot use this command on admins higher than your level." );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
adhereBanCodes( reason );
|
||||||
|
AddAdminLogLineFormatted( "%s(%d) has kicked %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
|
||||||
|
SendGlobalMessage( -1, ""COL_PINK"[ADMIN]{FFFFFF} %s has been kicked by %s. "COL_GREEN"[REASON: %s]", ReturnPlayerName(pID), ReturnPlayerName( playerid ), reason);
|
||||||
|
KickPlayerTimed( pID );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
69
gamemodes/irresistible/cnr/textdraws.pwn
Normal file
69
gamemodes/irresistible/cnr/textdraws.pwn
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module: cnr/textrdraws
|
||||||
|
* Purpose:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MAX_MACHINES 54 // Placed top because of textdraws (TEMPORARY / HOTFIX)
|
||||||
|
|
||||||
|
/* ** Variables ** */
|
||||||
|
new Text: g_classTextdrawBox[ sizeof( CLASS_NAMES ) ] = { Text: INVALID_TEXT_DRAW, ... };
|
||||||
|
new Text: g_classTextdrawDescription[ sizeof( CLASS_NAMES ) ] = { Text: INVALID_TEXT_DRAW, ... };
|
||||||
|
new Text: g_classTextdrawName[ sizeof( CLASS_NAMES ) ] = { Text: INVALID_TEXT_DRAW, ... };
|
||||||
|
|
||||||
|
new
|
||||||
|
Text: g_ClassBoxTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_ObjectLoadTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_WebsiteTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_MotdTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_MovieModeTD [ 6 ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: g_WorldDayTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_AchievementTD [ 4 ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: g_AnimationTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_AdminLogTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_ProgressBoxTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_AdminOnDutyTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_VehiclePreviewBoxTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_VehiclePreviewTxtTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: p_VehiclePreviewCloseTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_DoubleXPTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_currentXPTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_CurrentRankTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_CurrentCoinsTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_SlotMachineOneTD [ MAX_MACHINES ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: g_SlotMachineTwoTD [ MAX_MACHINES ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_SlotMachineFigureTD [ MAX_MACHINES ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: g_SlotMachineThreeTD [ MAX_MACHINES ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: g_SlotMachineBoxTD [ 2 ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: g_TopDonorTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
Text: g_NotManyPlayersTD = Text: INVALID_TEXT_DRAW,
|
||||||
|
|
||||||
|
// Server Player Textdraws (Needs Converting)
|
||||||
|
Text: p_TrackPlayerTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_FireDistance1 [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_FireDistance2 [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_AchievementTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_GPSInformation [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_ProgressBoxOutsideTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_ProgressBoxTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_ProgressTitleTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_HelpBoxTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
Text: p_TruckingTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
|
|
||||||
|
// Player Textdraws
|
||||||
|
PlayerText: p_LocationTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_ExperienceTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_ExperienceAwardTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_WantedLevelTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_CoinsTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_PlayerRankTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_PlayerRankTextTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_RobberyAmountTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_RobberyRiskTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_DamageTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: p_JailTimeTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
PlayerText: g_ZoneOwnerTD [ MAX_PLAYERS ] = { PlayerText: INVALID_TEXT_DRAW, ... },
|
||||||
|
|
||||||
|
PlayerText: p_VehiclePreviewTD [ 7 ] = { PlayerText: INVALID_TEXT_DRAW, ... }
|
||||||
|
;
|
10
gamemodes/irresistible/config/_config.pwn
Normal file
10
gamemodes/irresistible/config/_config.pwn
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2018
|
||||||
|
* Developed by Lorenc Pekaj
|
||||||
|
* Module:
|
||||||
|
* Purpose:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Includes ** */
|
||||||
|
#include "irresistible\config\database.pwn" // keep #1
|
||||||
|
#include "irresistible\config\colors.pwn"
|
@ -8,9 +8,6 @@
|
|||||||
/* ** Includes ** */
|
/* ** Includes ** */
|
||||||
#include < YSI\y_hooks >
|
#include < YSI\y_hooks >
|
||||||
|
|
||||||
/* ** Defines ** */
|
|
||||||
#define GetPlayerFPS(%1) p_FPS[%1]
|
|
||||||
|
|
||||||
/* ** Variables ** */
|
/* ** Variables ** */
|
||||||
new
|
new
|
||||||
Text: p_FPSCounterTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
Text: p_FPSCounterTD [ MAX_PLAYERS ] = { Text: INVALID_TEXT_DRAW, ... },
|
||||||
@ -58,10 +55,29 @@ CMD:drawdistance( playerid, params[ ] )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ** Hooks ** */
|
||||||
|
hook OnScriptInit( )
|
||||||
|
{
|
||||||
|
for ( new playerid; playerid != MAX_PLAYERS; playerid ++ )
|
||||||
|
{
|
||||||
|
p_FPSCounterTD[ playerid ] = TextDrawCreate(636.000000, 2.000000, "_");
|
||||||
|
TextDrawAlignment(p_FPSCounterTD[ playerid ], 3);
|
||||||
|
TextDrawBackgroundColor(p_FPSCounterTD[ playerid ], 255);
|
||||||
|
TextDrawFont(p_FPSCounterTD[ playerid ], 3);
|
||||||
|
TextDrawLetterSize(p_FPSCounterTD[ playerid ], 0.300000, 1.500000);
|
||||||
|
TextDrawColor(p_FPSCounterTD[ playerid ], -1);
|
||||||
|
TextDrawSetOutline(p_FPSCounterTD[ playerid ], 1);
|
||||||
|
TextDrawSetProportional(p_FPSCounterTD[ playerid ], 1);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* ** Functions ** */
|
/* ** Functions ** */
|
||||||
stock formatFPSCounter( playerid ) {
|
stock formatFPSCounter( playerid )
|
||||||
if( !p_FPSCounter{ playerid } )
|
{
|
||||||
|
if( !p_FPSCounter{ playerid } ) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
iFPS,
|
iFPS,
|
||||||
@ -80,18 +96,6 @@ stock formatFPSCounter( playerid ) {
|
|||||||
TextDrawSetString( p_FPSCounterTD[ playerid ], szFPS );
|
TextDrawSetString( p_FPSCounterTD[ playerid ], szFPS );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ** Hooks ** */
|
stock GetPlayerFPS( playerid ) {
|
||||||
hook InitializeTextDraws( )
|
return p_FPS[ playerid ];
|
||||||
{
|
|
||||||
for(new playerid; playerid != MAX_PLAYERS; playerid ++)
|
|
||||||
{
|
|
||||||
p_FPSCounterTD[ playerid ] = TextDrawCreate(636.000000, 2.000000, "_");
|
|
||||||
TextDrawAlignment(p_FPSCounterTD[ playerid ], 3);
|
|
||||||
TextDrawBackgroundColor(p_FPSCounterTD[ playerid ], 255);
|
|
||||||
TextDrawFont(p_FPSCounterTD[ playerid ], 3);
|
|
||||||
TextDrawLetterSize(p_FPSCounterTD[ playerid ], 0.300000, 1.500000);
|
|
||||||
TextDrawColor(p_FPSCounterTD[ playerid ], -1);
|
|
||||||
TextDrawSetOutline(p_FPSCounterTD[ playerid ], 1);
|
|
||||||
TextDrawSetProportional(p_FPSCounterTD[ playerid ], 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
3704
gamemodes/sf-cnr.pwn
3704
gamemodes/sf-cnr.pwn
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user