26.11.2013, 12:12
(
Last edited by kreison; 13/12/2014 at 04:28 PM.
)
Robbery NPC System V2.1 (FCNPC/RNPC)
What is it?
It is an include that adds NPCs that recreates in a very similar way the system of shoplifting of GTA San Andreas single player/GTA V online.
Functions
pawn Code:
AddRobNPC(skin, Float:x, Float:y, Float:z, Float:ang, worldid, interiorid, alarmtype = 0**, pay = 1, min = 1000, max = 2000) // Add a NPC (Pay is the parameter to define if the player will receive money on sucess rob)
StopAlarm(playerid) // Force stop the alarm for a given player
Callbacks
pawn Code:
OnPlayerSucessRob(playerid, npcid, value) // Starts when a player successfully rob an NPC (Value is the money received on sucess rob)
OnPlayerFailRob(playerid, npcid) // Starts when a player fails to rob an NPC
Alarm types**
0 - Stop the alarm when the player is in a different interior from the NPC/sound without set point;
1 - Stop the alarm when the player is in a different interior from the NPC/sound with set point;
2 - Stop the alarm after the set time interval (on the configuration of the include)/sound without set point;
3 - Stop the alarm after the set time interval (on the configuration of the include)/sound with set point;
4 - The alarm won't stop/sound without set point;
5 - The alarm won't stop/sound with set point.
NOTE1: Types 0 and 1 are not recommended for NPCS on interior id 0.
NOTE2: Types 4 and 5 can be used with the function StopAlarm(playerid) to make a custom alarm system.
Configuration
The include is easily configurable, just open the include and at the top of the code you will see the configuration defines with comments.
Suggestions and bugs
Feel free to leave suggestions for the next version and bug report. I'll try to keep this include updated as new ideas or bugs to be fixed appear.
Next version
My plan for the next version is to adapt to include other NPC plugins and maybe a version without plugins.
WARNING
For this include work is necessary that the server has included and loaded the plugin FCNPC or RNPC!
Video demonstration (In portuguese)
[ame]http://www.youtube.com/watch?v=5jL8c2GRhus[/ame]
Credits
Mauzen for the RNPC (https://sampforum.blast.hk/showthread.php?tid=355849) and OrMisicL/[LCK]Chris for the FCNPC (https://sampforum.blast.hk/showthread.php?tid=428066).
Download
v2.1 (RNPC)
Sendspace
https://www.sendspace.com/file/uihycs
Pastebin
http://pastebin.com/tx1BMAb7
v2.1 (FCNPC)
Sendspace
https://www.sendspace.com/file/65nsf5
Pastebin
http://pastebin.com/R56ZGdBk
I hope you guys enjoy it and sorry for my bad english
Portuguese topic: https://sampforum.blast.hk/showthread.php?tid=477208