Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1.  
  2.  
  3. if(strcmp(cmd, "/prendrearme", true) == 0)
  4. {
  5.  
  6.  
  7. new tmp[128];
  8.  
  9. if(!IsPlayerConnected(playerid))
  10. {
  11. return 1;
  12. }
  13.  
  14.  
  15. tmp = strtok(cmdtext, idx);
  16. new slot = strval(tmp);
  17. if(strlen(tmp) == 0)
  18. {
  19. SendClientMessage(playerid, -1, "Commande: /prendrearme <slot>");
  20. return 1;
  21. }
  22.  
  23.  
  24. new maison = -1;
  25. for(new i; i < MAX_HOUSES; i++)
  26. {
  27. if(!hInfo[i][hExist]) continue;
  28.  
  29. if (IsPlayerInRangeOfPoint(playerid, 1.0, hInfo[i][hInX], hInfo[i][hInY], hInfo[i][hInZ]))
  30. {
  31. maison = i;
  32. break;
  33. }
  34.  
  35. }
  36.  
  37. if(maison == -1)
  38. {
  39. return SendClientMessage(playerid, COLOR_LIGHTRED, "Vous n'êtes pas dans une maison!");
  40. }
  41.  
  42. if(hInfo[maison][hOwnerSQL] != pInfo[playerid][pSQL])
  43. {
  44. return SendClientMessage(playerid, COLOR_LIGHTRED, "Vous n'êtes pas dans votre maison.");
  45. }
  46.  
  47.  
  48. if(slot == 1)
  49. {
  50.  
  51. if(hInfo[maison][hWeapon1] > 0)
  52. {
  53. GivePlayerWeapon(playerid, hInfo[maison][hWeapon1], hInfo[maison][hAmmo1]);
  54. hInfo[maison][hWeapon1] = 0;
  55. hInfo[maison][hAmmo1] = 0;
  56. SaveHouse(maison);
  57. }
  58. else
  59. {
  60. return SendClientMessage(playerid, COLOR_LIGHTRED, "Il n'y a pas d'arme dans ce slot.");
  61. }
  62. return 1;
  63.  
  64. }
  65.  
  66. else if(slot == 2)
  67. {
  68. if(hInfo[maison][hWeapon2] > 0)
  69. {
  70. GivePlayerWeapon(playerid, hInfo[maison][hWeapon1], hInfo[maison][hAmmo1]);
  71. hInfo[maison][hWeapon2] = 0;
  72. hInfo[maison][hAmmo2] = 0;
  73. SaveHouse(maison);
  74. }
  75. else
  76. {
  77. return SendClientMessage(playerid, COLOR_LIGHTRED, "Il n'y a pas d'arme dans ce slot.");
  78. }
  79. return 1;
  80. }
  81.  
  82.  
  83.  
  84.  
  85.  
  86. return 1;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement