10.06.2014, 14:38
Intel
Overview
This include allows you to set up "intel" points. They're honeypots hidden around the world for players to search for. You can control the rewards of the intel item. The include was, of course, inspired by Call of Duty.Overview
When the script starts, the first intel item is spawned. When a player gets to it and does /claimitem, it is deleted, the player is rewarded, and a new one is spawned. If no one finds it within 5 minutes (configurable), a new one will appear instead. Intel items can be given different levels based on their difficulty to find, and you can use this when working with your rewards!
Demonstration
[ame="http://www.youtube.com/watch?v=XdD1P6uNa70"]Intel Demo[/ame]
Usage
To use this, you first need to download and install YSI. Once you've installed that, download the Intel include from below and place it in your pawno/includes folder. I recommend using the file name "intel.inc". Then, in your gamemode, you'll need to make a few modifications.[ame="http://www.youtube.com/watch?v=XdD1P6uNa70"]Intel Demo[/ame]
Usage
In OnGameModeInit, you'll need to add some Intel points. The code to do this is as follows:
pawn Код:
INTEL_AddIntelSpawn(Intel name, Intel X, Intel Y, Intel Z, Angle X, Angle Y, Angle Z, Intel Level);
pawn Код:
INTEL_AddIntelSpawn("Employee names", 1958.4, 1344.2, 15.4, 45.0, 0.0, 0.0, 1);
pawn Код:
#undef MAX_INTEL SPAWNS
#define MAX_INTEL_SPAWNS 75
In order for players to claim Intel items, you need to give them the permission to do so. Execute the code below (I recommend placing it in OnPlayerConnect):
pawn Код:
INTEL_SetClaimPermission(playerid, true);
pawn Код:
public INTEL_OnPlayerClaim(playerid, name[], level)
{
}
Customisation
There are a few ways to customise this include to your liking.As explained above, you can increase the number of possible Intel spawns. Let's change it to 75:
pawn Код:
#undef MAX_INTEL_SPAWNS
#define MAX_INTEL_SPAWNS 75
pawn Код:
#undef INTEL_OBJECT_ID
#define INTEL_OBJECT_ID 1010
pawn Код:
#undef INTEL_REFRESH_RATE
#define INTEL_REFRESH_RATE 10
pawn Код:
#undef INTEL_CLAIM_RANGE
#define INTEL_CLAIM_RANGE 15
pawn Код:
#undef INTEL_MESSAGE_COLOR
#undef INTEL_MESSAGE_COLOR_EMBED
#define INTEL_MESSAGE_COLOR 0xFF0000FF
#define INTEL_MESSAGE_COLOR_EMBED "FF0000"
Download
Licensing and Maintenance
I will attempt to provide support for this script however I cannot guarantee it. The script is released under the MIT license so you are free to do as you please with it - if anyone makes a significant improvement/modification to the script then I will incorporate that into the original, with their permission.
Licensing and Maintenance