MoveObject FR

From SA-MP Wiki

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

← Previous diff
Revision as of 11:08, 7 January 2013
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
 +{{ScriptingFR}}
 +{{Title}}
 +
 +{{Description|Déplacer un Objet}}
 +
 +{{note|Les joueurs/Véhicules qui sont sur cet Objet seront déplacés eux aussi}}
 +
 +{{ParametersFR|objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0}}
 +{{Param|objectid|L'ID de l'objet à déplacer}}
 +{{Param|Float:X|Les coordonnées X où déplacer l'objet.}}
 +{{Param|Float:Y|Les coordonnées Y où déplacer l'objet.}}
 +{{Param|Float:Z|Les coordonnées Z où déplacer l'objet.}}
 +{{Param|Float:Speed|La vitesse de déplacement par secondes}}
 +{{Param|Float:RotX|La rotation X de l'objet.}}
 +{{Param|Float:RotY|La rotation Y de l'objet.}}
 +{{Param|Float:RotZ|La rotation Z de l'objet.}}
 +
 +{{ReturnsFR|Le temps que prend l'objet pour être déplacé en milliseconde.}}
 +
 +<pawn>
 +new obj; // Somewhere at the top of your script
 +
 +public OnGameModeInit()
 +{
 + obj = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
 + return 1;
 +}
 +
 +public OnPlayerCommandText(playerid, cmdtext[])
 +{
 + if(strcmp(cmdtext, "/moveobject", true) == 0)
 + {
 + new string[50];
 + new movetime = MoveObject(obj, 0, 0, 10, 2.00);
 + format(string, sizeof(string), "Votre objet à été déplacé en %d millisecondes", movetime);
 + SendClientMessage(playerid, 0xFF000000, string);
 + return 1;
 + }
 + return 0;
 +}
 +</pawn>
 +
 +{{RelatedCallbacksFunctionFR}}
 +*[[OnObjectMoved_FR|OnObjectMoved:]] Quand un objet est déplacé
 +
 +{{RelatedFunctionsFR}}
 +*[[CreateObject_FR|CreateObject:]] Créer un Objet
 +*[[DestroyObject_FR|DestroyObject:]] Détruire un Objet
 +*[[IsValidObject_FR|IsValidObject:]] Vérifier si l'objet existe
 +*[[IsObjectMoving_FR|IsObjectMoving:]] Vérifier si l'objet est en mouvement
 +*[[StopObject_FR|StopObject:]] Arrêter le mouvement d'un Objet
 +*[[SetObjectPos_FR|SetObjectPos:]] Modifier la position d'un Objet
 +*[[SetObjectRot_FR|SetObjectRot:]] Modifier la rotation d'un Objet
 +*[[GetObjectPos_FR|GetObjectPos:]] Récupérer la position d'un Objet
 +*[[GetObjectRot_FR|GetObjectRot:]] Récupérer la rotation d'un Objet
 +*[[AttachObjectToPlayer_FR|AttachObjectToPlayer:]] Attacher un Objet à un joueur
 +
 +*[[CreatePlayerObject_FR|CreatePlayerObject:]] Créer un Objet
 +*[[DestroyPlayerObject_FR|DestroyPlayerObject:]] Détruire un Objet
 +*[[IsValidPlayerObject_FR|IsValidPlayerObject:]] Vérifier si l'objet existe
 +*[[SetPlayerObjectPos_FR|SetPlayerObjectPos:]] Modifier la position d'un Objet
 +*[[SetPlayerObjectRot_FR|SetPlayerObjectRot:]] Modifier la rotation d'un Objet
 +*[[GetPlayerObjectPos_FR|GetPlayerObjectPos:]] Récupérer la position d'un Objet
 +*[[GetPlayerObjectRot_FR|GetPlayerObjectRot:]] Récupérer la rotation d'un Objet
 +*[[AttachPlayerObjectToPlayer_FR|AttachPlayerObjectToPlayer:]] Attacher un Objet à un joueur
 +
[[Category:Scripting Functions FR]] [[Category:Scripting Functions FR]]

Revision as of 11:08, 7 January 2013




Description:

Déplacer un Objet


Image:32px-Ambox_warning_orange.png

Note

Les joueurs/Véhicules qui sont sur cet Objet seront déplacés eux aussi


Paramètres:
(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0)
objectidL'ID de l'objet à déplacer
Float:XLes coordonnées X où déplacer l'objet.
Float:YLes coordonnées Y où déplacer l'objet.
Float:ZLes coordonnées Z où déplacer l'objet.
Float:SpeedLa vitesse de déplacement par secondes
Float:RotXLa rotation X de l'objet.
Float:RotYLa rotation Y de l'objet.
Float:RotZLa rotation Z de l'objet.


Retourne:

Le temps que prend l'objet pour être déplacé en milliseconde.


new obj; // Somewhere at the top of your script
 
public OnGameModeInit()
{
    obj = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    return 1;
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/moveobject", true) == 0)
    {
        new string[50];
        new movetime = MoveObject(obj, 0, 0, 10, 2.00);
        format(string, sizeof(string), "Votre objet à été déplacé en %d millisecondes", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    return 0;
}

Callbacks Relatives

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

Fonctions Relatives

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