SetPlayerAttachedObject FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 22:30, 31 January 2014 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 14:38, 1 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 6: | Line 6: | ||
{{ParametersFR|playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ, materialcolor1, materialcolor2}} | {{ParametersFR|playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ, materialcolor1, materialcolor2}} | ||
- | {{Param|playerid|L'ID du joueur dont on doit attacher un Objet.}} | + | {{Param|playerid|L'ID du joueur à qui on va attacher un Objet.}} |
{{Param|index|L'index (slot) où assigner l'objet.}} | {{Param|index|L'index (slot) où assigner l'objet.}} | ||
{{Param|modelid|L'[[Objects|objet]] à attacher.}} | {{Param|modelid|L'[[Objects|objet]] à attacher.}} | ||
Line 16: | Line 16: | ||
{{Param|fRotY|(optionnel) L'axe Y de rotation de l'objet.}} | {{Param|fRotY|(optionnel) L'axe Y de rotation de l'objet.}} | ||
{{Param|fRotZ|(optionnel) L'axe Z de rotation de l'objet.}} | {{Param|fRotZ|(optionnel) L'axe Z de rotation de l'objet.}} | ||
- | {{Param|fScaleX|(optionnel) X axis scale of the object.}} | + | {{Param|fScaleX|(optionnel) X axis scale of the object.''(à traduire)''}} |
- | {{Param|fScaley|(optionnel) Y axis scale of the object.}} | + | {{Param|fScaley|(optionnel) Y axis scale of the object.''(à traduire)''}} |
- | {{Param|fScalez|(optionnel) Z axis scale of the object.}} | + | {{Param|fScalez|(optionnel) Z axis scale of the object.''(à traduire)''}} |
- | {{Param|materialcolor1|(optionnel) La 1ère couleur de l'objet à modifier, en integer ou hexadécimal en format '''ARGB'''.}} | + | {{Param|materialcolor1|(optionnel) La 1ère couleur de l'objet à modifier, en chiffre(int) ou hexadécimal en format '''ARGB'''.}} |
- | {{Param|materialcolor2|(optionnel) La 2ème couleur de l'objet à modifier, en integer ou hexadécimal en format '''ARGB'''.}} | + | {{Param|materialcolor2|(optionnel) La 2ème couleur de l'objet à modifier, en chiffre(int) ou hexadécimal en format '''ARGB'''.}} |
{{ReturnsFR|1 en cas de réussite, 0 en cas d'echec}} | {{ReturnsFR|1 en cas de réussite, 0 en cas d'echec}} | ||
{{note2FR|Pas plus de 10 objet ne peuvent être attachés à un joueur.}} | {{note2FR|Pas plus de 10 objet ne peuvent être attachés à un joueur.}} | ||
- | {{note|Cette fonction est séparée de CreateObject/CreatePlayerObject}} | + | {{note|Cette fonction ne nécessite pas CreateObject/CreatePlayerObject, l'objet est crée lui même dans la fonction.}} |
Revision as of 14:38, 1 February 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:
Attache un objet sur une partie particulière du corps d'un joueur
(playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ, materialcolor1, materialcolor2)
playerid | L'ID du joueur à qui on va attacher un Objet. |
index | L'index (slot) où assigner l'objet. |
modelid | L'objet à attacher. |
bone | La partie du corps où attacher l'objet |
fOffsetX | (optionnel) X axis offset for the object position. |
fOffsetY | (optionnel) Y axis offset for the object position. |
fOffsetZ | (optionnel) Z axis offset for the object position. |
fRotX | (optionnel) L'axe X de rotation de l'objet. |
fRotY | (optionnel) L'axe Y de rotation de l'objet. |
fRotZ | (optionnel) L'axe Z de rotation de l'objet. |
fScaleX | (optionnel) X axis scale of the object.(à traduire) |
fScaley | (optionnel) Y axis scale of the object.(à traduire) |
fScalez | (optionnel) Z axis scale of the object.(à traduire) |
materialcolor1 | (optionnel) La 1ère couleur de l'objet à modifier, en chiffre(int) ou hexadécimal en format ARGB. |
materialcolor2 | (optionnel) La 2ème couleur de l'objet à modifier, en chiffre(int) ou hexadécimal en format ARGB. |
Retourne:
1 en cas de réussite, 0 en cas d'echec
Note | Cette fonction ne nécessite pas CreateObject/CreatePlayerObject, l'objet est crée lui même dans la fonction. |
public OnPlayerSpawn(playerid) { SetPlayerAttachedObject(playerid, 3, 1609, 2); //On attache une tortue sur la tête du joueur, dans le slot 3 SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0xFF00FF00); //On attache un chapeau blanc sur la tête du joueur et on le met en vert return 1; }
Defines utiles de la 0.3c
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9) #define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1) #define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
Fonctions Relatives
Les fonctions suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- RemovePlayerAttachedObject: Supprime l'objet d'un joueur.
- IsPlayerAttachedObjectSlotUsed: Vérifie si un objet est attaché à un joueur sur un slot spécifié
- EditAttachedObject: Édite un objet attaché.