SA-MP Forums Archive
MoveObjects - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MoveObjects (/showthread.php?tid=449314)



MoveObjects - Ilan97 - 08.07.2013

Hey,
I'm currently working on Luna Park script, I've made to each gate a cmd (Example: /openenterancegate, /openkartinggate etc..) and I want to make from all that a one command (/opengate).
I hope you understand me and will help me, thanks.


Re: MoveObjects - Aerotactics - 08.07.2013

I think this is close to what you want, there is more help HERE.
pawn Код:
if(!strcmp("/opengate",cmdtext))
{
    if(IsPlayerInRangeOfPoint(playerid, 7, x, y, z))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You opened the gate.");
        MoveObject(obj, 0, 0, 10, 2.00);
        return 1;
    }
    else
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You aren't near a gate.");
        return 1;
    }
    return 0;
}



Re: MoveObjects - Ilan97 - 08.07.2013

No, I mean to have few "if(IsPlayerInRangeOfPoint(playerid, 7, x, y, z))" and after them the MoveObject. and make some MoveObjects in the same command (/opengate), Instead of some commands, only one, and if I'm near a gate, that gate will be moving - and all gates same, but by one command.


Re: MoveObjects - Aerotactics - 08.07.2013

Just add more gate coords like this:
pawn Код:
if(!strcmp("/opengate",cmdtext))
{
    if(IsPlayerInRangeOfPoint(playerid, 7, x, y, z))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You opened the gate.");
        MoveObject(obj, 0, 0, 10, 2.00);
        return 1;
    }
    else if(IsPlayerInRangeOfPoint(playerid, 7, x2, y2, z2))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You opened the gate.");
        MoveObject(obj2, 0, 0, 10, 2.00);
        return 1;
    }
    else if(IsPlayerInRangeOfPoint(playerid, 7, x3, y3, z3))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You opened the gate.");
        MoveObject(obj3, 0, 0, 10, 2.00);
        return 1;
    }
    else
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You aren't near a gate.");
        return 1;
    }
    return 0;
}



Re: MoveObjects - Ilan97 - 09.07.2013

It making me some errors...


Re: MoveObjects - Stanford - 09.07.2013

Dude change x y z to the points that u want same with x3 y3 z3 and x2 y2 z2

x y z (Gate 1 points)
x2 y2 z2 (Gate 2 points)
x3 y3 z3 (Gate 3 points)


Re: MoveObjects - Ilan97 - 09.07.2013

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Dude change x y z to the points that u want same with x3 y3 z3 and x2 y2 z2

x y z (Gate 1 points)
x2 y2 z2 (Gate 2 points)
x3 y3 z3 (Gate 3 points)
I've changed everything...... I know that already but still errors.


Re: MoveObjects - Stanford - 09.07.2013

What are the errors maybe you didn't use the format correctly


Re: MoveObjects - Ilan97 - 10.07.2013

Everything is good, I fixed myself the errors just missed one } and all is bad
Thank you very much!