Gates problem.
#1

I've been trying to make a simple moving gate, here is my code, I just get loads of errors and the compiler crashes.

Main Command under public OnPlayerCommandText(playerid, cmdtext[])
Quote:

//WGDMGATE

if(!strcmp("/wgo", cmdtext, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 9, 1264.48218, -2046.52625, 61.05873)){
MoveObject(wgdmgate, 1264.4822, -2046.5262, 55.3511, 1.50);
return 1;
}
}
else if(!strcmp("/wgc", cmdtext, true)){
if(IsPlayerInRangeOfPoint(playerid, 9, 1264.48218, -2046.52625, 61.05873)){
MoveObject(wgdmgate, 1264.48218, -2046.52625, 61.05873, 1.50);
return 1;
}
}
return 0;
}
}
I have: new wgdmgate; at the top of the script and wgdmgate = CreateDynamicObject(980, 1264.48218, -2046.52625, 61.05873, 0.00000, 0.00000, -180.72000); on GameModeInit()

Any ideas? I'm a bit of a noob to PAWN
Reply
#2

I would try to use proper indentation if you didn't so. Rather use [pawn] tags instead of [quote]

pawn Код:
if(!strcmp("/wgo", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 9, 1264.48218, -2046.52625, 61.05873))
        {
            MoveObject(wgdmgate, 1264.4822, -2046.5262, 55.3511, 1.50);
            return 1;
        }
    }
    else if(!strcmp("/wgc", cmdtext, true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 9, 1264.48218, -2046.52625, 61.05873))
        {
            MoveObject(wgdmgate, 1264.48218, -2046.52625, 61.05873, 1.50);
            return 1;
        }
    }
    return 0;
Remove one closing brace at the end and it might be fixed.
Reply
#3

Hmm, this still does not work, I'll try something else. Thanks for your help (-:
And yeah, I really need to learn the syntax and layout a little better +REP
Reply
#4

Oh btw, just a hint: You are using CreateDynamicObject, so you will also have to use MoveDynamicObject.
Reply
#5

Ahh, thanks, I didn't notice that. (-:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)