Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define CARSPAWND 21929
- public OnFilterScriptInit()
- {
- print("Vehicle Spawner loaded. Script by Andrus Riis(Mr Dzx)");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[128];
- if(strcmp(cmd, "/carspawn", true) == 0) {
- 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"); }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new Float:X,Float:Y,Float:Z,Float:A; new text = strval(inputtext);
- GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,A);
- if(dialogid == CARSPAWND)
- {
- if(response)
- {
- if(text < 400 || text > 611)
- {
- SendClientMessage(playerid, 0x00FF00FF, "Error: Invalid model ID."); return 1;
- }
- CreateVehicle(text, X,Y,Z+2,A, 126, 126, -1);
- SendClientMessage(playerid, 0x00FF00FF, "Vehicle created successfully.");
- } else return SendClientMessage(playerid, 0x00FF00FF, "Selection canceled.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment