AddVehicleComponent FR

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:02, 5 January 2013
Connor Mead (Talk | contribs)

← Previous diff
Revision as of 16:03, 5 January 2013
Connor Mead (Talk | contribs)

Next diff →
Line 5: Line 5:
{{ParametersFR|vehicleid, componentid}} {{ParametersFR|vehicleid, componentid}}
-{{Param|vehicleid|L'ID du Véhicule pas du [[Vehicles:All_FR|Modèle]].}}+{{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.}} {{Param|componentid|The [[Car Component ID|componentid]] that needs to be added to the vehicle.}}

Revision as of 16:03, 5 January 2013




Description:

Cette fonction permet d'ajouter des composant a un certain véhicule (Nitro, Spoiler, Jantes, Peinture etc...).


Paramètres:
(vehicleid, componentid)
vehicleidL'ID du Véhicule (pas du Modèle).
componentidThe componentid that needs to be added to the vehicle.


Image:32px-Circle-style-warning.png

Note
Importante

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.

Callbacks Relatives

Les Callbacks suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.