Advertisement
Guest User

f

a guest
May 27th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. CMD:lightfire(playerid,params[])
  2. {
  3. if(AccountInfo[playerid][pMatches] == 0)
  4. {
  5. SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You dont have any matches");
  6. return 1;
  7. }
  8. if(AccountInfo[playerid][pWood] == 0)
  9. {
  10. SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You dont have any firewood");
  11. return 1;
  12. }
  13. if(MadeFire[playerid] == 1)
  14. {
  15. SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You already have fire burning");
  16. return 1;
  17. }
  18. new message = random(3);
  19. if(message == 0)
  20. {
  21. GameTextForPlayer(playerid, "You failed to light up the fire", 3500, 5);
  22. new string[158];
  23. new sendername[MAX_PLAYER_NAME];
  24. GetPlayerName(playerid, sendername, sizeof(sendername));
  25. format(string, sizeof(string), "%s failed to light up the fire", sendername);
  26. ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
  27. AccountInfo[playerid][pMatches] -= 1;
  28. AccountInfo[playerid][pSlotsFree] -= 1;
  29. }
  30. else if(message == 1)
  31. {
  32. GameTextForPlayer(playerid, "You get the fire going....", 3500, 5);
  33. new string[158];
  34. new sendername[MAX_PLAYER_NAME];
  35. GetPlayerName(playerid, sendername, sizeof(sendername));
  36. format(string, sizeof(string), "%s takes some wood and put it on the ground, and starts to make a fire", sendername);
  37. ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
  38. AccountInfo[playerid][pMatches] -= 1;
  39. AccountInfo[playerid][pWood] -= 1;
  40. new Float:x,Float:y,Float:z;
  41. GetPlayerPos(playerid,x,y,z);
  42. AccountInfo[playerid][pSlotsFree] -= 2;
  43. fire[playerid] = CreateDynamicObject(1463, x, y, z - 1, 0.0, 0.0, 0.0);
  44. fire[playerid] = CreateObject(18688, x, y, z - 2.5, 0.0, 0.0, 0.0);
  45. MadeFire[playerid] = 1;
  46. SetTimerEx("fireout", 15000, false, "i", playerid);
  47. }
  48. else if(message == 2)
  49. {
  50. GameTextForPlayer(playerid, "You succeed in lighting up the fire", 3500, 5);
  51. new string[158];
  52. new sendername[MAX_PLAYER_NAME];
  53. GetPlayerName(playerid, sendername, sizeof(sendername));
  54. format(string, sizeof(string), "%s takes some wood and put it on the ground, and starts to make a fire", sendername);
  55. ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
  56. AccountInfo[playerid][pMatches] -= 1;
  57. AccountInfo[playerid][pWood] -= 1;
  58. new Float:x,Float:y,Float:z;
  59. GetPlayerPos(playerid,x,y,z);
  60. AccountInfo[playerid][pSlotsFree] -= 2;
  61. fire[playerid] = CreateDynamicObject(1463, x, y, z - 1, 0.0, 0.0, 0.0);
  62. fire[playerid] = CreateObject(18688, x, y, z - 2.5, 0.0, 0.0, 0.0);
  63. MadeFire[playerid] = 1;
  64. SetTimerEx("fireout", 15000, false, "i", playerid);
  65. }
  66. return 1;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement