Advertisement
Guest User

Elevator Script

a guest
Mar 21st, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. new ascensore;
  2.  
  3. #define DIALOG_ASCENSORE 5500
  4.  
  5. Create3DTextLabel("[Premi Y per usare l'Ascensore]", 0xFFFFFFFF, 1776.1543,-1774.4171,13.5407, 10.0, 0, 0);
  6. Create3DTextLabel("[Premi Y per usare l'Ascensore]", 0xFFFFFFFF, 1776.1543,-1774.4171,42.6567, 10.0, 0, 0);
  7.  
  8. ascensore = CreateObject(2669, 1777.37927, -1777.52820, 14.01590, 0.00000, 0.00000, 179.62450);
  9.  
  10. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  11. {
  12. if (newkeys == KEY_YES)
  13. {
  14. if(IsPlayerInRangeOfPoint(playerid,5.0,1777.37927, -1777.52820, 14.01590) || IsPlayerInRangeOfPoint(playerid,5.0,1777.37927, -1777.52820, 42.89976))
  15. {
  16. ShowPlayerDialog(playerid,DIALOG_ASCENSORE,DIALOG_STYLE_LIST, "Ascensore", "Chiama Ascensore\nPiano Terra\nUltimo Piano","Seleziona","Esci");
  17. return 1;
  18. }
  19. }
  20. return 1;
  21. }
  22. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  23. {
  24. if(dialogid==DIALOG_ASCENSORE)
  25. {
  26. if(response)
  27. {
  28. switch(listitem)
  29. {
  30. case 0:
  31. {
  32. if(IsPlayerInRangeOfPoint(playerid,5.0,1777.37927, -1777.52820, 14.01590)){MoveObject(ascensore, 1777.37927, -1777.52820, 14.01590, 5.00);}
  33. if(IsPlayerInRangeOfPoint(playerid,5.0,1777.37927, -1777.52820, 42.89976)){MoveObject(ascensore, 1777.37927, -1777.52820, 42.89976, 5.00);}
  34. }
  35. case 1: MoveObject(ascensore, 1777.37927, -1777.52820, 14.01590, 5.00);
  36. case 2: MoveObject(ascensore, 1777.37927, -1777.52820, 42.89976, 5.00);
  37. }
  38. }
  39. }
  40. return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement