From cc621872c43a49cac17bf62204cd3185200a4ed2 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 24 Nov 2018 03:03:45 +1100 Subject: [PATCH] remove paramedic and make specific items a minijob (e.g healing in truck/spraycan) --- gamemodes/irresistible/cnr/classes.pwn | 37 +--- .../cnr/features/minijobs/_minijobs.pwn | 1 + .../cnr/features/minijobs/paramedic.pwn | 184 ++++++++++++++++ gamemodes/irresistible/cnr/player.pwn | 4 - gamemodes/irresistible/cnr/spawn.pwn | 16 +- gamemodes/sf-cnr.pwn | 206 +----------------- 6 files changed, 202 insertions(+), 246 deletions(-) create mode 100644 gamemodes/irresistible/cnr/features/minijobs/paramedic.pwn diff --git a/gamemodes/irresistible/cnr/classes.pwn b/gamemodes/irresistible/cnr/classes.pwn index 6ec2e8b..b29566c 100644 --- a/gamemodes/irresistible/cnr/classes.pwn +++ b/gamemodes/irresistible/cnr/classes.pwn @@ -15,7 +15,6 @@ #define CLASS_CIVILIAN ( 0 ) #define CLASS_POLICE ( 1 ) #define CLASS_FIREMAN ( 2 ) -#define CLASS_MEDIC ( 3 ) #define MAX_CLASS_BAN_WARNS ( 3 ) @@ -27,8 +26,8 @@ static const Float: default_Angle = 0.0 ; -static const CLASS_NAMES [ ] [ ] = { "Civilian", "Police", "FBI", "Army", "CIA", "Paramedic", "Fireman" }; -static const CLASS_COLORS [ ] = { 0xC0C0C0FF, 0x3E7EFFFF, 0x0035FFFF, 0x954BFFFF, 0x191970FF, 0x4DFF4DFF, 0xA83434FF }; +static const CLASS_NAMES [ ] [ ] = { "Civilian", "Police", "FBI", "Army", "CIA", "Fireman" }; +static const CLASS_COLORS [ ] = { 0xC0C0C0FF, 0x3E7EFFFF, 0x0035FFFF, 0x954BFFFF, 0x191970FF, 0xA83434FF }; /* ** Variables ** */ static stock @@ -37,7 +36,6 @@ static stock CLASS_FBI_RANGE [ 2 ], CLASS_CIA_RANGE [ 2 ], CLASS_FIRE_RANGE [ 2 ], - CLASS_MEDIC_RANGE [ 2 ], CLASS_ARMY_RANGE ; @@ -105,7 +103,11 @@ hook OnScriptInit( ) AddPlayerClass( 134, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 46 AddPlayerClass( 100, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 47 AddPlayerClass( 101, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 48 - CLASS_CIVILIAN_RANGE[ 1 ] = AddPlayerClass( 137, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 49 + AddPlayerClass( 137, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 49 + AddPlayerClass( 274, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 60 + AddPlayerClass( 275, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 61 + AddPlayerClass( 276, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 62 + CLASS_CIVILIAN_RANGE[ 1 ] = AddPlayerClass( 308, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 63 /* ** FBI ** */ CLASS_FBI_RANGE[ 0 ] = AddPlayerClass( 286, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 50 @@ -125,12 +127,6 @@ hook OnScriptInit( ) AddPlayerClass( 278, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 58 CLASS_FIRE_RANGE[ 1 ] = AddPlayerClass( 279, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 59 - /* ** MEDIC ** */ - CLASS_MEDIC_RANGE[ 0 ] = AddPlayerClass( 274, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 60 - AddPlayerClass( 275, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 61 - AddPlayerClass( 276, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 62 - CLASS_MEDIC_RANGE[ 1 ] = AddPlayerClass( 308, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 63 - /* ** POLICE ** */ CLASS_POLICE_RANGE[ 0 ] = AddPlayerClass( 265, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 66 AddPlayerClass( 266, default_X, default_Y, default_Z, default_Angle, 0, 0, 0, 0, 0, 0 ); // 67 @@ -211,12 +207,6 @@ hook OnScriptInit( ) "~r~~h~- Requires 15,000 XP or more" ); } case 5: { - strcat( szLargeString, "- Can heal and cure players~n~" \ - "- Ambulance passengers pay you~n~"\ - "- Able to rob stores and players~n~" \ - "~r~~h~- Requires 1,000 XP or more" ); - } - case 6: { strcat( szLargeString, "- Protect the city from fires~n~" \ "- Firetrucks able to extinguish fires~n~"\ "- Able to rob stores and players~n~" \ @@ -356,16 +346,6 @@ hook OnPlayerRequestClass( playerid, classid ) p_inCIA{ playerid } = false; ShowPlayerClassTextdraw( playerid, 6 ); } - else if ( CLASS_MEDIC_RANGE[ 0 ] <= classid <= CLASS_MEDIC_RANGE[ 1 ] ) - { - p_Class[ playerid ] = ( CLASS_MEDIC ); - SetPlayerColor( playerid, COLOR_MEDIC ); - //SetPlayerTeam( playerid, NO_TEAM ); - p_inFBI{ playerid } = false; - p_inArmy{ playerid } = false; - p_inCIA{ playerid } = false; - ShowPlayerClassTextdraw( playerid, 5 ); - } return 1; } @@ -432,9 +412,6 @@ stock IsPlayerClassApproved( playerid ) { if ( IsPlayerFireman( playerid ) && total_experience < 1000.0 ) return SendClientMessage( playerid, -1, ""COL_RED"[ERROR]"COL_WHITE" You need 1,000 Total XP to use this class." ), 0; - if ( IsPlayerMedic( playerid ) && total_experience < 2000.0 ) - return SendClientMessage( playerid, -1, ""COL_RED"[ERROR]"COL_WHITE" You need 2,000 Total XP to use this class." ), 0; - // job not set if ( ! p_JobSet{ playerid } ) // || !p_CitySet{ playerid } ) return SendClientMessage( playerid, -1, ""COL_RED"[ERROR]"COL_WHITE" You must ensure your job have been properly set." ), 0; // and city diff --git a/gamemodes/irresistible/cnr/features/minijobs/_minijobs.pwn b/gamemodes/irresistible/cnr/features/minijobs/_minijobs.pwn index d22b965..a3d8ff3 100644 --- a/gamemodes/irresistible/cnr/features/minijobs/_minijobs.pwn +++ b/gamemodes/irresistible/cnr/features/minijobs/_minijobs.pwn @@ -12,3 +12,4 @@ #include "irresistible\cnr\features\minijobs\pilot.pwn" #include "irresistible\cnr\features\minijobs\traindriver.pwn" #include "irresistible\cnr\features\minijobs\lumberjack.pwn" +#include "irresistible\cnr\features\minijobs\paramedic.pwn" diff --git a/gamemodes/irresistible/cnr/features/minijobs/paramedic.pwn b/gamemodes/irresistible/cnr/features/minijobs/paramedic.pwn new file mode 100644 index 0000000..9944086 --- /dev/null +++ b/gamemodes/irresistible/cnr/features/minijobs/paramedic.pwn @@ -0,0 +1,184 @@ +/* + * Irresistible Gaming (c) 2018 + * Developed by Lorenc Pekaj + * Module: cnr\features\minijobs\paramedic.pwn + * Purpose: a paramedic minijob where people can heal with spraycans or ambulance trucks + */ + +/* ** Includes ** */ +#include < YSI\y_hooks > + +/* ** Definitions ** */ +DEFINE_HOOK_REPLACEMENT ( Damage, Dmg ); + +/* ** Variables ** */ +/*static stock + p_CureDealer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... }, + p_CureTick [ MAX_PLAYERS ], + p_HealDealer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... }, + p_HealTick [ MAX_PLAYERS ], + p_LastCuredTS [ MAX_PLAYERS ], + p_LastHealedTS [ MAX_PLAYERS ] +;*/ + +/* ** Hooks ** */ +#if defined AC_INCLUDED +hook OnPlayerTakePlayerDmg( playerid, issuerid, &Float: amount, weaponid, bodypart ) +{ + // Heal player (paramedic) + if ( weaponid == WEAPON_SPRAYCAN ) + { + new + Float: fHealth = AC_GetPlayerHealth( playerid ); + + if ( fHealth < 100.0 ) { + AC_AddPlayerHealth( playerid, amount ); + } + return 0; + } + return 1; +} +#endif + +hook OnPlayerUpdateEx( playerid ) +{ + new + iVehicle = GetPlayerVehicleID( playerid ); + + if ( iVehicle ) + { + if ( GetPlayerState( playerid ) == PLAYER_STATE_PASSENGER ) + { + if ( GetVehicleModel( iVehicle ) == 416 ) + { + new + iDriver = GetVehicleDriver( iVehicle ); + + if ( IsPlayerConnected( iDriver ) ) + { + new + Float: fHealth; + + if ( GetPlayerHealth( playerid, fHealth ) && fHealth < 100.0 ) { + SetPlayerHealth( playerid, fHealth + 2.0 ), GivePlayerCash( iDriver, 10 ); + } + } + } + } + } + return 1; +} + +/*hook OnPlayerDisconnect( playerid, reason ) +{ + p_HealDealer[ playerid ] = INVALID_PLAYER_ID; + return 1; +}*/ + +/* ** Commands ** */ +/*CMD:cure( playerid, params[ ] ) +{ + new + pID, + time = g_iTime + ; + + if ( p_Class[ playerid ] != CLASS_MEDIC ) return SendError( playerid, "This is restricted to medics only." ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/cure [PLAYER_ID]" ); + else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( !IsPlayerConnected( pID ) ) return SendError( playerid, "This player is not connected." ); + else if ( playerid == pID ) return SendError( playerid, "You cannot offer to cure yourself." ); + else if ( GetPlayerCash( pID ) < 4875 ) return SendError( playerid, "This player doesn't have enough money to get a cure." ); + else if ( GetDistanceBetweenPlayers( playerid, pID ) < 4.0 ) + { + if ( IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player is in a vehicle " ); + if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); + if ( p_LastCuredTS[ playerid ] > time ) return SendError( playerid, "You must wait another %d seconds before curing somebody.", p_LastCuredTS[ playerid ] - time ); + SendClientMessageFormatted( pID, -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} %s(%d) wishes to cure you for $4,875. "COL_ORANGE"/acceptcure{FFFFFF} to accept the deal.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} You have offered %s(%d) a cure for $4875.", ReturnPlayerName( pID ), pID ); + p_CureDealer[ pID ] = playerid; + p_CureTick[ pID ] = time + 120; + } + else SendError( playerid, "This player is not nearby." ); + return 1; +} + +CMD:ac( playerid, params[ ] ) return cmd_acceptcure( playerid, params ); +CMD:acceptcure( playerid, params[ ] ) +{ + new + time = g_iTime; + + if ( !IsPlayerConnected( p_CureDealer[ playerid ] ) ) return SendError( playerid, "Your dealer isn't connected anymore." ); + else if ( time > p_CureTick[ playerid ] ) return p_CureDealer[ playerid ] = INVALID_PLAYER_ID, SendError( playerid, "This deal has ended, each deal goes for 2 minutes maximum. You were late." ); + else if ( GetPlayerCash( playerid ) < 4875 ) return SendError( playerid, "You do not have enough money to get a cure." ); + else if ( p_Jailed{ playerid } ) return SendError( playerid, "You cannot buy cures while you're in jail." ); + else if ( p_Class[ p_CureDealer[ playerid ] ] != CLASS_MEDIC ) return SendError( playerid, "The paramedic that offered you is no longer a paramedic." ); + else + { + Beep( p_CureDealer[ playerid ] ); + SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} You have been cured from all diseases by %s(%d) for $4,875. ", ReturnPlayerName( p_CureDealer[ playerid ] ), p_CureDealer[ playerid ] ); + SendClientMessageFormatted( p_CureDealer[ playerid ], -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} %s(%d) has paid and got himself cured.", ReturnPlayerName( playerid ), playerid ); p_InfectedHIV{ playerid } = false; + GivePlayerCash( playerid, -4875 ); + GivePlayerCash( p_CureDealer[ playerid ], 4875 ); + GivePlayerScore( p_CureDealer[ playerid ], 2 ); + //GivePlayerExperience( p_CureDealer[ playerid ], E_PARAMEDIC ); + p_LastCuredTS[ p_CureDealer[ playerid ] ] = time + 15; + p_CureDealer[ playerid ] = INVALID_PLAYER_ID; + } + return 1; +} + +CMD:heal( playerid, params[ ] ) +{ + new + pID; + + if ( p_Class[ playerid ] != CLASS_MEDIC ) return SendError( playerid, "This is restricted to medics only." ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/heal [PLAYER_ID]" ); + else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); + else if ( !IsPlayerConnected( pID ) ) return SendError( playerid, "This player is not connected." ); + else if ( playerid == pID ) return SendError( playerid, "You cannot offer to heal yourself." ); + else if ( GetPlayerCash( pID ) < 750 ) return SendError( playerid, "This player doesn't have enough money to get a health refill." ); + else if ( GetDistanceBetweenPlayers( playerid, pID ) < 4.0 ) + { + if ( IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player is in a vehicle " ); + if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); + if ( p_LastHealedTS[ playerid ] > g_iTime ) return SendError( playerid, "You must wait another %d seconds before curing somebody.", p_LastHealedTS[ playerid ] - g_iTime ); + SendClientMessageFormatted( pID, -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} %s(%d) wishes to heal you for $1,200. "COL_ORANGE"/acceptheal{FFFFFF} to accept the deal.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} You have offered %s(%d) a health refill for $1,200.", ReturnPlayerName( pID ), pID ); + p_HealDealer[ pID ] = playerid; + p_HealTick[ pID ] = g_iTime + 120; + } + else SendError( playerid, "This player is not nearby." ); + return 1; +} + +CMD:ah( playerid, params[ ] ) return cmd_acceptheal( playerid, params ); +CMD:acceptheal( playerid, params[ ] ) +{ + new + Float: fHealth; + + if ( !IsPlayerConnected( p_HealDealer[ playerid ] ) ) return SendError( playerid, "Your dealer isn't connected anymore." ); + else if ( g_iTime > p_HealTick[ playerid ] ) return p_HealDealer[ playerid ] = INVALID_PLAYER_ID, SendError( playerid, "This deal has ended, each deal goes for 2 minutes maximum. You were late." ); + else if ( GetPlayerCash( playerid ) < 750 ) return SendError( playerid, "You do not have enough money to get a health refill." ); + else if ( p_Jailed{ playerid } ) return SendError( playerid, "You cannot buy heals while you're in jail." ); + else if ( p_Class[ p_HealDealer[ playerid ] ] != CLASS_MEDIC ) return SendError( playerid, "The paramedic that offered you is no longer a paramedic." ); + else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); + else if ( GetPlayerHealth( playerid, fHealth ) && fHealth >= 90.0 ) return SendError( playerid, "You need to have less than 90 percent of your health to be healed." ); + else + { + Beep( p_HealDealer[ playerid ] ); + SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} You have patched up and healed by %s(%d) for $1,200. ", ReturnPlayerName( p_HealDealer[ playerid ] ), p_HealDealer[ playerid ] ); + SendClientMessageFormatted( p_HealDealer[ playerid ], -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} %s(%d) has paid and got his health refilled.", ReturnPlayerName( playerid ), playerid ); + SetPlayerHealth( playerid, 120.0 ); + GivePlayerCash( playerid, -1200 ); + GivePlayerCash( p_HealDealer[ playerid ], 1200 ); + GivePlayerScore( p_HealDealer[ playerid ], 2 ); + //GivePlayerExperience( p_HealDealer[ playerid ], E_PARAMEDIC ); + p_LastHealedTS[ p_HealDealer[ playerid ] ] = g_iTime + 15; + p_HealDealer[ playerid ] = INVALID_PLAYER_ID; + } + return 1; +}*/ diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 2f97e3f..165a0b4 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -56,10 +56,6 @@ new p_Deaths [ MAX_PLAYERS ], p_VIPLevel [ MAX_PLAYERS ], // p_XP [ MAX_PLAYERS ], - p_CureDealer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... }, - p_CureTick [ MAX_PLAYERS ], - p_HealDealer [ MAX_PLAYERS ] = { INVALID_PLAYER_ID, ... }, - p_HealTick [ MAX_PLAYERS ], bool: p_Spectating [ MAX_PLAYERS char ], bool: p_Muted [ MAX_PLAYERS char ], bool: p_InfectedHIV [ MAX_PLAYERS char ], diff --git a/gamemodes/irresistible/cnr/spawn.pwn b/gamemodes/irresistible/cnr/spawn.pwn index 04aa012..2c71e9e 100644 --- a/gamemodes/irresistible/cnr/spawn.pwn +++ b/gamemodes/irresistible/cnr/spawn.pwn @@ -49,7 +49,8 @@ new const { -1983.5684, 129.8655, 27.6875, 74.4550, 0, 0 }, { -2626.2156, 1398.626, 7.1016, 204.5252, 0, 0 }, { -2626.2156, 1398.626, 7.1016, 204.5252, 0, 0 }, - { -2587.4861, 212.0579, 9.0733, 9.073300, 0, 0 } + { -2587.4861, 212.0579, 9.0733, 9.073300, 0, 0 }, + { -2658.0764, 634.333, 14.4531, 180.0000, 0, 0 } }, g_LasVenturasSpawns[ ] [ E_RANDOM_SPAWNS ] = @@ -61,7 +62,8 @@ new const { 2464.4070, 2033.2441, 11.0625, 47.88940, 0, 0 }, { 2451.2332, 2347.0044, 12.1635, 112.7286, 0, 0 }, { 1480.3296, 2250.1125, 11.0291, 279.2149, 0, 0 }, - { 2143.3252, 2840.4441, 10.8203, 139.9116, 0, 0 } + { 2143.3252, 2840.4441, 10.8203, 139.9116, 0, 0 }, + { 1615.62490, 1840.19, 10.9696, 0.000000, 0, 0 } }, g_LosSantosSpawns [ ] [ E_RANDOM_SPAWNS ] = @@ -75,7 +77,8 @@ new const { 2017.8206, -1279.4851, 23.9820, 47.38920, 0, 0 }, { 1935.7644, -1794.6068, 13.5469, 295.5515, 0, 0 }, { 1371.4569, -1090.6387, 24.5459, 92.84640, 0, 0 }, - { 2298.4055, -1500.3264, 25.3047, 199.6940, 0, 0 } + { 2298.4055, -1500.3264, 25.3047, 199.6940, 0, 0 }, + { 1178.0417, -1323.6000, 14.1005, 285.5701, 0, 0 } }, g_FiremanSpawns [ MAX_CITIES ] [ E_RANDOM_SPAWNS ] = @@ -85,13 +88,6 @@ new const { 1757.44350, -1456.7, 13.5469, 282.4133, 0, 0 } }, - g_MedicSpawns [ MAX_CITIES ] [ E_RANDOM_SPAWNS ] = - { - { -2658.0764, 634.333, 14.4531, 180.0000, 0, 0 }, - { 1615.62490, 1840.19, 10.9696, 0.000000, 0, 0 }, - { 1178.04170, -1323.6, 14.1005, 285.5701, 0, 0 } - }, - g_ArmySpawns [ MAX_CITIES ] [ E_RANDOM_SPAWNS ] = { { -1401.8173, 493.496, 18.2294, 0.000000, 0, 0 }, diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 25c26ec..37ca4ad 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -72,8 +72,6 @@ new bool: False = false; /* Beast Functions */ #define SendClientMessageToVips(%1,%2,%3) \ do{foreach(new fI : Player){if (p_VIPLevel[fI]>=VIP_REGULAR)format(szNormalString,sizeof(szNormalString),(%2),%3),SendClientMessage(fI,(%1),szNormalString);}}while(False) -#define SendClientMessageToAmbulance(%1,%2,%3) \ - do{foreach(new fI : Player){if (p_Class[fI]==CLASS_MEDIC)format(szNormalString,sizeof(szNormalString),(%2),%3),SendClientMessage(fI,(%1),szNormalString);}}while(False) #define DCC_SendChannelMessageFormatted(%0,%1,%2) \ do{format(szNormalString,sizeof(szNormalString),(%1),%2),DCC_SendChannelMessage(%0,szNormalString);}while(False) @@ -562,7 +560,7 @@ public OnGameModeExit( ) public OnServerUpdateTimer( ) { static - iState, iVehicle, iWeapon, iAmmo, + iState, iWeapon, iAmmo, Float: fLastRate ; @@ -611,7 +609,6 @@ public OnServerUpdateTimer( ) if ( IsPlayerSpawned( playerid ) && p_PlayerLogged{ playerid } ) { - iVehicle = GetPlayerVehicleID( playerid ); iWeapon = GetPlayerWeapon( playerid ); iState = GetPlayerState( playerid ); @@ -804,30 +801,6 @@ public OnServerUpdateTimer( ) GivePlayerMoney( playerid, GetPlayerCash( playerid ) ); } - if ( IsPlayerInAnyVehicle( playerid ) ) - { - if ( iState == PLAYER_STATE_PASSENGER ) - { - if ( GetVehicleModel( iVehicle ) == 416 ) - { - new - iDriver = GetVehicleDriver( iVehicle ); - - if ( IsPlayerConnected( iDriver ) ) - { - if ( p_Class[ iDriver ] == CLASS_MEDIC ) - { - new - Float: fHealth; - - if ( GetPlayerHealth( playerid, fHealth ) && fHealth < 100.0 ) - SetPlayerHealth( playerid, fHealth + 2.0 ), GivePlayerCash( iDriver, 10 ); - } - } - } - } - } - if ( p_AdminLevel[ playerid ] < 1 ) { /* ANTICHEAT */ @@ -1369,7 +1342,6 @@ public OnPlayerDisconnect( playerid, reason ) p_BailOfferer [ playerid ] = INVALID_PLAYER_ID; p_PmResponder [ playerid ] = INVALID_PLAYER_ID; p_ViewingStats [ playerid ] = INVALID_PLAYER_ID; - p_HealDealer [ playerid ] = INVALID_PLAYER_ID; p_Spectating { playerid } = false; p_TicketIssuer [ playerid ] = INVALID_PLAYER_ID; //p_DetainedBy [ playerid ] = INVALID_PLAYER_ID; @@ -1698,13 +1670,6 @@ public OnPlayerSpawn( playerid ) GivePlayerWeapon( playerid, 9, 1 ); GivePlayerWeapon( playerid, 42, 0xFFFF ); } - - case CLASS_MEDIC: - { - GivePlayerWeapon( playerid, 23, 250 ); - GivePlayerWeapon( playerid, 25, 50 ); - GivePlayerWeapon( playerid, 41, 200 ); - } } } @@ -1956,18 +1921,6 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b if ( p_Class[ issuerid ] == CLASS_POLICE && p_Class[ playerid ] != CLASS_POLICE && !p_WantedLevel[ playerid ] && GetPlayerState( playerid ) != PLAYER_STATE_WASTED && ! IsPlayerInEvent( issuerid ) ) return ShowPlayerHelpDialog( issuerid, 2000, "You cannot hurt innocent civilians, you're a ~b~cop~w~~h~!" ), 0; - // Heal player (paramedic) - if ( p_Class[ issuerid ] == CLASS_MEDIC && weaponid == WEAPON_SPRAYCAN ) - { - new - Float: fHealth = AC_GetPlayerHealth( playerid ); - - if ( fHealth < 100.0 ) - AC_AddPlayerHealth( playerid, amount ); - - return 0; - } - if ( p_Class[ playerid ] == p_Class[ issuerid ] && p_Class[ playerid ] != CLASS_CIVILIAN ) return 0; @@ -2611,12 +2564,6 @@ public OnPlayerText( playerid, text[ ] ) return 0; } - else if ( p_Class[ playerid ] == CLASS_MEDIC ) - { - SendClientMessageToAmbulance( -1, "{00CC00} %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, text[ 1 ] ); - return 0; - } - else if ( p_Class[ playerid ] == CLASS_CIVILIAN && p_GangID[ playerid ] != INVALID_GANG_ID ) { SendClientMessageToGang( p_GangID[ playerid ], g_gangData[ p_GangID[ playerid ] ] [ E_COLOR ], " %s(%d):{FFFFFF} %s", ReturnPlayerName( playerid ), playerid, text[ 1 ] ); @@ -3005,10 +2952,6 @@ CMD:t( playerid, params[ ] ) { SendClientMessageToFireman( -1, "{A83434} %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, msg ); } - else if ( p_Class[ playerid ] == CLASS_MEDIC ) - { - SendClientMessageToAmbulance( -1, "{00CC00} %s(%d):"COL_WHITE" %s", ReturnPlayerName( playerid ), playerid, msg ); - } } return 1; } @@ -3714,116 +3657,6 @@ CMD:nametags( playerid, params[ ] ) return 1; } -new p_LastCuredTS[ MAX_PLAYERS ]; -new p_LastHealedTS[ MAX_PLAYERS ]; - -CMD:cure( playerid, params[ ] ) -{ - new - pID, - time = g_iTime - ; - - if ( p_Class[ playerid ] != CLASS_MEDIC ) return SendError( playerid, "This is restricted to medics only." ); - else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/cure [PLAYER_ID]" ); - else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( !IsPlayerConnected( pID ) ) return SendError( playerid, "This player is not connected." ); - else if ( playerid == pID ) return SendError( playerid, "You cannot offer to cure yourself." ); - else if ( GetPlayerCash( pID ) < 4875 ) return SendError( playerid, "This player doesn't have enough money to get a cure." ); - else if ( GetDistanceBetweenPlayers( playerid, pID ) < 4.0 ) - { - if ( IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player is in a vehicle " ); - if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); - if ( p_LastCuredTS[ playerid ] > time ) return SendError( playerid, "You must wait another %d seconds before curing somebody.", p_LastCuredTS[ playerid ] - time ); - SendClientMessageFormatted( pID, -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} %s(%d) wishes to cure you for $4,875. "COL_ORANGE"/acceptcure{FFFFFF} to accept the deal.", ReturnPlayerName( playerid ), playerid ); - SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} You have offered %s(%d) a cure for $4875.", ReturnPlayerName( pID ), pID ); - p_CureDealer[ pID ] = playerid; - p_CureTick[ pID ] = time + 120; - } - else SendError( playerid, "This player is not nearby." ); - return 1; -} - -CMD:ac( playerid, params[ ] ) return cmd_acceptcure( playerid, params ); -CMD:acceptcure( playerid, params[ ] ) -{ - new - time = g_iTime; - - if ( !IsPlayerConnected( p_CureDealer[ playerid ] ) ) return SendError( playerid, "Your dealer isn't connected anymore." ); - else if ( time > p_CureTick[ playerid ] ) return p_CureDealer[ playerid ] = INVALID_PLAYER_ID, SendError( playerid, "This deal has ended, each deal goes for 2 minutes maximum. You were late." ); - else if ( GetPlayerCash( playerid ) < 4875 ) return SendError( playerid, "You do not have enough money to get a cure." ); - else if ( p_Jailed{ playerid } ) return SendError( playerid, "You cannot buy cures while you're in jail." ); - else if ( p_Class[ p_CureDealer[ playerid ] ] != CLASS_MEDIC ) return SendError( playerid, "The paramedic that offered you is no longer a paramedic." ); - else - { - Beep( p_CureDealer[ playerid ] ); - SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} You have been cured from all diseases by %s(%d) for $4,875. ", ReturnPlayerName( p_CureDealer[ playerid ] ), p_CureDealer[ playerid ] ); - SendClientMessageFormatted( p_CureDealer[ playerid ], -1, ""COL_ORANGE"[DISEASE CURE]{FFFFFF} %s(%d) has paid and got himself cured.", ReturnPlayerName( playerid ), playerid ); p_InfectedHIV{ playerid } = false; - GivePlayerCash( playerid, -4875 ); - GivePlayerCash( p_CureDealer[ playerid ], 4875 ); - GivePlayerScore( p_CureDealer[ playerid ], 2 ); - //GivePlayerExperience( p_CureDealer[ playerid ], E_PARAMEDIC ); - p_LastCuredTS[ p_CureDealer[ playerid ] ] = time + 15; - p_CureDealer[ playerid ] = INVALID_PLAYER_ID; - } - return 1; -} - -CMD:heal( playerid, params[ ] ) -{ - new - pID; - - if ( p_Class[ playerid ] != CLASS_MEDIC ) return SendError( playerid, "This is restricted to medics only." ); - else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/heal [PLAYER_ID]" ); - else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); - else if ( !IsPlayerConnected( pID ) ) return SendError( playerid, "This player is not connected." ); - else if ( playerid == pID ) return SendError( playerid, "You cannot offer to heal yourself." ); - else if ( GetPlayerCash( pID ) < 750 ) return SendError( playerid, "This player doesn't have enough money to get a health refill." ); - else if ( GetDistanceBetweenPlayers( playerid, pID ) < 4.0 ) - { - if ( IsPlayerInAnyVehicle( pID ) ) return SendError( playerid, "This player is in a vehicle " ); - if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." ); - if ( p_LastHealedTS[ playerid ] > g_iTime ) return SendError( playerid, "You must wait another %d seconds before curing somebody.", p_LastHealedTS[ playerid ] - g_iTime ); - SendClientMessageFormatted( pID, -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} %s(%d) wishes to heal you for $1,200. "COL_ORANGE"/acceptheal{FFFFFF} to accept the deal.", ReturnPlayerName( playerid ), playerid ); - SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} You have offered %s(%d) a health refill for $1,200.", ReturnPlayerName( pID ), pID ); - p_HealDealer[ pID ] = playerid; - p_HealTick[ pID ] = g_iTime + 120; - } - else SendError( playerid, "This player is not nearby." ); - return 1; -} - -CMD:ah( playerid, params[ ] ) return cmd_acceptheal( playerid, params ); -CMD:acceptheal( playerid, params[ ] ) -{ - new - Float: fHealth; - - if ( !IsPlayerConnected( p_HealDealer[ playerid ] ) ) return SendError( playerid, "Your dealer isn't connected anymore." ); - else if ( g_iTime > p_HealTick[ playerid ] ) return p_HealDealer[ playerid ] = INVALID_PLAYER_ID, SendError( playerid, "This deal has ended, each deal goes for 2 minutes maximum. You were late." ); - else if ( GetPlayerCash( playerid ) < 750 ) return SendError( playerid, "You do not have enough money to get a health refill." ); - else if ( p_Jailed{ playerid } ) return SendError( playerid, "You cannot buy heals while you're in jail." ); - else if ( p_Class[ p_HealDealer[ playerid ] ] != CLASS_MEDIC ) return SendError( playerid, "The paramedic that offered you is no longer a paramedic." ); - else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." ); - else if ( GetPlayerHealth( playerid, fHealth ) && fHealth >= 90.0 ) return SendError( playerid, "You need to have less than 90 percent of your health to be healed." ); - else - { - Beep( p_HealDealer[ playerid ] ); - SendClientMessageFormatted( playerid, -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} You have patched up and healed by %s(%d) for $1,200. ", ReturnPlayerName( p_HealDealer[ playerid ] ), p_HealDealer[ playerid ] ); - SendClientMessageFormatted( p_HealDealer[ playerid ], -1, ""COL_ORANGE"[HEALTH REFILL]{FFFFFF} %s(%d) has paid and got his health refilled.", ReturnPlayerName( playerid ), playerid ); - SetPlayerHealth( playerid, 120.0 ); - GivePlayerCash( playerid, -1200 ); - GivePlayerCash( p_HealDealer[ playerid ], 1200 ); - GivePlayerScore( p_HealDealer[ playerid ], 2 ); - //GivePlayerExperience( p_HealDealer[ playerid ], E_PARAMEDIC ); - p_LastHealedTS[ p_HealDealer[ playerid ] ] = g_iTime + 15; - p_HealDealer[ playerid ] = INVALID_PLAYER_ID; - } - return 1; -} - CMD:admins( playerid, params[ ] ) { if ( GetPlayerScore( playerid ) < 500 && !IsPlayerUnderCover( playerid ) && p_AdminLevel[ playerid ] < 1 ) @@ -4257,7 +4090,7 @@ CMD:idof( playerid, params[ ] ) CMD:playercolor( playerid, params[ ] ) return cmd_pc( playerid, params ); CMD:pc( playerid, params[ ] ) { - ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Player Colors", "Innocent\n{FFEC41}Low Suspect\n"COL_ORANGE"Wanted\n{F83245}Most Wanted\n{3E7EFF}Police\n{0035FF}F.B.I\n{191970}C.I.A\n{954BFF}Army\n{A83434}Fireman\n{00CC00}Paramedic\n"COL_PINK"Admin On Duty\n"COL_GREY"Other Colors Are Gang Colors", "Okay", "" ); + ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_LIST, "{FFFFFF}Player Colors", "Innocent\n{FFEC41}Low Suspect\n"COL_ORANGE"Wanted\n{F83245}Most Wanted\n{3E7EFF}Police\n{0035FF}F.B.I\n{191970}C.I.A\n{954BFF}Army\n{A83434}Fireman\n"COL_PINK"Admin On Duty\n"COL_GREY"Other Colors Are Gang Colors", "Okay", "" ); return 1; } @@ -5210,7 +5043,7 @@ CMD:tips( playerid, params[ ] ) CMD:commands( playerid, params[ ] ) return cmd_cmds( playerid, params ); CMD:cmds( playerid, params[ ] ) { - ShowPlayerDialog( playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "{FFFFFF}Commands", "Basic Commands\nMain Commands\nCivilian Commands\nShop/Item Commands\nPolice Commands\nFireman Commands\nParamedic Commands\nVehicle Commands\nHouse Commands\nMiscellaneous Commands\n"COL_GOLD"V.I.P Commands", "Okay", "" ); + ShowPlayerDialog( playerid, DIALOG_CMDS, DIALOG_STYLE_LIST, "{FFFFFF}Commands", "Basic Commands\nMain Commands\nCivilian Commands\nShop/Item Commands\nPolice Commands\nFireman Commands\nVehicle Commands\nHouse Commands\nMiscellaneous Commands\n"COL_GOLD"V.I.P Commands", "Okay", "" ); return 1; } @@ -5460,13 +5293,7 @@ CMD:911( playerid, params[ ] ) SendClientMessageToFireman( -1, "{A83434}[911]"COL_GREY" %s(%d) is asking for a fire brigade near %s in %s!", ReturnPlayerName( playerid ), playerid, szLocation, szCity ); SendServerMessage( playerid, "You have asked for a fire brigade at your current location." ); } - else if ( strmatch( params, "EMS" ) ) - { - p_AntiSpammyTS[ playerid ] = g_iTime + 15; - SendClientMessageToAmbulance( -1, ""COL_GREEN"[911]"COL_GREY" %s(%d) is asking for a paramedic near %s in %s!", ReturnPlayerName( playerid ), playerid, szLocation, szCity ); - SendServerMessage( playerid, "You have asked for a paramedic at your current location." ); - } - else SendUsage( playerid, "/911 [LEO/EFB/EMS]" ); + else SendUsage( playerid, "/911 [LEO/EFB]" ); } return 1; } @@ -6004,7 +5831,6 @@ CMD:rape( playerid, params[ ] ) SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[RAPED]{FFFFFF} You have raped %s(%d) and infected them with "COL_RED"HIV{FFFFFF}!", ReturnPlayerName( victimid ), victimid ); GivePlayerScore( playerid, 2 ); GivePlayerWantedLevel( playerid, 5 ); - //GivePlayerExperience( playerid, E_PARAMEDIC ); GetPlayerHealth( victimid, Health ); SetPlayerHealth( victimid, ( Health - 25.0 ) ); @@ -6016,7 +5842,6 @@ CMD:rape( playerid, params[ ] ) SendClientMessageFormatted( victimid, -1, ""COL_RED"[RAPED]{FFFFFF} You have been raped by %s(%d)!", ReturnPlayerName( playerid ), playerid ); SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[RAPED]{FFFFFF} You have raped %s(%d)!", ReturnPlayerName( victimid ), victimid ); GivePlayerScore( playerid, 1 ); - //GivePlayerExperience( playerid, E_PARAMEDIC, 0.5 ); GivePlayerWantedLevel( playerid, 4 ); GetPlayerHealth( victimid, Health ); SetPlayerHealth( victimid, ( Health - 25.0 ) ); @@ -8957,9 +8782,6 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) case 5: { ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Fireman Commands", ""COL_GREY"/firetracker"COL_WHITE" - Displays a tracker of active fires in a list.\n"COL_GREY"/rfiretracker"COL_WHITE" - Hides the fire tracker.", "Okay", "Back" ); } - case 6: { - ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Paramedic Commands", ""COL_GREY"/heal"COL_WHITE" - Offers a specified player a health refill for $750.\n"COL_GREY"/cure"COL_WHITE" - Offers a specified player a cure for $4875.", "Okay", "Back" ); - } case 7: { szCMDS[ 0 ] = '\0'; @@ -10143,9 +9965,6 @@ function SetPlayerRandomSpawn( playerid ) if ( p_Class[ playerid ] == CLASS_FIREMAN ) return SetPlayerPos( playerid, g_FiremanSpawns[ city ] [ RANDOM_SPAWN_X ], g_FiremanSpawns[ city ] [ RANDOM_SPAWN_Y ], g_FiremanSpawns[ city ] [ RANDOM_SPAWN_Z ] ), SetPlayerInterior( playerid, g_FiremanSpawns[ city ] [ RANDOM_SPAWN_INTERIOR ] ), SetPlayerVirtualWorld( playerid, g_FiremanSpawns[ city ] [ RANDOM_SPAWN_WORLD ] ), SetPlayerFacingAngle( playerid, g_FiremanSpawns[ city ] [ RANDOM_SPAWN_A ] ), 1; - if ( p_Class[ playerid ] == CLASS_MEDIC ) - return SetPlayerPos( playerid, g_MedicSpawns[ city ] [ RANDOM_SPAWN_X ], g_MedicSpawns[ city ] [ RANDOM_SPAWN_Y ], g_MedicSpawns[ city ] [ RANDOM_SPAWN_Z ] ), SetPlayerInterior( playerid, g_MedicSpawns[ city ] [ RANDOM_SPAWN_INTERIOR ] ), SetPlayerVirtualWorld( playerid, g_MedicSpawns[ city ] [ RANDOM_SPAWN_WORLD ] ), SetPlayerFacingAngle( playerid, g_MedicSpawns[ city ] [ RANDOM_SPAWN_A ] ), 1; - if ( p_inArmy{ playerid } == true ) return SetPlayerPos( playerid, g_ArmySpawns[ city ] [ RANDOM_SPAWN_X ], g_ArmySpawns[ city ] [ RANDOM_SPAWN_Y ], g_ArmySpawns[ city ] [ RANDOM_SPAWN_Z ] ), SetPlayerInterior( playerid, g_ArmySpawns[ city ] [ RANDOM_SPAWN_INTERIOR ] ), SetPlayerVirtualWorld( playerid, g_ArmySpawns[ city ] [ RANDOM_SPAWN_WORLD ] ), SetPlayerFacingAngle( playerid, g_ArmySpawns[ city ] [ RANDOM_SPAWN_A ] ), 1; @@ -10462,7 +10281,6 @@ stock SetPlayerColorToTeam( playerid ) if ( p_inArmy{ playerid } ) SetPlayerColor( playerid, COLOR_ARMY ); } case CLASS_FIREMAN: SetPlayerColor( playerid, COLOR_FIREMAN ); - case CLASS_MEDIC: SetPlayerColor( playerid, COLOR_MEDIC ); default: { new @@ -10559,22 +10377,6 @@ stock IsPlayerPolice( playerid ) return false; } -stock IsPlayerMedic( playerid ) -{ - new - skinid = GetPlayerSkin( playerid ); - - switch( skinid ) { - case 274 .. 276, 308: { - if ( IsPlayerSpawned( playerid ) && IsPlayerSettingToggled( playerid, SETTING_VIPSKIN ) && p_VIPLevel[ playerid ] && p_LastSkin[ playerid ] == skinid ) { - return false; - } - return true; - } - } - return false; -} - stock IsPlayerFireman( playerid ) { new