Guest User

Virus

a guest
Oct 20th, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. new Float:X,Float:Y,Float:Z;
  2.  
  3. public OnPlayerCommandText(playerid, cmdtext[])
  4. {
  5. if (strcmp("/eventtp", cmdtext, true, 10) == 0)
  6. {
  7. GetPlayerPos(playerid,X,Y,Z);
  8. ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Amount","What amount of players u want to tp?","OK","Cancel");
  9. }
  10. return 1;
  11. }
  12.  
  13. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  14. {
  15. new amount,i,tpveh;
  16. if(dialogid==1)
  17. {
  18. if(response)
  19. {
  20. if(strlen(inputtext) > 0)
  21. {
  22. amount=strval(inputtext);
  23. i = 0;
  24. ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Vehicles","Do you want to tp a vehicle, if a player is inside it? \n0 for yes \n1 for no.","OK","Cancel");
  25. }
  26. }
  27. return 1;
  28. }
  29.  
  30. if(dialogid==2)
  31. {
  32. if(response)
  33. {
  34. if(strlen(inputtext) > 0)
  35. {
  36. tpveh=strval(inputtext);
  37. ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"ID","Enter the ID of the player u want to tp.","OK","Cancel");
  38. }
  39. }
  40. }
  41.  
  42. if(dialogid==3)
  43. {
  44. if(response)
  45. {
  46. if(strlen(inputtext) > 0)
  47. {
  48. new id,idon=1;
  49. id = strval(inputtext);
  50. if(!IsPlayerConnected(id))
  51. {
  52. SendClientMessage(playerid,0xFF0000AA,"Player is not connected.");
  53. idon=0;
  54. goto ID_INPUT;
  55. }
  56.  
  57. if((idon==1)&&(tpveh==0))
  58. {
  59. Y = Y + 2;
  60. LinkVehicleToInterior(GetPlayerVehicleID(id),GetPlayerInterior(playerid));
  61. SetVehicleVirtualWorld(GetPlayerVehicleID(id),GetPlayerVirtualWorld(playerid));
  62. SetVehiclePos(GetPlayerVehicleID(id),X,Y,Z);
  63. }
  64. if((idon==1)&&(tpveh==1))
  65. {
  66. RemovePlayerFromVehicle(id);
  67. SetPlayerInterior(id,GetPlayerInterior(playerid));
  68. SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
  69. Y = Y + 2;
  70. SetPlayerPos(id,X,Y,Z);
  71. i++;
  72. }
  73. ID_INPUT:
  74. if(i < amount)
  75. {
  76. ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"ID","Enter the ID of the player u want to tp.","OK","Cancel");
  77. }
  78. }
  79. return 1;
  80. }
  81. }
  82. return 0;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment