move billboards and trolley vehicles into its own modules

This commit is contained in:
Lorenc Pekaj 2019-01-02 03:09:36 +11:00
parent 70b04977ca
commit 9e699d8f9e
6 changed files with 78 additions and 25 deletions

View File

@ -133,7 +133,9 @@ CMD:vdestroy( playerid, params[ ] )
#if defined __cnr__chuffsec #if defined __cnr__chuffsec
if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." ); if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
#endif #endif
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." ); #if defined __cnr__trolley_car
if ( IsTrolleyVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
#endif
DestroyVehicle( vID ); DestroyVehicle( vID );
if ( g_adminSpawnedCar{ vID } ) g_adminSpawnedCar{ vID } = false; if ( g_adminSpawnedCar{ vID } ) g_adminSpawnedCar{ vID } = false;
SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have destroyed the vehicle you were using." ); SendClientMessage( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have destroyed the vehicle you were using." );
@ -144,7 +146,9 @@ CMD:vdestroy( playerid, params[ ] )
#if defined __cnr__chuffsec #if defined __cnr__chuffsec
else if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." ); else if ( IsVehicleSecurityVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
#endif #endif
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." ); #if defined __cnr__trolley_car
else if ( IsTrolleyVehicle( vID ) ) return SendError( playerid, "This vehicle is prohibited." );
#endif
else else
{ {
DestroyVehicle( vID ); DestroyVehicle( vID );

View File

@ -62,6 +62,8 @@
#include "irresistible\cnr\features\c4.pwn" #include "irresistible\cnr\features\c4.pwn"
#include "irresistible\cnr\features\tax.pwn" #include "irresistible\cnr\features\tax.pwn"
#include "irresistible\cnr\features\shamal.pwn" #include "irresistible\cnr\features\shamal.pwn"
#include "irresistible\cnr\features\billboards.pwn"
#include "irresistible\cnr\features\trolley_car.pwn"
// pool // pool
#include "irresistible\cnr\features\pool.pwn" #include "irresistible\cnr\features\pool.pwn"

View File

@ -0,0 +1,27 @@
/*
* Irresistible Gaming (c) 2018
* Developed by Lorenc
* Module: cnr\features\billboards.pwn
* Purpose: specially placed billboards to help user experience in the cities
*/
/* ** Includes ** */
#include < YSI\y_hooks >
/* ** Macros ** */
#define CreateBillboard(%0,%1,%2,%3,%4) \
SetDynamicObjectMaterialText( CreateDynamicObject( 7246, %1, %2, %3, 0, 0, %4 ), 0, (%0), 120, "Arial", 24, 0, -1, -16777216, 1 )
/* ** Hooks ** */
hook OnScriptInit( )
{
CreateBillboard( "Want V.I.P? Consider Donating!\n"COL_GREY"donate.sfcnr.com", -2016.22, 326.580, 37.950, 48.9000 );
CreateBillboard( "Save us on your favourites!\n"#SERVER_IP"", -1809.64, -590.29, 19.360, -147.30 );
CreateBillboard( "You can catch updates on our website!\n"COL_GREY""#SERVER_WEBSITE"", -1571.11, 939.860, 10.030, 45.9600 );
CreateBillboard( "Remember to check the "COL_GREY"/rules"COL_WHITE"!\nDisobeying the rules can lead to punishment!", -1911.05, 858.870, 36.290, 44.5200 );
CreateBillboard( "Want to view the commands?\n Use "COL_GREY"/commands{FFFFFF}!", -2423.40, -621.18, 135.46, -195.90 );
CreateBillboard( "Need help with something?\nUse "COL_GREY"/ask"COL_WHITE" to contact an admin!", -2659.78, 1277.70, 9.8600, 125.100 );
CreateBillboard( "Saw a cheater? Report him by typing "COL_GREY"/report{FFFFFF}!", -2443.63, 719.970, 37.900, 0.00000 );
CreateBillboard( "You can use "COL_GREY"/vipcmds"COL_WHITE" to view your\nV.I.P commands!", -1958.975830, 841.130798, 1208.881469, -43.700046 );
return 1;
}

View File

@ -0,0 +1,43 @@
/*
* Irresistible Gaming (c) 2018
* Developed by Lorenc
* Module: cnr\features\trolley_car.pwn
* Purpose: cool feature where there are drivable trolleys at supa-save ... o.g feature since 2012
*/
/* ** Includes ** */
#include < YSI\y_hooks >
/* ** Error Checking ** */
#if !defined __cnr__trolley_car
#define __cnr__trolley_car
#endif
/* ** Variables ** */
static stock
g_TrolleyVehicles [ 5 ] = { INVALID_VEHICLE_ID, ... };
/* ** Hooks ** */
hook OnScriptInit( )
{
// create gold cart
g_TrolleyVehicles[ 0 ] = AddStaticVehicle( 457, -2511.7935, 760.5610, 34.8990, 90.6223, 123, 1 ); // trolley
g_TrolleyVehicles[ 1 ] = AddStaticVehicle( 457, -2511.5742, 766.5329, 34.8990, 91.5108, 112, 1 ); // trolley
g_TrolleyVehicles[ 2 ] = AddStaticVehicle( 457, -2511.8782, 763.1669, 34.8990, 89.6839, 116, 1 ); // trolley
g_TrolleyVehicles[ 3 ] = AddStaticVehicle( 457, -2511.4871, 769.7538, 34.8990, 91.3486, 116, 1 ); // trolley
g_TrolleyVehicles[ 4 ] = AddStaticVehicle( 457, -2512.2607, 772.9983, 34.9006, 91.2577, 116, 1 ); // trolley
// set the golf cart to a trolley!
for ( new i = 0; i < sizeof( g_TrolleyVehicles ); i ++ ) {
ChangeVehicleModel( g_TrolleyVehicles[ i ], 1349, 270.0 + 180.0 );
}
return 1;
}
/* ** Functions ** */
stock IsTrolleyVehicle( vehicleid ) {
for ( new i = 0; i < sizeof( g_TrolleyVehicles ); i ++ ) if ( g_TrolleyVehicles[ i ] == vehicleid ) {
return true;
}
return false;
}

View File

@ -7,7 +7,6 @@
/* ** Variables ** */ /* ** Variables ** */
new new
g_TrolleyVehicles [ 5 ],
engine, lights, doors, bonnet, boot, objective, alarm, panels, tires, engine, lights, doors, bonnet, boot, objective, alarm, panels, tires,
g_ServerUptime = 0, g_ServerUptime = 0,
rl_ServerUpdate = 0xFF, rl_ServerUpdate = 0xFF,

View File

@ -58,7 +58,6 @@ native gpci ( playerid, serial[ ], len );
#define Ach_Unlock(%0,%1) (%0 >= %1 ?("{6EF83C}"):("{FFFFFF}")) #define Ach_Unlock(%0,%1) (%0 >= %1 ?("{6EF83C}"):("{FFFFFF}"))
#define Achievement:: ach_ #define Achievement:: ach_
#define CreateBillboard(%0,%1,%2,%3,%4) SetDynamicObjectMaterialText(CreateDynamicObject(7246,%1,%2,%3,0,0,%4),0,(%0),120,"Arial",24,0,-1,-16777216,1)
#define MAX_TIME_TIED 180 #define MAX_TIME_TIED 180
#define MAX_VEH_ATTACHED_OBJECTS 2 #define MAX_VEH_ATTACHED_OBJECTS 2
@ -87,27 +86,6 @@ public OnGameModeInit()
AddServerVariable( "connectsong", "http://files.sfcnr.com/game_sounds/Stevie%20Wonder%20-%20Skeletons.mp3", GLOBAL_VARTYPE_STRING ); AddServerVariable( "connectsong", "http://files.sfcnr.com/game_sounds/Stevie%20Wonder%20-%20Skeletons.mp3", GLOBAL_VARTYPE_STRING );
AddServerVariable( "discordurl", "http://sfcnr.com/discord", GLOBAL_VARTYPE_STRING ); AddServerVariable( "discordurl", "http://sfcnr.com/discord", GLOBAL_VARTYPE_STRING );
/* ** Custom Vehicles ** */
g_TrolleyVehicles[ 0 ] = AddStaticVehicle( 457, -2511.7935, 760.5610, 34.8990, 90.6223, 123, 1 ); // trolley
g_TrolleyVehicles[ 1 ] = AddStaticVehicle( 457, -2511.5742, 766.5329, 34.8990, 91.5108, 112, 1 ); // trolley
g_TrolleyVehicles[ 2 ] = AddStaticVehicle( 457, -2511.8782, 763.1669, 34.8990, 89.6839, 116, 1 ); // trolley
g_TrolleyVehicles[ 3 ] = AddStaticVehicle( 457, -2511.4871, 769.7538, 34.8990, 91.3486, 116, 1 ); // trolley
g_TrolleyVehicles[ 4 ] = AddStaticVehicle( 457, -2512.2607, 772.9983, 34.9006, 91.2577, 116, 1 ); // trolley
for( new i; i < sizeof( g_TrolleyVehicles ); i++ )
ChangeVehicleModel( g_TrolleyVehicles[ i ], 1349, 270.0 + 180.0 );
/* ** Objects ** */
// Billboards
CreateBillboard( "Want V.I.P? Consider Donating!\n"COL_GREY"donate.sfcnr.com", -2016.22, 326.580, 37.950, 48.9000 );
CreateBillboard( "Save us on your favourites!\n"#SERVER_IP"", -1809.64, -590.29, 19.360, -147.30 );
CreateBillboard( "You can catch updates on our website!\n"COL_GREY""#SERVER_WEBSITE"", -1571.11, 939.860, 10.030, 45.9600 );
CreateBillboard( "Remember to check the "COL_GREY"/rules"COL_WHITE"!\nDisobeying the rules can lead to punishment!", -1911.05, 858.870, 36.290, 44.5200 );
CreateBillboard( "Want to view the commands?\n Use "COL_GREY"/commands{FFFFFF}!", -2423.40, -621.18, 135.46, -195.90 );
CreateBillboard( "Need help with something?\nUse "COL_GREY"/ask"COL_WHITE" to contact an admin!", -2659.78, 1277.70, 9.8600, 125.100 );
CreateBillboard( "Saw a cheater? Report him by typing "COL_GREY"/report{FFFFFF}!", -2443.63, 719.970, 37.900, 0.00000 );
CreateBillboard( "You can use "COL_GREY"/vipcmds"COL_WHITE" to view your\nV.I.P commands!", -1958.975830, 841.130798, 1208.881469, -43.700046 );
/* ** Set everyone offline ** */ /* ** Set everyone offline ** */
mysql_single_query( "UPDATE `USERS` SET `ONLINE` = 0" ); mysql_single_query( "UPDATE `USERS` SET `ONLINE` = 0" );