Help me with MAP :(
#3

If you already have your objects in sa-mp you only need to add a offset to all of them to move them together

Example
pawn Код:
// Global
new
  gMapStart,
  gMapEnd
;
// Init
gMapStart = CreateObject(...);
//...
gMapEnd = CreateObject(...);
// Command
ZCMD:movemap(playerid, params[]) {
    new
        Float: oX,
        Float: oY,
        Float: oZ,
        Float: tX,
        Float: tY,
        Float: tZ
    ;
    GetPlayerPos(playerid, tX, tY, tZ);
    GetObjectPos(gMapStart, oX, oY, oZ);

    oX -= tX;
    oY -= tY;
    oZ -= tZ;

    for(playerid = gMapStart; playerid <= gMapEnd; ++playerid) {
        GetObjectPos(playerid, tX, tY, tZ);
        SetObjectPos(playerid, tX - oX, tY - oY, tZ - oZ);
    }
    return true;
}
Well afterwards you need to save the objects again
Reply


Messages In This Thread
Help me with MAP :( - by JizZy00 - 01.10.2015, 09:53
Re: Help me with MAP :( - by JizZy00 - 01.10.2015, 10:29
AW: Help me with MAP :( - by Nero_3D - 01.10.2015, 14:22

Forum Jump:


Users browsing this thread: 2 Guest(s)