2018-09-19 05:43:05 +00:00
|
|
|
/*
|
|
|
|
* Irresistible Gaming (c) 2018
|
2018-12-12 08:21:57 +00:00
|
|
|
* Developed by Lorenc
|
2018-09-19 05:43:05 +00:00
|
|
|
* Module: server.pwn
|
|
|
|
* Purpose: server related definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* ** Includes ** */
|
|
|
|
#include < YSI\y_hooks >
|
|
|
|
|
|
|
|
/* ** Definitions ** */
|
|
|
|
#define SERVER_NAME "San Fierro Cops And Robbers (0.3.7)"
|
2018-10-16 16:28:19 +00:00
|
|
|
#define SERVER_MODE_TEXT "Cops And Robbers / DM / Gangs"
|
|
|
|
#define SERVER_MAP "San Fierro"
|
|
|
|
#define SERVER_LANGUAGE "English"
|
2018-09-19 05:43:05 +00:00
|
|
|
#define SERVER_WEBSITE "www.sfcnr.com"
|
|
|
|
#define SERVER_IP "54.36.127.43:7777"
|
2018-12-22 23:24:17 +00:00
|
|
|
#define SERVER_TWITTER "IrresistibleDev"
|
|
|
|
|
2019-05-29 13:05:13 +00:00
|
|
|
/* ** Server Operator ** */
|
|
|
|
#define SERVER_OPERATOR "Lorenc"
|
|
|
|
#define SERVER_OPERATOR_ACC_ID 1
|
|
|
|
|
2018-12-22 23:20:13 +00:00
|
|
|
/* ** Comment line to disable feature ** */
|
2019-04-17 23:36:02 +00:00
|
|
|
//#define SERVER_RULES_URL "files.sfcnr.com/en_rules.txt" // used for /rules (cnr\features\server_rules.pwn)
|
2019-01-01 15:51:02 +00:00
|
|
|
#define SERVER_TWITTER_FEED_URL "files.sfcnr.com/cnr_twitter.php" // used for /twitter (cnr\commands\cmd_twitter.pwn)
|
|
|
|
#define SERVER_HELP_API_URL "sfcnr.com/api/player/help" // used for /help (cnr\commands\cmd_help.pwn)
|
2019-01-27 08:52:42 +00:00
|
|
|
#define SERVER_CHANGES_DIRECTORY "changelogs/cnr" // used for /changes (cnr\changelog.pwn)
|
2019-01-02 10:20:40 +00:00
|
|
|
#define SERVER_PLS_DONATE_MP3 "http://files.sfcnr.com/game_sounds/pls_donate.mp3" // used for advertising vip (cnr\features\vip\coin_market.pwn)
|
|
|
|
#define SERVER_MIGRATIONS_FOLDER "./gamemodes/irresistible/config/migrations/cnr/" // used for migrations checking (config\migrations\_migrations.pwn)
|
2018-12-22 23:13:49 +00:00
|
|
|
|
2018-10-16 16:28:19 +00:00
|
|
|
/* ** Hooks ** */
|
|
|
|
hook OnScriptInit( )
|
|
|
|
{
|
2019-01-01 15:37:45 +00:00
|
|
|
// set server query information
|
2018-10-16 16:28:19 +00:00
|
|
|
SetGameModeText( SERVER_MODE_TEXT );
|
|
|
|
SetServerRule( "hostname", SERVER_NAME );
|
|
|
|
SetServerRule( "language", SERVER_LANGUAGE );
|
|
|
|
SetServerRule( "mapname", SERVER_MAP );
|
|
|
|
|
2019-01-01 15:37:45 +00:00
|
|
|
// simple gameplay rules
|
2018-10-16 16:28:19 +00:00
|
|
|
UsePlayerPedAnims( );
|
|
|
|
AllowInteriorWeapons( 0 );
|
|
|
|
EnableStuntBonusForAll( 0 );
|
|
|
|
DisableInteriorEnterExits( );
|
2019-01-01 15:37:45 +00:00
|
|
|
|
|
|
|
// enable mysql debugging on debug mode
|
|
|
|
#if defined DEBUG_MODE
|
|
|
|
mysql_log( LOG_ERROR | LOG_WARNING );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// start map andreas (if enabled)
|
|
|
|
#if defined MAP_ANDREAS_MODE_MINIMAL
|
|
|
|
MapAndreas_Init( MAP_ANDREAS_MODE_MINIMAL );
|
|
|
|
#endif
|
2018-10-16 16:28:19 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-10-10 02:51:56 +00:00
|
|
|
/* ** Functions ** */
|
2019-04-04 08:11:12 +00:00
|
|
|
stock IsPlayerLeadMaintainer( playerid ) // Limits money, coin, xp spawning to this user id
|
2018-10-16 15:59:36 +00:00
|
|
|
{
|
2019-05-29 13:05:13 +00:00
|
|
|
return GetPlayerAccountID( playerid ) == SERVER_OPERATOR_ACC_ID;
|
2018-10-10 02:51:56 +00:00
|
|
|
}
|
|
|
|
|
2019-04-04 08:11:12 +00:00
|
|
|
stock IsPlayerServerMaintainer( playerid ) // Same as lead maintainer, just cant spawn money/xp/coins
|
2018-10-10 02:51:56 +00:00
|
|
|
{
|
2019-04-04 08:11:12 +00:00
|
|
|
if ( IsPlayerLeadMaintainer( playerid ) )
|
|
|
|
return true;
|
2018-10-10 02:51:56 +00:00
|
|
|
|
2019-04-04 08:11:12 +00:00
|
|
|
// new account_id = GetPlayerAccountID( playerid );
|
|
|
|
// return account_id == -1;
|
|
|
|
return false;
|
2018-10-10 02:51:56 +00:00
|
|
|
}
|
2018-10-16 15:59:36 +00:00
|
|
|
|
2019-04-04 08:11:12 +00:00
|
|
|
stock IsPlayerUnderCover( playerid ) // Undercover accounts allow admin commands on a specific id unnoticed
|
2018-10-16 15:59:36 +00:00
|
|
|
{
|
2019-04-04 08:11:12 +00:00
|
|
|
if ( ! IsPlayerLoggedIn( playerid ) )
|
|
|
|
return false;
|
2018-10-16 15:59:36 +00:00
|
|
|
|
2019-04-04 08:11:12 +00:00
|
|
|
// new account_id = GetPlayerAccountID( playerid );
|
|
|
|
// return account_id == 1;
|
|
|
|
return false;
|
2018-10-16 15:59:36 +00:00
|
|
|
}
|