Advertisement
Gireada

Sistem de bomba

Sep 16th, 2016
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.96 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new bomba[MAX_PLAYERS];
  5.  
  6. forward TimerExplozion(objectid, Float:x, Float:y, Float:z);
  7.  
  8. CMD:cbomba(playerid,command[])
  9. {
  10.     if(bomba[playerid] >= 5) return SendClientMessage(playerid, -1, "Ai atins limita de bombe. Folosestele.");
  11.     bomba[playerid]++;
  12.     GivePlayerMoney(playerid, -500);
  13.     SendClientMessage(playerid, -1, "Ai cumparat o bomba pentru 500$.");
  14.     return 1;
  15. }
  16.  
  17. CMD:pbomba(playerid,command[])
  18. {
  19.     new Float:x, Float:y, Float:z;
  20.     if(bomba[playerid] == 0) return SendClientMessage(playerid, -1, "Nu ai nici o bomba. Foloseste /cbomba.");
  21.     GetPlayerPos(playerid, x, y, z);
  22.     bomba[playerid]--;
  23.     new object = CreateObject(1252, x, y, z, 0.000, 0.000, 0.000);
  24.     SetTimerEx("TimerExplozion", 10000, 0, "ifff", object, x,y,z);
  25.     SendClientMessage(playerid, -1, "Ai plantat bomba. Fugi");
  26.     return 1;
  27. }
  28.  
  29. public TimerExplozion(objectid, Float:x, Float:y, Float:z)
  30. {
  31.     CreateExplosion(x,y,z,2,30.0);
  32.     DestroyObject(objectid);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement