Guest User

Untitled

a guest
Aug 28th, 2010
1,359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #include <a_samp>
  2. #define CARSPAWND 21929
  3.  
  4. public OnFilterScriptInit()
  5. {
  6. print("Vehicle Spawner loaded. Script by Andrus Riis(Mr Dzx)");
  7. return 1;
  8. }
  9.  
  10. public OnFilterScriptExit()
  11. {
  12. return 1;
  13. }
  14.  
  15. public OnPlayerCommandText(playerid, cmdtext[])
  16. {
  17. new cmd[128];
  18. if(strcmp(cmd, "/carspawn", true) == 0) {
  19. ShowPlayerDialog(playerid, CARSPAWND, DIALOG_STYLE_INPUT, "Car Spawner", "Please type in car model id you want to spawn.\n\nNB! For full list of car model ID's, please visit weedarr.com", "Spawn", "Cancel"); }
  20. return 1;
  21. }
  22.  
  23. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  24. {
  25. new Float:X,Float:Y,Float:Z,Float:A; new text = strval(inputtext);
  26. GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,A);
  27. if(dialogid == CARSPAWND)
  28. {
  29. if(response)
  30. {
  31. if(text < 400 || text > 611)
  32. {
  33. SendClientMessage(playerid, 0x00FF00FF, "Error: Invalid model ID."); return 1;
  34. }
  35. CreateVehicle(text, X,Y,Z+2,A, 126, 126, -1);
  36. SendClientMessage(playerid, 0x00FF00FF, "Vehicle created successfully.");
  37. } else return SendClientMessage(playerid, 0x00FF00FF, "Selection canceled.");
  38. }
  39. return 1;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment