diff --git a/gamemodes/irresistible/cnr/auth/account.pwn b/gamemodes/irresistible/cnr/auth/account.pwn index ec63404..ad59eb0 100644 --- a/gamemodes/irresistible/cnr/auth/account.pwn +++ b/gamemodes/irresistible/cnr/auth/account.pwn @@ -315,6 +315,10 @@ thread OnAttemptPlayerLogin( playerid, password[ ] ) // Log in player SendServerMessage( playerid, "You have " COL_GREEN "successfully" COL_WHITE " logged in!" ); + + // Chat Ban Player + format( szBigString, sizeof( szBigString ), "SELECT * FROM `CHAT_BANS` WHERE `ID` = '%d' LIMIT 0,1", p_AccountID[ playerid ] ); + mysql_function_query( dbHandle, szBigString, true, "ChatBanUponLogin", "d", playerid ); } else { diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index 68c1e89..d4c6574 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -72,11 +72,13 @@ static stock { 2, "/mute", "Muting a player" }, { 2, "/unmute", "Unmuting a player" }, { 2, "/kick", "Kicking a player from the server" }, + { 2, "/smlog", "Cash transaction log from a player" }, + { 2, "/iclog", "IC transaction log from a player" }, /* ** Level 3 Commands ** */ + { 3, "/chatban", "Bans a player from using all forms of chat" }, + { 3, "/unchatban", "Unbans a player from using all forms of chat" }, { 3, "/banlog", "Finding ban information about a player" }, - { 3, "/smlog", "Cash transaction log from a player" }, - { 3, "/iclog", "IC transaction log from a player" }, { 3, "/resetwep", "Resetting weapons from a player" }, { 3, "/getip", "Getting IP of a player" }, { 3, "/geolocate", "Geographical location of a player" }, @@ -105,6 +107,7 @@ static stock { 3, "/countdown", "Countdown" }, { 3, "/pingimmune", "Making a player immune from ping kicker" }, { 3, "/ban", "Banning a player" }, + { 3, "/forceac", "Force a player to use CAC while playing the server" }, { 3, "/bring", "Bring a player to you" }, /* ** Level 4 Commands ** */ @@ -260,34 +263,6 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) return 1; } -/*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, /reconnectchuff" ); - - 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" diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn index 7c0ae98..e7d751c 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn @@ -714,3 +714,31 @@ CMD:mutelist( playerid, params[ ] ) else return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Muted List", szNormalString, "Close", "" ), 1; } + +CMD:chatbanlist( playerid, params[ ] ) +{ + new + count = 0; + + if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + + szNormalString[ 0 ] = '\0'; + foreach( new i : Player ) + { + if ( p_ChatBanned{ i } ) + { + format( szNormalString, sizeof( szNormalString ), "%s"COL_WHITE"%s(%d)\t"COL_GREY"By %s for '%s'\n", + szNormalString, + ReturnPlayerName( i ), i, + p_ChatBannedBy[ playerid ], + p_ChatBanReason[ playerid ] + ); + + count ++; + } + } + if ( count == 0 ) + return SendError( playerid, "There are no chat banned players online." ); + else + return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Chat Ban List", szNormalString, "Close", "" ), 1; +} \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn index e01717f..317db5a 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_three.pwn @@ -6,40 +6,6 @@ */ /* ** Commands ** */ -CMD:smlog( playerid, params[ ] ) -{ - new - pID - ; - - if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "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, "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 @@ -622,9 +588,9 @@ CMD:forceac( playerid, params[ ] ) pID; if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); - else if ( sscanf( params, "u", pID ) ) SendUsage( playerid, "/forceac [PLAYER_ID]" ); + else if ( sscanf( params, "u", pID ) ) return 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 use this command on yourself." ); + else if ( pID == playerid ) return SendError( playerid, "You can't use this command on 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 @@ -643,4 +609,77 @@ CMD:forceac( playerid, params[ ] ) } } return 1; +} + +CMD:chatban( playerid, params[ ] ) +{ + + new pID, reason[ 25 ]; + + if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "us[50]", pID, reason ) ) return SendUsage( playerid, "/chatban [PLAYER_ID] [REASON]" ); + else if ( strlen( reason ) < 3 || strlen( reason ) > 25 ) return SendError( playerid, "Please keep your chat ban reason between 3 - 25 characters." ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( pID == playerid ) return SendError( playerid, "You can't use this command on 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 ( IsPlayerChatBanned( pID ) ) return SendError( playerid, "This player is already chat banned." ); + else + { + p_ChatBanned{ pID } = true; + p_ChatBannedBy[ pID ] = ReturnPlayerName( playerid ); + p_ChatBanReason[ pID ] = reason; + mysql_single_query( sprintf( "INSERT INTO `CHAT_BANS` (`ID`, `NAME`, `BANNED_BY_ID`, `BANNED_BY`, `REASON`) VALUES (%d, '%s', %d, '%s', '%s')", p_AccountID[ pID ], mysql_escape( ReturnPlayerName( pID ) ), p_AccountID[ playerid ], mysql_escape( ReturnPlayerName( playerid ) ), mysql_escape( reason ) ) ); + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat banned by %s for '%s'.", ReturnPlayerName( playerid ), reason ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat banned %s for '%s'.", ReturnPlayerName( pID ), reason ); + AddAdminLogLineFormatted( "%s(%d) has chat banned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + SaveToAdminLog( playerid, p_AccountID[ pID ], "chat ban" ); + } + + return 1; +} + +CMD:unchatban( playerid, params[ ] ) +{ + + new pID; + + if ( p_AdminLevel[ playerid ] < 3 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/chatban [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( pID == playerid ) return SendError( playerid, "You can't use this command on yourself." ); + else if ( !IsPlayerChatBanned( pID ) ) return SendError( playerid, "This player is not chat banned." ); + else + { + p_ChatBanned{ pID } = false; + mysql_single_query( sprintf( "DELETE FROM `CHAT_BANS` WHERE `ID`=%d", p_AccountID[ pID ] ) ); + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have been chat unbanned by %s.", ReturnPlayerName( pID ) ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have chat unbanned %s.", ReturnPlayerName( pID ) ); + AddAdminLogLineFormatted( "%s(%d) has chat unbanned %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + SaveToAdminLog( playerid, p_AccountID[ pID ], "chat unban" ); + } + + return 1; + +} + +thread ChatBanUponLogin( playerid ) +{ + new + rows, fields + ; + cache_get_data( rows, fields ); + + if ( rows ) + { + new banned_by[ MAX_PLAYER_NAME ], reason[ 25 ]; + + cache_get_field_content( 0, "BANNED_BY", banned_by ); + cache_get_field_content( 0, "REASON", reason ); + + p_ChatBanned{ playerid } = true; + p_ChatBannedBy[ playerid ] = banned_by; + p_ChatBanReason[ playerid ] = reason; + print("done with chatbanuponlogin"); + } + return 1; } \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn index 5921793..715fbcd 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_two.pwn @@ -6,6 +6,40 @@ */ /* ** Commands ** */ +CMD:smlog( playerid, params[ ] ) +{ + new + pID + ; + + if ( p_AdminLevel[ playerid ] < 2 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "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, "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:slay( playerid, params[ ] ) { new diff --git a/gamemodes/irresistible/cnr/commands/cmd_help.pwn b/gamemodes/irresistible/cnr/commands/cmd_help.pwn index b103d51..5526263 100644 --- a/gamemodes/irresistible/cnr/commands/cmd_help.pwn +++ b/gamemodes/irresistible/cnr/commands/cmd_help.pwn @@ -58,7 +58,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) return cmd_help( playerid, "" ); if ( listitem >= 64 ) - return SendError( playerid, "Unable to process request, contact Lorenc in regards to this." ); + return SendError( playerid, "Unable to process request, contact Damen in regards to this." ); new digits[ 64 ]; diff --git a/gamemodes/irresistible/cnr/discord/discord_commands.pwn b/gamemodes/irresistible/cnr/discord/discord_commands.pwn index 748c5de..005aa28 100644 --- a/gamemodes/irresistible/cnr/discord/discord_commands.pwn +++ b/gamemodes/irresistible/cnr/discord/discord_commands.pwn @@ -452,4 +452,10 @@ DQCMD:rcon( DCC_Channel: channel, DCC_User: user, params[ ] ) } } return 1; +} + +/* ** In-Game Discord Commands * **/ +CMD:discord( playerid, params[ ] ) +{ + return SendServerMessage( playerid, "You can access our Discord server at {7289da}sfcnr.com/discord" ); } \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/cop/_cop.pwn b/gamemodes/irresistible/cnr/features/cop/_cop.pwn index ab2b9d4..53379cc 100644 --- a/gamemodes/irresistible/cnr/features/cop/_cop.pwn +++ b/gamemodes/irresistible/cnr/features/cop/_cop.pwn @@ -11,3 +11,19 @@ #include "irresistible\cnr\features\cop\arrest.pwn" #include "irresistible\cnr\features\cop\bail.pwn" #include "irresistible\cnr\features\cop\ticket.pwn" +#include "irresistible\cnr\features\cop\emp.pwn" + +/* ** Hooks ** */ +/*hook OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid, bodypart ) +{ + if ( p_Class[ playerid ] == CLASS_POLICE && !IsPlayerNPC( playerid ) ) + { + new Float: x, Float: y, Float: z; + + GetPlayerPos( playerid, x, y, z ); + + if ( x >= -1650.0 && x <= -1571.0 && y >= 647.0 && y <= 711.0 ) + return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage LEO officers while they are within the Police Department HQ." ), 0; + } + return 1; +}*/ \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/cop/arrest.pwn b/gamemodes/irresistible/cnr/features/cop/arrest.pwn index 04382ea..04c98fc 100644 --- a/gamemodes/irresistible/cnr/features/cop/arrest.pwn +++ b/gamemodes/irresistible/cnr/features/cop/arrest.pwn @@ -51,7 +51,7 @@ hook OnPlayerDeath( playerid, killerid, reason ) hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { - if ( PRESSED( KEY_LOOK_BEHIND ) ) // MMB to taze/cuff/ar + /*if ( PRESSED( KEY_LOOK_BEHIND ) ) // MMB to taze/cuff/ar { if ( p_Class[ playerid ] == CLASS_POLICE && ! IsPlayerSpawnProtected( playerid ) ) { @@ -68,7 +68,7 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) } } } - } + }*/ return 1; } @@ -546,4 +546,20 @@ hook OnPlayerAccessEntrance( playerid, entranceid, worldid, interiorid ) } } return 1; +} + +hook OnPlayerUpdateEx( playerid ) +{ + if ( p_Class[ playerid ] == CLASS_POLICE && GetPlayerScore( playerid ) < 50 ) + { + new + Float: radius = 25.0, + closestCivilian = GetClosestPlayerEx( playerid, CLASS_CIVILIAN, radius ); + + if ( closestCivilian != INVALID_PLAYER_ID && GetPlayerWantedLevel( closestCivilian ) != 0 ) + { + return ShowPlayerHelpDialog( playerid, 4000, "Use ~y~/taze [ID]~w~, ~b~/cuff [ID]~w~, and ~r~/ar [ID] ~w~commands to arrest." ); + } + } + return 1; } \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/cop/emp.pwn b/gamemodes/irresistible/cnr/features/cop/emp.pwn new file mode 100644 index 0000000..59f2d47 --- /dev/null +++ b/gamemodes/irresistible/cnr/features/cop/emp.pwn @@ -0,0 +1,98 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Lorenc + * Module: \cnr\features\cop\emp.pwn + * Purpose: handle vehicle emp + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Commands ** */ +CMD:emp( playerid, params[ ] ) +{ + new + pID + ; + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to Police only." ); + else if ( p_inCIA{ playerid } == false || p_inArmy{ playerid } == true ) return SendError( playerid, "This is restricted to CIA only." ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/emp [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( pID == playerid ) return SendError( playerid, "You cannot do this to yourself." ); + else if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); + else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + else if ( IsPlayerAdminOnDuty( pID ) ) return SendError( playerid, "This person is an admin on duty!" ); + else if ( IsPlayerAdminOnDuty( playerid ) ) return SendError( playerid, "You cannot use this command while AOD." ); + else if ( p_Class[ pID ] == CLASS_POLICE ) return SendError( playerid, "This person is a apart of the Police Force." ); + else if ( !p_WantedLevel[ pID ] ) return SendError( playerid, "This person is innocent!" ); + else if ( !IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player isn't inside any vehicle." ); + else if ( GetPlayerState( pID ) != PLAYER_STATE_DRIVER ) return SendError( playerid, "This player is not a driver of any vehicle." ); + else if ( GetDistanceBetweenPlayers( playerid, pID ) < 30.0 ) + { + /* ** ANTI EMP SPAM ** */ + if ( p_AntiEmpSpam[ pID ] > g_iTime ) + return SendError( playerid, "You cannot EMP this person for %s.", secondstotime( p_AntiEmpSpam[ pID ] - g_iTime ) ); + /* ** END OF ANTI SPAM ** */ + + new + iVehicle = GetPlayerVehicleID( pID ); + + if ( g_buyableVehicle{ iVehicle } ) + return SendError( playerid, "Failed to place a Electromagnetic Pulse on this player's vehicle." ); + + p_AntiEmpSpam[ pID ] = g_iTime + 60; + + if ( p_AntiEMP[ pID ] > 0 ) + { + p_AntiEMP[ pID ] --; + + new + iRandom = random( 101 ); + + if ( iRandom < 90 ) + { + SendClientMessage( playerid, -1, ""COL_RED"[EMP]{FFFFFF} An Electromagnetic Pulse attempt has been repelled by an aluminum foil!" ); + SendClientMessage( pID, -1, ""COL_GREEN"[EMP]{FFFFFF} Electromagnetic Pulse had been repelled by aluminum foil set on vehicle." ); + p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; + return 1; + } + } + + SendClientMessageFormatted( pID, -1, ""COL_RED"[EMP]{FFFFFF} %s(%d) has sent an electromagnetic pulse on your vehicle causing it to crash for 30 seconds.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[EMP]{FFFFFF} You have activated a electromagnetic pulse on %s(%d)'s vehicle!", ReturnPlayerName( pID ), pID ); + p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; + SetTimerEx( "emp_deactivate", 30000, false, "d", GetPlayerVehicleID( pID ) ); + GetVehicleParamsEx( iVehicle, engine, lights, alarm, doors, bonnet, boot, objective ); + SetVehicleParamsEx( iVehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective ); + } + else SendError( playerid, "This player is not nearby." ); + return 1; +} + +CMD:demp( playerid, params[ ] ) return cmd_disableemp(playerid, params); +CMD:disableemp( playerid, params[ ] ) +{ + if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to Police only." ); + else if ( p_inCIA{ playerid } == false || p_inArmy{ playerid } == true ) return SendError( playerid, "This is restricted to CIA only." ); + else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); + else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You are not in any vehicle." ); + + new + iVehicle = GetPlayerVehicleID( playerid ); + + GetVehicleParamsEx( iVehicle, engine, lights, alarm, doors, bonnet, boot, objective ); + + if ( engine != VEHICLE_PARAMS_OFF ) return SendError( playerid, "This has not been affected by any EMP attacks."); + + SetVehicleParamsEx( iVehicle, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective ); + + return SendServerMessage( playerid, "You have successfully re-initialized the vehicle." ); +} + +function emp_deactivate( vehicleid ) +{ + if ( !IsValidVehicle( vehicleid ) ) return 0; + GetVehicleParamsEx( vehicleid, engine, lights, alarm, doors, bonnet, boot, objective ); + SetVehicleParamsEx( vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective ); + return 1; +} \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/features/gangs/gangs.pwn b/gamemodes/irresistible/cnr/features/gangs/gangs.pwn index ce9f7f2..0e4b538 100644 --- a/gamemodes/irresistible/cnr/features/gangs/gangs.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/gangs.pwn @@ -639,7 +639,7 @@ thread OnPlayerGangLoaded( playerid ) else { p_GangID[ playerid ] = -1; - SendServerMessage( playerid, "Had an issue loading your gang. Contact Lorenc (0x92F)." ); + SendServerMessage( playerid, "Had an issue loading your gang. Contact Damen (0x92F)." ); printf("[GANG] [ERROR] Had an issue loading a gang row id %d", gang_sql_id ); } } diff --git a/gamemodes/irresistible/cnr/features/houses/house.pwn b/gamemodes/irresistible/cnr/features/houses/house.pwn index 992029a..a3d91f2 100644 --- a/gamemodes/irresistible/cnr/features/houses/house.pwn +++ b/gamemodes/irresistible/cnr/features/houses/house.pwn @@ -630,10 +630,10 @@ thread OnHouseLoad( ) } printf( "[HOUSES]: %d houses have been loaded. (Tick: %dms)", rows, GetTickCount( ) - loadingTick ); - // Make Lorenc the owner of unowned VIP houses + // Make Damen the owner of unowned VIP houses foreach ( new houseid : houses ) if ( g_houseData[ houseid ] [ E_COST ] < 10000 ) { if ( strmatch( g_houseData[ houseid ] [ E_OWNER ], "No-one" ) ) { - SetHouseOwner( houseid, 1, "Lorenc" ); + SetHouseOwner( houseid, 1, "Damen" ); } } return 1; diff --git a/gamemodes/irresistible/cnr/features/perks.pwn b/gamemodes/irresistible/cnr/features/perks.pwn index 457950f..f3993be 100644 --- a/gamemodes/irresistible/cnr/features/perks.pwn +++ b/gamemodes/irresistible/cnr/features/perks.pwn @@ -217,9 +217,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) /* ** Commands ** */ CMD:perks( playerid, params[ ] ) { - if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) { + if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); - } + + if ( IsPlayerInArmyVehicle( playerid ) ) + return SendError( playerid, "You cannot use this command while in an army vehicle." ); + return ShowPlayerDialog( playerid, DIALOG_PERKS, DIALOG_STYLE_LIST, "{FFFFFF}Game Perks", "Player Perks\nVehicle Perks", "Select", "Cancel" ); } diff --git a/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn b/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn index b1cba72..889f9b5 100644 --- a/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn +++ b/gamemodes/irresistible/cnr/features/player/irresistibleguard.pwn @@ -353,7 +353,7 @@ thread OnAccountGuardDelete( playerid ) ; if ( id != p_accountSecurityData[ playerid ] [ E_ID ] ) - return SendError( playerid, "Something is wrong with your email. Talk to Lorenc." ), 1; + return SendError( playerid, "Something is wrong with your email. Talk to Damen." ), 1; if ( g_iTime - last_changed < 300 ) { return SendError( playerid, "You can use this feature in %s.", secondstotime( 300 - ( g_iTime - last_changed ) ) ); diff --git a/gamemodes/irresistible/cnr/features/player/player_settings.pwn b/gamemodes/irresistible/cnr/features/player/player_settings.pwn index fed63e4..3208cd2 100644 --- a/gamemodes/irresistible/cnr/features/player/player_settings.pwn +++ b/gamemodes/irresistible/cnr/features/player/player_settings.pwn @@ -9,7 +9,7 @@ #include < YSI\y_hooks > /* ** Definitions ** */ -#define MAX_SETTINGS ( 12 ) +#define MAX_SETTINGS ( 13 ) #define SETTING_BAILOFFERS ( 0 ) #define SETTING_EVENT_TP ( 1 ) @@ -23,13 +23,14 @@ #define SETTING_COINS_BAR ( 9 ) #define SETTING_TOP_DONOR ( 10 ) #define SETTING_WEAPON_PICKUP ( 11 ) +#define SETTING_HIDE_GAMB_MSG ( 12 ) /* ** Variables ** */ static stock g_PlayerSettings [ MAX_SETTINGS ] [ 24 ] = { { "Prevent Bail Offers" }, { "Prevent Event Teleports" }, { "Prevent Gang Invites" }, { "Prevent Chat Prefixes" }, { "Prevent Ransom Offers" }, { "Display User ID In Chat" }, { "Display Connection Log" }, { "Display Hitmarker" }, { "Set V.I.P Skin" }, { "Hide Total Coin Bar" }, { "Hide Last Donor Text" }, - { "Manual Pickup Weapon" } + { "Manual Pickup Weapon" }, { "Hide Gambling Win Msgs" } }, bool: p_PlayerSettings [ MAX_PLAYERS ] [ MAX_SETTINGS char ] ; diff --git a/gamemodes/irresistible/cnr/features/random_messages.pwn b/gamemodes/irresistible/cnr/features/random_messages.pwn index dbdbc28..2182e83 100644 --- a/gamemodes/irresistible/cnr/features/random_messages.pwn +++ b/gamemodes/irresistible/cnr/features/random_messages.pwn @@ -66,7 +66,7 @@ static stock { "{8ADE47}Stephanie:"COL_WHITE" Play Poker with your friends at any casino! Beat your way to riches!" }, { "{8ADE47}Stephanie:"COL_WHITE" Get casino rewards points by gambling at any casino! Use "COL_GREY"/casino rewards"COL_WHITE" to spend them!" }, { "{8ADE47}Stephanie:"COL_WHITE" Race your friends in a street race or outrun race by using "COL_GREY"/race"COL_WHITE"!" }, - { "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" }, + //{ "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" }, { "{8ADE47}Stephanie:"COL_WHITE" Contribute to our feature "COL_GREY"/crowdfunds"COL_WHITE"! Early supporters get benefits!" }, { "{8ADE47}Stephanie:"COL_WHITE" You can buy premium player homes using "COL_GREY"/estate"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" You can buy Irresistible Coins from players using "COL_GREY"/ic buy"COL_WHITE"!" }, @@ -101,7 +101,7 @@ hook OnServerUpdate( ) } // throttle - g_randomMessageTick = GetServerTime( ) + 30; + g_randomMessageTick = GetServerTime( ) + 60; } return Y_HOOKS_CONTINUE_RETURN_1; } diff --git a/gamemodes/irresistible/cnr/features/robbery/clerks.pwn b/gamemodes/irresistible/cnr/features/robbery/clerks.pwn index cdad707..0de4a0d 100644 --- a/gamemodes/irresistible/cnr/features/robbery/clerks.pwn +++ b/gamemodes/irresistible/cnr/features/robbery/clerks.pwn @@ -557,7 +557,7 @@ function OnPlayerHoldupStore( playerid, clerkid, step ) } if ( !( 0 <= amount < 10000 ) ) - return SendError( playerid, "A money exploit occurred. Contact Lorenc ASAP." ); + return SendError( playerid, "A money exploit occurred. Contact Damen ASAP." ); GivePlayerCash( playerid, amount ); GivePlayerExperience( playerid, E_ROBBERY, 0.2 ); // give 10% of what it normally does, since it does this for like 4-5 times diff --git a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn index b40adf2..197d8ff 100644 --- a/gamemodes/irresistible/cnr/features/vip/coin_market.pwn +++ b/gamemodes/irresistible/cnr/features/vip/coin_market.pwn @@ -210,11 +210,11 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) // Redirect player if ( selected_vip == VIP_DIAMOND ) { - ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else if ( selected_vip == VIP_PLATINUM ) { - ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else { @@ -416,12 +416,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) if ( sscanf( inputtext, "u", pID ) ) { SendError( playerid, "Please enter a player's ID or name." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else if ( !IsPlayerConnected( pID ) ) { SendError( playerid, "This player is not connected." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else { @@ -447,12 +447,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) if ( sscanf( inputtext, "u", pID ) ) { SendError( playerid, "Please enter a player's ID or name." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else if ( !IsPlayerConnected( pID ) ) { SendError( playerid, "This player is not connected." ); - ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Lorenc on the forum when you make a decision!", "Gift it!", "I'll Think!" ); + ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" ); } else { @@ -493,7 +493,7 @@ CMD:irresistiblecoins( playerid, params[ ] ) if ( sscanf( params[ 5 ],"uf", senttoid, coins ) ) return SendUsage( playerid, "/irresistiblecoins send [PLAYER_ID] [COINS]" ); else if ( !IsPlayerConnected( senttoid ) || IsPlayerNPC( senttoid ) ) return SendError( playerid, "Invalid Player ID." ); - else if ( p_VIPLevel[ playerid ] < VIP_BRONZE ) return SendError( playerid, "You are not a Bronze V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); + else if ( p_VIPLevel[ playerid ] < VIP_REGULAR ) return SendError( playerid, "You are not a Regular V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); else if ( coins < 0.1 || coins > 10000.0 ) return SendError( playerid, "You can only send between 0.1 and 10,000.0 coins at a single time." ); else if ( coins > 99999999 || coins < 0 ) return SendError( playerid, "You can only send between 0.1 and 5,000.0 coins at a single time." ); // Making cash go over billions... else if ( GetPlayerIrresistibleCoins( playerid ) < coins ) return SendError( playerid, "You do not have this number of coins to send." ); @@ -801,7 +801,7 @@ static stock ShowPlayerVipRedeemedDialog( playerid ) ""COL_GREY" * What are the commands?"COL_WHITE" Use /vipcmds to view a detailed list of VIP commands.\n"\ ""COL_GREY" * What did I receive?"COL_WHITE" Check through your V.I.P package contents via our site (forum -> announcements board).\n" ); strcat( szLargeString, ""COL_GREY" * How to redeem my houses/vehicles?"COL_WHITE" You will be announced to the admins and noted down for assistance, so please wait!\n"\ - ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Lorenc via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" ); + ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Damen via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" ); ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" ); } diff --git a/gamemodes/irresistible/cnr/features/vip/player_note.pwn b/gamemodes/irresistible/cnr/features/vip/player_note.pwn index c440c10..45de4a6 100644 --- a/gamemodes/irresistible/cnr/features/vip/player_note.pwn +++ b/gamemodes/irresistible/cnr/features/vip/player_note.pwn @@ -146,7 +146,7 @@ thread deleteplayernote( playerid, noteid ) if ( rows ) { SaveToAdminLog( playerid, noteid, "removed note" ); mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", p_AccountID[ playerid ], noteid ) ); - SendServerMessage( playerid, "You have removed note id %d. If there are any problems, contact Lorenc/Council.", noteid ); + SendServerMessage( playerid, "You have removed note id %d. If there are any problems, contact Damen/Council.", noteid ); AddAdminLogLineFormatted( "%s(%d) has deleted note id %d", ReturnPlayerName( playerid ), playerid, noteid ); return 1; } diff --git a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn index e636f41..a8b1a96 100644 --- a/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn +++ b/gamemodes/irresistible/cnr/features/vip/redeem_code.pwn @@ -44,7 +44,7 @@ hook OnScriptInit( ) SetDynamicObjectMaterialText( ( g_TopDonorWall = CreateDynamicObject( 3074, -1574.3559, 885.1296, 14.0153, 0.0000, 0.0000, -0.0156 ) ), 0, "Nobody donated :(", 130, "Arial", 48, 0, -65536, 0, 1 ); // Latest Donor TD - g_TopDonorTD = TextDrawCreate(320.000000, 2.000000, "Top Donor Lorenc - $0.00, ~w~~h~~h~Latest Donor Lorenc - $0.00"); + g_TopDonorTD = TextDrawCreate(320.000000, 2.000000, "Top Donor Damen - $0.00, ~w~~h~~h~Latest Donor Damen - $0.00"); TextDrawAlignment(g_TopDonorTD, 2); TextDrawBackgroundColor(g_TopDonorTD, 0); TextDrawFont(g_TopDonorTD, 1); @@ -87,7 +87,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) strcat( szLargeString, ""COL_WHITE"Thank you a lot for donating! :D In return for your dignity, you have received Irresistible Coins.\n\n"\ ""COL_GREY" * What do I do with Irresistible Coins?"COL_WHITE" You can claim the V.I.P of your choice via "COL_GREY"/irresistiblecoins market"COL_WHITE".\n" ); strcat( szLargeString, ""COL_GREY" * How many do I have?"COL_WHITE" You can see how many Irresistible Coins you have via "COL_GREY"/irresistiblecoins"COL_WHITE".\n" \ - ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Lorenc via the forums!\n\nThank you once again for your contribution to our community! :P" ); + ""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Damen via the forums!\n\nThank you once again for your contribution to our community! :P" ); return ShowPlayerDialog( playerid, DIALOG_FINISHED_DONATING, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" ); } else if ( dialogid == DIALOG_FINISHED_DONATING ) @@ -97,7 +97,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) else if ( dialogid == DIALOG_LATEST_DONOR ) { if ( GetPVarType( playerid, "just_donated" ) != PLAYER_VARTYPE_FLOAT ) - return SendError( playerid, "Seems to be an issue where we couldn't find how much you donated. Report to Lorenc." ); + return SendError( playerid, "Seems to be an issue where we couldn't find how much you donated. Report to Damen." ); new Float: fAmount = GetPVarFloat( playerid, "just_donated" ); diff --git a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn index 800bf0c..54c4fdf 100644 --- a/gamemodes/irresistible/cnr/features/visage/blackjack.pwn +++ b/gamemodes/irresistible/cnr/features/visage/blackjack.pwn @@ -572,7 +572,7 @@ stock CheckForBlackjack( tableid ) g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has been returned %s due to a push.", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); GameTextForPlayer( playerid, sprintf( "~n~~n~~y~%s returned!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } @@ -585,18 +585,18 @@ stock CheckForBlackjack( tableid ) SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a card count of 21!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); } GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } else if ( dealer_score == 21 ) { - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a dealer %s.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ), IsDealerHandBlackjack( tableid, dealer_score ) ? ( "blackjack" ) : ( "21" ) ); GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 ); } else if ( player_score > 21 ) { - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ); GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 ); @@ -605,12 +605,12 @@ stock CheckForBlackjack( tableid ) g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } else if ( player_score < dealer_score && dealer_score >= 17 ) { - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_BUST; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has lost %s due to a bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ); GameTextForPlayer( playerid, "~n~~n~~r~No win!", 4000, 3 ); @@ -619,7 +619,7 @@ stock CheckForBlackjack( tableid ) g_blackjackPlayerState[ tableid ] [ player_index ] = BLACKJACK_STATE_WIN; SendClientMessageToBlackjack( tableid, COLOR_GREY, "[BLACKJACK]"COL_WHITE" %s(%d) has won %s due to a dealer bust.", ReturnPlayerName( playerid ), playerid, cash_format( g_blackjackData[ tableid ] [ E_PAYOUT ] ) ); GameTextForPlayer( playerid, sprintf( "~n~~n~~g~%s won!", cash_format( payout ) ), 4000, 3 ); - GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); + if ( payout != 0 ) GivePlayerCasinoRewardsPoints( playerid, g_blackjackData[ tableid ] [ E_PAYOUT ], .house_edge = 1.5 ); GivePlayerCash( playerid, payout ); StockMarket_UpdateEarnings( E_STOCK_CASINO, -payout, 0.05 ); } @@ -627,8 +627,12 @@ stock CheckForBlackjack( tableid ) // alert world if ( g_blackjackPlayerState[ tableid ] [ player_index ] == BLACKJACK_STATE_WIN && payout > g_blackjackData[ tableid ] [ E_PAYOUT ] && payout >= 10000 ) { UpdateServerVariable( "blackjack_wins", 0, GetGVarFloat( "blackjack_wins" ) + ( float( payout ) / 1000000.0 ), "", GLOBAL_VARTYPE_FLOAT ); - SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); - } + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from blackjack!", ReturnPlayerName( playerid ), playerid, cash_format( payout ) ); + } + } } } return dealer_score; @@ -706,7 +710,7 @@ stock SendClientMessageToBlackjack( tableid, colour, format[ ], va_args<> ) stock InitializeBlackjackTextdraws( id ) { - g_blackjackTurnTD[ id ] = TextDrawCreate(330.000000, 204.000000, "Lorenc has 5 seconds"); + g_blackjackTurnTD[ id ] = TextDrawCreate(330.000000, 204.000000, "Damen has 5 seconds"); TextDrawAlignment(g_blackjackTurnTD[ id ], 2); TextDrawBackgroundColor(g_blackjackTurnTD[ id ], 255); TextDrawFont(g_blackjackTurnTD[ id ], 1); diff --git a/gamemodes/irresistible/cnr/features/visage/roulette.pwn b/gamemodes/irresistible/cnr/features/visage/roulette.pwn index 40a3953..7d8c56a 100644 --- a/gamemodes/irresistible/cnr/features/visage/roulette.pwn +++ b/gamemodes/irresistible/cnr/features/visage/roulette.pwn @@ -686,11 +686,15 @@ public OnRouletteWheelStop( rouletteid, winner ) // inform users if ( profit >= 10000 ) { - SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from roulette!", ReturnPlayerName( playerid ), playerid, cash_format( profit ) ); + } } // give user points - GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 ); + if ( profit != 0 ) GivePlayerCasinoRewardsPoints( playerid, waged, .house_edge = 2.7 ); // gametext if ( profit > 0 ) { diff --git a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn index 98a84f4..fd7c0e2 100644 --- a/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn +++ b/gamemodes/irresistible/cnr/features/visage/slot_machines.pwn @@ -288,7 +288,12 @@ public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, thir // alert user if ( iNetWin > g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] ) { SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, cash_format( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] >= 25000 ? ( "Visage" ) : ( "Caligulas" ) ) ); - } else { + foreach(new i : Player) + { + if ( !IsPlayerSettingToggled( i, 12 ) ) + SendClientMessageFormatted( i, -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has won "COL_GOLD"%s"COL_WHITE" from the %s casino slots!", ReturnPlayerName( playerid ), playerid, cash_format( iNetWin ), g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] == 10000 ? ( "Four Dragons" ) : ( g_slotmachineData[ slotid ] [ E_ENTRY_FEE ] >= 25000 ? ( "Visage" ) : ( "Caligulas" ) ) ); + } + } else { SendServerMessage( playerid, "Congratulations, you've won "COL_GOLD"%s"COL_WHITE"!", cash_format( iNetWin ) ); } diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 88f36fe..142fbdc 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -52,6 +52,9 @@ new // p_XP [ MAX_PLAYERS ], bool: p_Spectating [ MAX_PLAYERS char ], bool: p_Muted [ MAX_PLAYERS char ], + bool: p_ChatBanned [ MAX_PLAYERS char ], + p_ChatBannedBy [ MAX_PLAYERS ] [ MAX_PLAYER_NAME ], + p_ChatBanReason [ MAX_PLAYERS ] [ 25 ], bool: p_InfectedHIV [ MAX_PLAYERS char ], p_AntiTextSpam [ MAX_PLAYERS ], bool: p_BlockedPM [ MAX_PLAYERS ] [ MAX_PLAYERS ], @@ -218,3 +221,5 @@ stock IsPlayerSpawned( playerid ) return p_Spawned{ playerid }; stock IsPlayerJailed( playerid ) return p_Jailed{ playerid }; stock IsPlayerAdminOnDuty( playerid ) return p_AdminOnDuty{ playerid }; + +stock IsPlayerChatBanned( playerid ) return p_ChatBanned{ playerid }; \ No newline at end of file diff --git a/gamemodes/irresistible/cnr/textdraws.pwn b/gamemodes/irresistible/cnr/textdraws.pwn index b25ee89..c263eb6 100644 --- a/gamemodes/irresistible/cnr/textdraws.pwn +++ b/gamemodes/irresistible/cnr/textdraws.pwn @@ -42,6 +42,8 @@ new /* ** Hooks ** */ hook OnScriptInit( ) { + TextDrawSetString( g_MotdTD, "~w~Want more ~g~money, houses, and xp~w~? Consider donating! ~y~/vip" ); + g_currentXPTD = TextDrawCreate(529.000000, 405.000000, "Current XP"); TextDrawBackgroundColor(g_currentXPTD, 255); TextDrawFont(g_currentXPTD, 3); diff --git a/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation b/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation new file mode 100644 index 0000000..697b008 --- /dev/null +++ b/gamemodes/irresistible/config/migrations/cnr/20190405_cnr_chat_ban_creation @@ -0,0 +1,14 @@ +-- CREATE A MIGRATION ENTRY +INSERT INTO `DB_MIGRATIONS` (`MIGRATION`) VALUES ('20190405_cnr_chat_ban_creation'); + +--BEGIN + +-- CREATE TABLE +CREATE TABLE IF NOT EXISTS `CHAT_BANS` ( + `ID` int(11) NOT NULL, + `NAME` varchar(25) DEFAULT NULL, + `BANNED_BY_ID` int(11) NOT NULL, + `BANNED_BY` varchar(25) DEFAULT NULL, + `REASON` varchar(25) DEFAULT NULL, + UNIQUE KEY `ID` (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file diff --git a/gamemodes/irresistible/helpers.pwn b/gamemodes/irresistible/helpers.pwn index b61b8c6..9d405db 100644 --- a/gamemodes/irresistible/helpers.pwn +++ b/gamemodes/irresistible/helpers.pwn @@ -41,6 +41,7 @@ stock szNormalString[ 144 ]; stock szBigString[ 256 ]; stock szLargeString[ 1024 ]; stock szHugeString[ 2048 ]; +stock szMassiveString[ 4096 ]; stock g_szSprintfBuffer[ 1024 ]; stock tmpVariable; diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 7356a20..a40f0ee 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -16,7 +16,7 @@ #pragma option -d3 #pragma dynamic 7200000 -// #define DEBUG_MODE +//#define DEBUG_MODE #if defined DEBUG_MODE #pragma option -d3 @@ -197,6 +197,8 @@ public OnServerUpdateTimer( ) // better to store in a variable as we are getting the timestamp from hardware g_iTime = gettime( ); + + UpdatePlayerCounters(); // for hooks CallLocalFunction( "OnServerUpdate", "" ); @@ -521,6 +523,9 @@ public OnPlayerDisconnect( playerid, reason ) p_Cuffed { playerid } = false; justConnected { playerid } = true; p_Muted { playerid } = false; + p_ChatBanned { playerid } = false; + p_ChatBannedBy [ playerid ] [ 0 ] = '\0'; + p_ChatBanReason [ playerid ] [ 0 ] = '\0'; p_MetalMelter [ playerid ] = 0; p_LeftCuffed { playerid } = false; p_PmResponder [ playerid ] = INVALID_PLAYER_ID; @@ -1508,12 +1513,15 @@ public OnPlayerText( playerid, text[ ] ) return SendError( playerid, "An error occured, please try again." ), 0; #endif + if ( IsPlayerChatBanned( playerid ) ) + return SendError( playerid, "You have been chat banned and are not allowed to chat."), 0; + if ( textContainsIP( text ) ) return SendServerMessage( playerid, "Please do not advertise." ), 0; new tick_count = GetTickCount( ); - if ( p_AntiTextSpam[ playerid ] > tick_count ) + if ( p_AntiTextSpam[ playerid ] > tick_count && p_AdminLevel[ playerid ] != 6 ) { p_AntiTextSpam[ playerid ] = tick_count + 750; p_AntiTextSpamCount{ playerid } ++; @@ -1670,15 +1678,6 @@ stock UntiePlayer( playerid ) SendGlobalMessage( -1, ""COL_GREY"[SERVER]{FFFFFF} %s(%d) has been untied by the anti-abuse system.", ReturnPlayerName( playerid ), playerid ); } -function emp_deactivate( vehicleid ) -{ - if ( !IsValidVehicle( vehicleid ) ) return 0; - GetVehicleParamsEx( vehicleid, engine, lights, alarm, doors, bonnet, boot, objective ); - SetVehicleParamsEx( vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective ); - return 1; -} - - public OnPlayerProgressUpdate( playerid, progressid, bool: canceled, params ) { return 1; @@ -2114,7 +2113,8 @@ CMD:cw( playerid, params[ ] ) return cmd_carwhisper( playerid, params ); CMD:carwhisper( playerid, params[ ] ) { new msg[ 100 ]; - if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You must be inside a vehicle to use this command." ); + if ( p_ChatBanned{ playerid } ) return SendError( playerid, "You have been chat banned and are not allowed to chat." ); + else if ( !IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You must be inside a vehicle to use this command." ); else if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/carwhisper [MESSAGE]" ); else if ( textContainsIP( msg ) ) return SendError( playerid, "Advertising is forbidden." ); else @@ -2133,7 +2133,8 @@ CMD:w( playerid, params[ ] ) return cmd_whisper( playerid, params ); CMD:whisper( playerid, params[ ] ) { new msg[ 100 ]; - if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/whisper [MESSAGE]" ); + if ( p_ChatBanned{ playerid } ) return SendError( playerid, "You have been chat banned and are not allowed to chat." ); + else if ( sscanf( params, "s[100]", msg ) ) return SendUsage( playerid, "/whisper [MESSAGE]" ); else if ( textContainsIP( msg ) ) return SendError( playerid, "Advertising is forbidden." ); else { @@ -2151,8 +2152,8 @@ CMD:whisper( playerid, params[ ] ) CMD:admins( playerid, params[ ] ) { - if ( GetPlayerScore( playerid ) < 500 && !IsPlayerUnderCover( playerid ) && p_AdminLevel[ playerid ] < 1 ) - return SendError( playerid, "You need at least 500 score to view the online adminstrators." ); + if ( GetPlayerScore( playerid ) < 50 && !IsPlayerUnderCover( playerid ) && p_AdminLevel[ playerid ] < 1 ) + return SendError( playerid, "You need at least 50 score to view the online adminstrators." ); new g_adminList[ MAX_PLAYERS ] [ 2 ], bool: is_empty = true; @@ -2518,6 +2519,11 @@ CMD:myaccid( playerid, params[ ] ) return 1; } +CMD:discord( playerid, params[ ] ) +{ + return SendServerMessage( playerid, "Visit 'sfcnr.com/discord' to join our Discord server!" ); +} + CMD:job( playerid, params[ ] ) { if ( p_VIPLevel[ playerid ] >= VIP_PLATINUM && p_VIPJob{ playerid } != p_Job{ playerid } ) @@ -2641,69 +2647,6 @@ thread OnPlayerWeeklyTime( playerid, irc, player[ ] ) return 1; } -CMD:emp( playerid, params[ ] ) -{ - new - pID - ; - if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to Police only." ); - else if ( p_inCIA{ playerid } == false || p_inArmy{ playerid } == true ) return SendError( playerid, "This is restricted to CIA only." ); - else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/emp [PLAYER_ID]" ); - else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); - else if ( pID == playerid ) return SendError( playerid, "You cannot do this to yourself." ); - else if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." ); - else if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." ); - else if ( IsPlayerAdminOnDuty( pID ) ) return SendError( playerid, "This person is an admin on duty!" ); - else if ( p_Class[ pID ] == CLASS_POLICE ) return SendError( playerid, "This person is a apart of the Police Force." ); - else if ( !p_WantedLevel[ pID ] ) return SendError( playerid, "This person is innocent!" ); - else if ( !IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player isn't inside any vehicle." ); - else if ( GetPlayerState( pID ) != PLAYER_STATE_DRIVER ) return SendError( playerid, "This player is not a driver of any vehicle." ); - //else if ( g_buyableVehicle{ GetPlayerVehicleID( pID ) } == true ) return SendError( playerid, "Failed to place a Electromagnetic Pulse on this player's vehicle." ); - else if ( GetDistanceBetweenPlayers( playerid, pID ) < 30.0 ) - { - /* ** ANTI EMP SPAM ** */ - if ( p_AntiEmpSpam[ pID ] > g_iTime ) - return SendError( playerid, "You cannot EMP this person for %s.", secondstotime( p_AntiEmpSpam[ pID ] - g_iTime ) ); - /* ** END OF ANTI SPAM ** */ - - new - iVehicle = GetPlayerVehicleID( pID ); - - if ( g_buyableVehicle{ iVehicle } ) - return SendError( playerid, "Failed to place a Electromagnetic Pulse on this player's vehicle." ); - - p_AntiEmpSpam[ pID ] = g_iTime + 60; - - if ( p_AntiEMP[ pID ] > 0 ) - { - p_AntiEMP[ pID ] --; - - new - iRandom = random( 101 ); - - //if ( g_buyableVehicle{ iVehicle } ) - //iRandom -= 50; - - if ( iRandom < 90 ) - { - SendClientMessage( playerid, -1, ""COL_RED"[EMP]{FFFFFF} An Electromagnetic Pulse attempt has been repelled by an aluminum foil!" ); - SendClientMessage( pID, -1, ""COL_GREEN"[EMP]{FFFFFF} Electromagnetic Pulse had been repelled by aluminum foil set on vehicle." ); - p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; - return 1; - } - } - - SendClientMessageFormatted( pID, -1, ""COL_RED"[EMP]{FFFFFF} %s(%d) has sent an electromagnetic pulse on your vehicle causing it to crash for 30 seconds.", ReturnPlayerName( playerid ), playerid ); - SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[EMP]{FFFFFF} You have activated a electromagnetic pulse on %s(%d)'s vehicle!", ReturnPlayerName( pID ), pID ); - p_QuitToAvoidTimestamp[ pID ] = g_iTime + 15; - SetTimerEx( "emp_deactivate", 30000, false, "d", GetPlayerVehicleID( pID ) ); - GetVehicleParamsEx( iVehicle, engine, lights, alarm, doors, bonnet, boot, objective ); - SetVehicleParamsEx( iVehicle, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective ); - } - else SendError( playerid, "This player is not nearby." ); - return 1; -} - public OnPlayerLoadTextdraws( playerid ) { PlayerTextDrawShow( playerid, p_LocationTD[ playerid ] ); @@ -5226,6 +5169,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) ""COL_GREY"/dss{FFFFFF} - Destroys a specified spike set id.\n"\ ""COL_GREY"/dssall{FFFFFF} - Removes all spike sets.\n"\ ""COL_GREY"/emp{FFFFFF} - Shuts down the engine of a driver's vehicle.\n"\ + ""COL_GREY"/disableemp - /demp -{FFFFFF} - Reinitializes the engine of a driver's vehicle.\n"\ ""COL_GREY"/bruteforce{FFFFFF} - Brute forces a houses' password." ); ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Police Commands", szCMDS, "Okay", "Back" ); } @@ -5272,7 +5216,13 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) case 8: { if ( p_VIPLevel[ playerid ] < VIP_REGULAR ) return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" ); - cmd_vipcmds( playerid, "" ); + szCMDS[ 0 ] = '\0'; + strcat( szCMDS, ""COL_GREY"/viplist{FFFFFF} - A list of all online V.I.P. players.\n"\ + ""COL_GREY"/vipspawnwep{FFFFFF} - Configure your V.I.P. weapons that you are given on spawning.\n"\ + ""COL_GREY"/vipgun{FFFFFF} - Use the V.I.P. Lounge Weapon vending machine.\n"\ + ""COL_GREY"/vipskin{FFFFFF} - Configure your V.I.P. skin.\n"\ + ""COL_GREY"/vipjob{FFFFFF} - Choose your V.I.P. job that allows you to have two jobs at once.\n" ); + ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, ""COL_GOLD"V.I.P. Commands", szCMDS, "Okay", "Back" ); } } return 1; @@ -5657,7 +5607,7 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) new bool: has = false; // erase large string for ease - erase( szHugeString ); + erase( szMassiveString ); erase( szLargeString ); // show items @@ -5674,13 +5624,13 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) case 1: { foreach ( new i : houses ) if ( strmatch( g_houseData[ i ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) { - format( szHugeString, sizeof( szHugeString ), "%s%s\n", szHugeString, g_houseData[ i ] [ E_HOUSE_NAME ] ), has = true; + format( szMassiveString, sizeof( szMassiveString ), "%s%s\n", szMassiveString, g_houseData[ i ] [ E_HOUSE_NAME ] ), has = true; } if ( ! has ) return SendError( playerid, "You do not own any home." ), ShowPlayerSpawnMenu( playerid ); - return ShowPlayerDialog( playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, "{FFFFFF}Set Spawn Location", szHugeString, "Select", "Back" ); + return ShowPlayerDialog( playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, "{FFFFFF}Set Spawn Location", szMassiveString, "Select", "Back" ); } // businesses @@ -7126,4 +7076,32 @@ stock IsPlayerDead( playerid ) return health <= 0.0; return GetPlayerState( playerid ) == PLAYER_STATE_WASTED; +} + +stock IsPlayerInArmyVehicle( playerid ) +{ + new + vehicleid = GetPlayerVehicleID( playerid ), + vehiclemodelid = GetVehicleModel( vehicleid ) + ; + + if ( vehiclemodelid == 425 || vehiclemodelid == 432 || vehiclemodelid == 520 ) //Rhino, Tank, Hydra + return true; + else + return false; +} + +new playersPeakCount = 0; + +stock UpdatePlayerCounters() +{ + new total_online = Iter_Count( Player ); + + if ( total_online > playersPeakCount ) playersPeakCount = total_online; +} + +CMD:peak( playerid, params[] ) +{ + if ( p_AdminLevel[ playerid ] != 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + return SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" The current peak player count since startup is: %i", playersPeakCount ); } \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/_changelogs.cfg b/scriptfiles/changelogs/cnr/_changelogs.cfg index 1f64f0e..0607c59 100644 --- a/scriptfiles/changelogs/cnr/_changelogs.cfg +++ b/scriptfiles/changelogs/cnr/_changelogs.cfg @@ -1,3 +1,7 @@ +v11.55.168 +v11.54.157 +v11.53.154 v11.52.150 +v11.51.145 v11.50.142 v11.50.140 \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/changelog_template.txt b/scriptfiles/changelogs/cnr/changelog_template.txt new file mode 100644 index 0000000..af7f2ab --- /dev/null +++ b/scriptfiles/changelogs/cnr/changelog_template.txt @@ -0,0 +1,4 @@ +(+) +(/) +(*) +(-) \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.51.145.txt b/scriptfiles/changelogs/cnr/v11.51.145.txt new file mode 100644 index 0000000..f17d2b1 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.51.145.txt @@ -0,0 +1,5 @@ +(+) Adds Battle Royale minigame to the SF Stadium. +(+) Random airdrops drop every minute for Battle Royale players. +(/) Replaces ordinary plane for an andromanda model. +(*) Battle Royale games cannot be started without the leader starting. +(*) Battle Royale players will be autokilled if they AFK out of the playable area. \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.53.154.txt b/scriptfiles/changelogs/cnr/v11.53.154.txt new file mode 100644 index 0000000..5a4cfe2 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.53.154.txt @@ -0,0 +1,4 @@ +(-) Passive mode has been removed from the game. (Spawn protection still exists.) +(*) LEO Commands now check to see if a player is dead or not prior to casting. +(*) Personal Vehicle commands, such as /v park, should now work while in the water. +(/) Stephanie now sends a random message every 60 seconds rather than 30. \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.54.157.txt b/scriptfiles/changelogs/cnr/v11.54.157.txt new file mode 100644 index 0000000..bdc7eaa --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.54.157.txt @@ -0,0 +1,4 @@ +(+) Adds /(demp)disableemp to reinitialize a recently EMP'd vehicle. +(+) Adds /(un)chatban to ban low quality members from chat instead of banning. +(+) Adds /chatbanlist to view all online chat banned members. +(*) Moved /smlog and /iclog for admins into their correct level section of /acmds. \ No newline at end of file diff --git a/scriptfiles/changelogs/cnr/v11.55.168.txt b/scriptfiles/changelogs/cnr/v11.55.168.txt new file mode 100644 index 0000000..4a3e799 --- /dev/null +++ b/scriptfiles/changelogs/cnr/v11.55.168.txt @@ -0,0 +1,15 @@ +(+) You can now disable global gambling messages in /cp. +(+) /discord now displays what the discord server URL is. +(+) /cmds -> V.I.P. Commands now displays a list of V.I.P. commands. +(+) Players below 50 score, playing as a LEO, will now have a help dialog on how to arrest. +(/) The old arrest system, which is command-based, has been added back. (MMB Disabled) +(/) Regular V.I.P. players are now allowed to send IC with /ic send. +(/) /admins only requires 50 score now. +(/) The MOTD will now be preset upon server startup. +(*) Removes the ability to farm points within the Casino on a $0 payout. +(*) Fixed issue with /spawn not allowing 100+ houses to appear. +(*) A typo in /acmds has been fixed. +(*) Fixed an issue with /chatban showing the wrong player name. +(-) You are no longer able to use /perks while in an army vehicle. + +Note: All bans and CAC forces have been lifted. (Except for Chargeback-related bans) \ No newline at end of file