OnPlayerStateChange FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 04:12, 28 November 2013 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 22:15, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{ScriptingFR}} | {{ScriptingFR}} | ||
- | {{Title}} | ||
{{Description|Cette callback est appelée lorsqu'un joueur change de position dans une voiture}} | {{Description|Cette callback est appelée lorsqu'un joueur change de position dans une voiture}} | ||
Line 6: | Line 5: | ||
{{ParametersFR|playerid, newstate, oldstate}} | {{ParametersFR|playerid, newstate, oldstate}} | ||
{{Param|playerid|L'ID du joueur qui a changé de position}} | {{Param|playerid|L'ID du joueur qui a changé de position}} | ||
- | {{Param|newstate|La nouvelle [[state | position]] du joueur.}} | + | {{Param|newstate|La nouvelle [[Playerstates_FR|position]] du joueur.}} |
- | {{Param|oldstate|L'ancienne[[state | position]] du joueur.}} | + | {{Param|oldstate|L'ancienne [[Playerstates_FR|position]] du joueur.}} |
{{NoReturnCallbackFR}} | {{NoReturnCallbackFR}} | ||
Line 24: | Line 23: | ||
{{RelatedCallbacksFR}} | {{RelatedCallbacksFR}} | ||
- | *[[OnPlayerInteriorChange_FR|OnPlayerInteriorChange]] | + | {{OnPlayerInteriorChange_FR}} |
{{RelatedFunctionsCallbackFR}} | {{RelatedFunctionsCallbackFR}} | ||
- | *[[GetPlayerState_FR|GetPlayerState]] | + | {{GetPlayerState_FR}} |
- | *[[GetPlayerSpecialAction_FR|GetPlayerSpecialAction]] | + | {{GetPlayerSpecialAction_FR}} |
- | *[[SetPlayerSpecialAction_FR|SetPlayerSpecialAction]] | + | {{SetPlayerSpecialAction_FR}} |
[[Category:Scripting Callbacks FR]] | [[Category:Scripting Callbacks FR]] |
Revision as of 22:15, 31 January 2014
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
Description:
Cette callback est appelée lorsqu'un joueur change de position dans une voiture
(playerid, newstate, oldstate)
playerid | L'ID du joueur qui a changé de position |
newstate | La nouvelle position du joueur. |
oldstate | L'ancienne position du joueur. |
Retourne:
Cette callback ne retourne rien, mais doit retourner quelque chose! Regardez ICI pour plus d'informations.
public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Le joueur entre dans un véhicule en tant que conducteur { new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); // On ajoute de la nitro (NOS) au véhicule } return 1; }
Callback Relatives
Les Callbacks ci dessous sont indirectement ou directement liées à cette Callback.
- OnPlayerInteriorChange: Appelée lorsqu'un joueur change d'intérieur.
Fonctions relatives
Les fonctions suivantes peuvent êtres utiles car elles concernent indirectement ou non cette callback.
- GetPlayerState: Récupère la position (siège) du joueur dans une voiture.
- GetPlayerSpecialAction: Récupère l'action spéciale courante du joueur.
- SetPlayerSpecialAction: Applique une action spéciale sur un joueur.