Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /--------------------------------------------/
- / Creditos a Bush & Portal.BrasilSamp.top /
- /--------------------------------------------/
- #include <a_samp>
- #define MAX_CERCAS 1
- new Cerca[MAX_CERCAS];
- new Timer[MAX_PLAYERS];
- forward PararAnim(playerid);
- public OnFilterScriptInit()
- {
- Cerca[0] = CreateObject(19868, 2035.84497, 1342.75916, 9.81810, 0.00000, 0.00000, 90.00000);
- }
- public OnPlayerUpdate(playerid)
- {
- new Float:X,Float:Y,Float:Z;
- for(new i = 0; i != MAX_CERCAS; i++)
- {
- if(GetObjectPos(Cerca[i], X, Y, Z)) //Coloca o id dos objetos usados como cerca eletrica!
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, X, Y, Z))
- {
- new Float:X2,Float:Y2,Float:Z2,Float:Vida;
- GetPlayerHealth(playerid, Vida);
- SetPlayerHealth(playerid, Vida-4);
- GetPlayerPos(playerid, X2, Y2, Z2);
- SetPlayerPos(playerid, X2-2, Y2, Z2);
- ApplyAnimation( playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 0 );
- Timer[playerid] = SetTimerEx("PararAnim", 8000, false, "i", playerid);
- SendClientMessage(playerid, -1, "VocĂȘ encostou numa cerca elĂ©trica e tomou choque!");
- return 1;
- }
- }
- }
- return 1;
- }
- public PararAnim(playerid)
- {
- KillTimer(Timer[playerid]);
- ClearAnimations(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment