Advertisement
HigorGamer

[FS] Dinamite

Nov 18th, 2014
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.79 KB | None | 0 0
  1. #include <a_samp>
  2. // Criado Por : Krisky_.
  3. new CostaDina;
  4. new PegoDina[MAX_PLAYERS], ObDina[MAX_PLAYERS], TempoEx[MAX_PLAYERS];
  5. new Float: kX[MAX_PLAYERS], Float: kY[MAX_PLAYERS], Float: kZ[MAX_PLAYERS];
  6.  
  7. forward TempoDinamite(playerid);
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     print("---------------Krisky_----------------\n");
  12.     print("Sistema De Dinamite Carregado Com Sucesso!");
  13.     print("---------------Krisky_----------------\n");
  14.     return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19.     return 1;
  20. }
  21.  
  22. public OnPlayerSpawn(playerid)
  23. {
  24.     if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, CostaDina);
  25.     PegoDina[playerid] = 0;
  26.     return 1;
  27. }
  28.  
  29.  
  30. public OnPlayerCommandText(playerid, cmdtext[])
  31. {
  32.     if (strcmp("/pegardinamite", cmdtext, true) == 0)
  33.     {
  34.         if(PegoDina[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "Voce ja pegou uma Dinamite!");
  35.         if (IsPlayerInRangeOfPoint(playerid, 3.0, 1258.6782,-813.1119,84.1406))
  36.         {
  37.             CostaDina = SetPlayerAttachedObject(playerid, 6, 1654, 1, 0.1, -0.3, 0, 0, 40, 0, 1, 1, 1);
  38.             PegoDina[playerid] = 1;
  39.         }
  40.         else
  41.         {
  42.              SendClientMessage(playerid, -1, "Vc Nao esta na area de Venda de Dinamite");
  43.         }
  44.     }
  45.  
  46.     if (strcmp("/armardin", cmdtext, true) == 0)
  47.     {
  48.         if(PegoDina[playerid] == 1)
  49.         {
  50.             GetPlayerPos(playerid, kX[playerid], kY[playerid], kZ[playerid]);
  51.             GetXYInFrontOfPlayer(playerid, kX[playerid], kY[playerid], 0.5);
  52.             ObDina[playerid] = CreateObject(1654, kX[playerid], kY[playerid], kZ[playerid] - 0.8,270,0,0);
  53.             TempoEx[playerid] = SetTimerEx("TempoDinamite", 10000, 0, "d", playerid);
  54.             SendClientMessage(playerid, -1, "Dinamite do Pavil curto! Corre desgraca!!!");
  55.             ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 5.0, 0, 0, 0, 0, 0);
  56.             PegoDina[playerid] = 0;
  57.             if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
  58.         }
  59.         else
  60.         {
  61.              SendClientMessage(playerid, 0x00FC0000, "Voce nao tem uma dinamite!");
  62.         }
  63.     }
  64.     return 1;
  65. }
  66.  
  67. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  68. {
  69.     new Float:a;
  70.     GetPlayerPos(playerid, x, y, a);
  71.     GetPlayerFacingAngle(playerid, a);
  72.     if (GetPlayerVehicleID(playerid))
  73.     {
  74.         GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  75.     }
  76.     x += (distance * floatsin(-a, degrees));
  77.     y += (distance * floatcos(-a, degrees));
  78. }
  79.  
  80. public TempoDinamite(playerid)
  81. {
  82.     SendClientMessage(playerid, 0x00FFFFFF, "Dinamite Detonada");
  83.     CreateExplosion(kX[playerid], kY[playerid], kZ[playerid], 10, 10);
  84.     DestroyObject(ObDina[playerid]);
  85.     return 1;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement