Jcvag44800

Spawn veh par jcvag44800

Apr 4th, 2012
1,479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.73 KB | None | 0 0
  1. #include <a_samp>
  2. #define CHOIX 57
  3. new autorisation[MAX_PLAYERS]=1;
  4. forward autorisationtimer(playerid);
  5. public OnFilterScriptInit()
  6. {
  7.     print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  8.     print(" Spawn veh créé par Jcvag44800 lancé");
  9.     print(" forum.sa-mp.com");
  10.     print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  11.     return 1;
  12. }
  13.  
  14. public OnFilterScriptExit()
  15. {
  16.     return 1;
  17. }
  18.  
  19. public OnPlayerCommandText(playerid, cmdtext[])
  20. {
  21.     if (strcmp("/spawnveh", cmdtext, true, 10) == 0)
  22.     {
  23.         if(IsPlayerInAnyVehicle(playerid)) {SendClientMessage(playerid,0x00FF00AA,"Vous devez quitter votre véhicule !"); return 1;}
  24.         if(autorisation[playerid]==0){ SendClientMessage(playerid,0xFFFF0000,"Veuillez patienter."); return 1;}
  25.         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; }
  26.         return 1;
  27.     }
  28.     return 0;
  29. }
  30.  
  31. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  32. {
  33.     if(dialogid==CHOIX)
  34.     {
  35.       if(!response) {return 1;}
  36.       new Float:x,Float:y,Float:z;
  37.       new veh;
  38.       GetPlayerPos(playerid,x,y,z);
  39.       if(strval(inputtext)<400 || strval(inputtext)>611)
  40.       {
  41.             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");
  42.             return 1;
  43.       }
  44.       veh = CreateVehicle(strval(inputtext),x,y,z,90,0,1,60);
  45.       PutPlayerInVehicle(playerid,veh,0);
  46.       autorisation[playerid]=0;
  47.       SetTimer("autorisationtimer", 60000, false);
  48.     }
  49.     return 1;
  50. }
  51.  
  52. public autorisationtimer(playerid)
  53. {
  54.     autorisation[playerid]=1;
  55.     return 1;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment