MoveObjects
#1

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.
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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;
}
Reply
#5

It making me some errors...
Reply
#6

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)
Reply
#7

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.
Reply
#8

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)