Gates problem. - 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: Gates problem. (
/showthread.php?tid=435297)
Gates problem. -
wgdm - 06.05.2013
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
Re: Gates problem. -
Jochemd - 06.05.2013
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.
Re: Gates problem. -
wgdm - 06.05.2013
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
Re: Gates problem. -
Jochemd - 06.05.2013
Oh btw, just a hint: You are using Create
DynamicObject, so you will also have to use Move
DynamicObject.
Re: Gates problem. -
wgdm - 06.05.2013
Ahh, thanks, I didn't notice that. (-: