AddVehicleComponent FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 03:50, 5 January 2013 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 06:03, 5 January 2013 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
- | [[Category:Scripting Functions FR]] | + | {{ScriptingFR}} |
+ | {{Title}} | ||
+ | |||
+ | Cette fonction permet d'ajouter des composant a un certain véhicule (Nitro, Spoiler, Jantes, Peinture etc...) | ||
+ | |||
+ | {{ParametersFR|vehicleid, componentid}} | ||
+ | {{Param|vehicleid|L'ID du Véhicule pas du [[Vehicles:All_FR|Modèle]].}} | ||
+ | {{Param|componentid|The [[Car Component ID|componentid]] that needs to be added to the vehicle.}} | ||
+ | |||
+ | {{Note2|Utiliser un id de [[Car Component ID|composant]] inconnu fait crasher le jeu.}} | ||
+ | |||
+ | {{ReturnsFR|Cette Fonction ne retourne pas de valeur particulière}} | ||
+ | |||
+ | <!-- Exemple d'utilisation de AddVehicleComponent --> | ||
+ | <pawn> | ||
+ | new gTAXI; | ||
+ | |||
+ | public OnGameModeInit() | ||
+ | { | ||
+ | gTAXI = AddStaticVehicle(420, -2482.4937, 2242.3936, 4.6225, 179.3656, 6, 1); // Taxi | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | public OnPlayerStateChange(playerid, newstate, oldstate) | ||
+ | { | ||
+ | if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) | ||
+ | { | ||
+ | if (GetPlayerVehicleID(playerid) == gTAXI) | ||
+ | { | ||
+ | AddVehicleComponent(gTAXI, 1010); // 1010 = ID de la Nitro | ||
+ | SendClientMessage(playerid, 0xFFFFFFAA, "Nitro ajoutée au Taxi."); | ||
+ | } | ||
+ | } | ||
+ | return 1; | ||
+ | } | ||
+ | </pawn> | ||
+ | |||
+ | {{RelatedFunctionsFR}} | ||
+ | {{RemoveVehicleComponent}} | ||
+ | {{GetVehicleComponentInSlot}} | ||
+ | {{GetVehicleComponentType}} | ||
+ | |||
+ | {{RelatedCallbacksFunctionFR}} | ||
+ | {{OnVehicleMod}} | ||
+ | {{OnEnterExitModShop}} | ||
+ | |||
+ | [[Category:Scripting Functions_FR]] |
Revision as of 06:03, 5 January 2013
Page d'Accueil | Les Fonctions | Les Callbacks | Les bases du Scripting | Plugins de Serveur | Tutoriaux
Ne prenez pas en compte les FR dans les noms
Cette fonction permet d'ajouter des composant a un certain véhicule (Nitro, Spoiler, Jantes, Peinture etc...)
(vehicleid, componentid)
vehicleid | L'ID du Véhicule pas du Modèle. |
componentid | The componentid that needs to be added to the vehicle. |
Important | Utiliser un id de composant inconnu fait crasher le jeu. |
Retourne:
Cette Fonction ne retourne pas de valeur particulière
new gTAXI; public OnGameModeInit() { gTAXI = AddStaticVehicle(420, -2482.4937, 2242.3936, 4.6225, 179.3656, 6, 1); // Taxi return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { if (GetPlayerVehicleID(playerid) == gTAXI) { AddVehicleComponent(gTAXI, 1010); // 1010 = ID de la Nitro SendClientMessage(playerid, 0xFFFFFFAA, "Nitro ajoutée au Taxi."); } } return 1; }
Fonctions Relatives
Les fonctions suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- RemoveVehicleComponent: Remove a component from a vehicle.
- GetVehicleComponentInSlot: Check what components a vehicle has.
- GetVehicleComponentType: Check the type of component via the ID.
Callbacks Relatives
Les Callbacks suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- OnVehicleMod: Called when a vehicle is modded.
- OnEnterExitModShop: Called when a vehicle enters or exits a mod shop.