SetPlayerAttachedObject FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 21:11, 8 January 2013 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 21:11, 8 January 2013 Connor Mead (Talk | contribs) Next diff → |
||
Line 8: | Line 8: | ||
{{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 dont on doit 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.}} | ||
{{Param|bone|La [[Bone_IDs|partie du corps]] où attacher l'objet}} | {{Param|bone|La [[Bone_IDs|partie du corps]] où attacher l'objet}} |
Revision as of 21:11, 8 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
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 dont on doit 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. |
fScaley | (optionnel) Y axis scale of the object. |
fScalez | (optionnel) Z axis scale of the object. |
materialcolor1 | (optionnel) La 1ère couleur de l'objet à modifier, en integer ou hexadécimal en format ARGB. |
materialcolor2 | (optionnel) La 2ème couleur de l'objet à modifier, en integer ou hexadécimal en format ARGB. |
Retourne:
1 en cas de réussite, 0 en cas d'echec
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: Detache un objet d'un joueur
- IsPlayerAttachedObjectSlotUsed: Vérifier si un slot d'un joueur est occupée par un objet
- EditAttachedObject: Modifier un objet attaché