-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from NexiusTailer/patch-1
Vehicle tuning protection
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
About: fakekill protection | ||
Author: NexiusTailer | ||
Author: Nexius | ||
Contributor: ziggi | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
About: vehicle tuning protection | ||
Author: Nexius | ||
Contributor: ziggi | ||
*/ | ||
|
||
#if !defined _protection_included | ||
#error "Please include protection before vehicletuning" | ||
#endif | ||
|
||
#if defined _protection_vehicletun_included | ||
#endinput | ||
#endif | ||
|
||
#define _protection_vehicletun_included | ||
|
||
/* | ||
OnVehicleMod | ||
*/ | ||
|
||
public OnVehicleMod(playerid, vehicleid, componentid) | ||
{ | ||
new bool:is_enabled = Protection_GetParamInt(PROTECTION_VEHICLETUNING, PROTECTION_ENABLED) != 0; | ||
|
||
if (is_enabled) { | ||
if (GetPlayerInterior(playerid) == 0) { | ||
Protection_GivePlayerWarning(playerid, PROTECTION_VEHICLETUNING, "tuning"); | ||
return 0; | ||
} | ||
} | ||
|
||
#if defined PVeTuning_OnVehicleMod | ||
return PVeTuning_OnVehicleMod(playerid, vehicleid, componentid); | ||
#else | ||
return 1; | ||
#endif | ||
} | ||
#if defined _ALS_OnVehicleMod | ||
#undef OnVehicleMod | ||
#else | ||
#define _ALS_OnVehicleMod | ||
#endif | ||
|
||
#define OnVehicleMod PVeTuning_OnVehicleMod | ||
#if defined PVeTuning_OnVehicleMod | ||
forward PVeTuning_OnVehicleMod(playerid, vehicleid, componentid); | ||
#endif |