My gate is not complying, help? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: My gate is not complying, help? (
/showthread.php?tid=262227)
My gate is not complying, help? -
kin - 17.06.2011
pawn Код:
new open = 0;
if (strcmp("/", cmdtext, true,1) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,-1701.44042969,687.58593750,24.65380096))
{
if(open == 1)
{
SetDynamicObjectRot(sfent,0.00000000,270.0,90.0);
print("TEST ONE ONE");
open = 0;
}
else
{
SetDynamicObjectRot(sfent,0.00000000,0.00000000,90.00000000);
open = 1;
print("TEST ONE");
}
}
}
I want it so when i use the slash command that it will open the gate if open = 0, otherwis close it. It wont close, so can you please help me solve this issue?
Re: My gate is not complying, help? - Max_Coldheart - 17.06.2011
You cant have
pawn Код:
if (strcmp("/", cmdtext, true,1) == 0)
You must have atleast one character in the command.
Re: My gate is not complying, help? -
kin - 17.06.2011
No, you dont. It works, just currently i cannot get it to "close" it "opens" just fine.
Re: My gate is not complying, help? -
Toreno - 17.06.2011
Check your coordinates, the variables are looking good to me.
If it opens as you say it is, then the variable turns into 1 and then it should close it.
Re: My gate is not complying, help? - Max_Coldheart - 17.06.2011
try
instead of
Re: My gate is not complying, help? -
PrawkC - 17.06.2011
Where are you defining "open" Because if you're doing it inside OnPlayerCommandText (or w/e the callback is) "open" will be set to 0 ever time you run a command.
Define it at the top of your script.
Re: My gate is not complying, help? -
kin - 17.06.2011
Quote:
Originally Posted by PrawkC
Where are you defining "open" Because if you're doing it inside OnPlayerCommandText (or w/e the callback is) "open" will be set to 0 ever time you run a command.
Define it at the top of your script.
|
Thank you, i just figured that out once i posted this topic lol.