Advertisement
Guest User

OnPlayerEntetCheckpoint

a guest
Oct 18th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. hook OnPlayerEnterCheckpoint(playerid)
  2. {
  3. if(LagiRestock[playerid])
  4. {
  5. for(new i = 0; i < MAX_ARMOURY; i++)
  6. {
  7. PlayerPlaySound(playerid, 1138, 0.0, 0.0, 0.0);
  8.  
  9. if(RestockStep[playerid] == 1)
  10. {
  11. SetPlayerCheckpoint(playerid, 2847.1731, 983.3269, 10.7500, 5.0);
  12. RestockStep[playerid] = 2;
  13. }
  14. else if(RestockStep[playerid] == 2)
  15. {
  16. new string[256];
  17. if(ArmouryData[i][armouryID] != 0){
  18. format(string, sizeof(string), "%s{ADC3E7}%d\t\t%s\n", string, ArmouryData[i][armouryID], ArmouryData[i][armouryName]);
  19. ShowPlayerDialog(playerid, DIALOG_RESTOCK, DIALOG_STYLE_LIST, "Armoury List", string, ">>>", "");
  20. }
  21. }
  22. else if(RestockStep[playerid] == 3)
  23. {
  24. if(IsPlayerInRangeOfPoint(playerid, 5.0, ArmouryData[i][armouryRestockPos][0], ArmouryData[i][armouryRestockPos][1], ArmouryData[i][armouryRestockPos][2]))
  25. {
  26. new string[128];
  27. DisablePlayerCheckpoint(playerid);
  28. LagiRestock[playerid] = false;
  29. RestockStep[playerid] = 0;
  30. ArmouryData[i][armouryAmount] = 100000;
  31. format(string, sizeof(string), "[id:%d]\n%s\n%d/100000\nType '/armoury' to pick or store armoury", i, ArmouryData[i][armouryName], ArmouryData[i][armouryAmount]);
  32. ArmouryData[i][armouryLabel] = CreateDynamic3DTextLabel(string, COLOR_DARKGREEN, ArmouryData[i][armouryPos][0], ArmouryData[i][armouryPos][1], ArmouryData[i][armouryPos][2], 15.0);
  33. }
  34. }
  35. }
  36. }
  37. return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement