Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define CHOIX 57
- new autorisation[MAX_PLAYERS]=1;
- forward autorisationtimer(playerid);
- public OnFilterScriptInit()
- {
- print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- print(" Spawn veh créé par Jcvag44800 lancé");
- print(" forum.sa-mp.com");
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/spawnveh", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid)) {SendClientMessage(playerid,0x00FF00AA,"Vous devez quitter votre véhicule !"); return 1;}
- if(autorisation[playerid]==0){ SendClientMessage(playerid,0xFFFF0000,"Veuillez patienter."); return 1;}
- if(autorisation[playerid]==1){ ShowPlayerDialog(playerid,CHOIX,DIALOG_STYLE_INPUT,"Choix du véhicule à spawn","Merci d'entrer l'ID du véhicule à spawn.","Valider", "Annuler"); return 1; }
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid==CHOIX)
- {
- if(!response) {return 1;}
- new Float:x,Float:y,Float:z;
- new veh;
- GetPlayerPos(playerid,x,y,z);
- if(strval(inputtext)<400 || strval(inputtext)>611)
- {
- ShowPlayerDialog(playerid,CHOIX,DIALOG_STYLE_INPUT,"Choix du véhicule à spawn","Merci d'entrer un ID de véhicule entre 400 et 611.\n\nMerci d'entrer l'ID du véhicule à spawn.","Valider", "Annuler");
- return 1;
- }
- veh = CreateVehicle(strval(inputtext),x,y,z,90,0,1,60);
- PutPlayerInVehicle(playerid,veh,0);
- autorisation[playerid]=0;
- SetTimer("autorisationtimer", 60000, false);
- }
- return 1;
- }
- public autorisationtimer(playerid)
- {
- autorisation[playerid]=1;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment