Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * =====================================================
- *
- * |_________________Création véhicules______________|
- * | |
- * | Version : 1.0 |
- * | Date de création : 27/03/2012 |
- * | Dernière(s) MAJ : 27/03/2012 |
- * | Scripteur : Carpentou |
- * | Tous droits réservés à Carpentou/A Player Style |
- * |_________________________________________________|
- *
- * =====================================================
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- */
- /*
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * =====================================================
- * LES INCLUDES
- * =====================================================
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- */
- #include <a_samp> // Include principale pour les fonctions de sa:mp.
- #include <../../include/gl_common.inc> // Include pour quelques fonctions avancées.
- /*
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * =====================================================
- * LES DEFINES
- * =====================================================
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- */
- #define COLOR_FS 0x7452CDFF // Couleur utilisé dans les messages.
- #define TimeSpawn 450 // Temps avant que le véhicule apparaisse.
- /*
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * =====================================================
- * LES FONCTIONS
- * =====================================================
- * - - - - - - - - - - - - - - - - - - - - - - - - - - -
- */
- forward SpawnVehicle(playerid, id); // Fonction qui permettra de faire apparaître les véhicules demandés.
- forward EnvoieMessageJoueur(playerid, color, mess[]); // Fonction qui remplace le SendClientMessage.
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new
- cmd[50],
- idx;
- cmd = strtok(cmdtext, idx);
- // Si le joueur tape la commande suivante.
- if(strcmp("/veh", cmd, true) == 0)
- {
- new
- tmp[50];
- tmp = strtok(cmdtext, idx);
- // Si le joueur écrit une information après la commande.
- if(strlen(tmp))
- {
- new
- id;
- id = strval(tmp);
- // Si le véhicule n'existe pas.
- if(id < 400 || id > 611)
- {
- EnvoieMessageJoueur(playerid, COLOR_FS, "[Véhicule]Le véhicule n'existe pas.");
- }
- else
- {
- // Nous allonrs dans la fonction en donnant l'id du joueur et le model choisi.
- SpawnVehicle(playerid, id);
- }
- }
- else
- {
- EnvoieMessageJoueur(playerid, COLOR_FS, "[Commande]/veh [modelid].");
- }
- return 1;
- }
- return 1;
- }
- public EnvoieMessageJoueur(playerid, color, mess[])
- {
- SendClientMessage(playerid, color, mess);
- return 1;
- }
- public SpawnVehicle(playerid, id)
- {
- new
- vehicleid,
- Float:x,
- Float:y,
- Float:z;
- GetPlayerPos(playerid, x, y, z);
- vehicleid =CreateVehicle(id, x, y, z, 9.0, -1, -1, -1);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement