Advertisement
DanGT

Filterscript - Sistema de futebol ( serve para campeonatos e

Feb 3rd, 2015
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new bola;
  5.  
  6. public OnFilterScriptInit()
  7. {
  8.     print(" * Sistema de jogar futebol - [TUI]Dan ~ DanDRT");
  9.    
  10.     bola = CreateObject(1598, 1347.44,2149.91,10.3156, 0, 0, 0);
  11.     return 1;
  12. }
  13.  
  14. public OnFilterScriptExit()
  15.     return 1;
  16.  
  17. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  18. {
  19.     new Float:OPos[3], Float:PPos[3];
  20.     GetObjectPos(bola, OPos[0], OPos[1], OPos[2]);
  21.  
  22.     GetPlayerPos(playerid, PPos[0], PPos[1], PPos[2]);
  23.  
  24.     if(((newkeys & KEY_HANDBRAKE) || (newkeys & KEY_SPRINT)) && GetPVarInt(playerid, "Foot"))
  25.     {
  26.         if(IsPlayerInRangeOfPoint(playerid, 1.7, OPos[0], OPos[1], OPos[2]))
  27.         {
  28.             GetXYInFrontOfPlayer(playerid, PPos[0], PPos[1], 7.0);
  29.  
  30.             MoveObject(bola, PPos[0], PPos[1], 10.3156, 10.0);
  31.  
  32.             ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  33.         }
  34.     }
  35.     return 1;
  36. }
  37.  
  38. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  39. {
  40.     new Float:a;
  41.     GetPlayerPos(playerid, x, y, a);
  42.     GetPlayerFacingAngle(playerid, a);
  43.  
  44.     if (GetPlayerVehicleID(playerid))
  45.         GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  46.  
  47.     x += (distance * floatsin(-a, degrees));
  48.     y += (distance * floatcos(-a, degrees));
  49. }
  50.  
  51. CMD:jogar(playerid)
  52. {
  53.     SetPVarInt(playerid, "Foot", !GetPVarInt(playerid, "Foot"));
  54.     SendClientMessage(playerid, 0x33AAFFFF, "[INFO] VocĂȘ agora pode jogar futebol!");
  55.     return 1;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement