help to fix an error - 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: help to fix an error (
/showthread.php?tid=423001)
help to fix an error -
Dainyzxz - 16.03.2013
help to fix an error
Код:
if(GetObjectPos(GATE6, 1587.9688,-1722.7001,1449.6000)) return MoveObject(GATE6,1587.89941406,-1718.39941406,1448.59997559,2.0); SCM(playerid,0xFFFFFFFF,"closing!");
if(GetObjectPos(GATE6, 1587.89941406,-1718.39941406,1448.59997559)) return MoveObject(GATE6,1587.9688,-1722.7001,1449.6000,2.0); SCM(playerid,0xFFFFFFFF,"opening!");
ERROR:
Код:
(342) : error 035: argument type mismatch (argument 2)
(343) : error 035: argument type mismatch (argument 2)
Re: help to fix an error -
Jstylezzz - 16.03.2013
What happens if you do
pawn Код:
if(GetObjectPos(GATE6, 1587.9688,-1722.7001,1449.6000)){ MoveObject(GATE6,1587.89941406,-1718.39941406,1448.59997559,2.0); SCM(playerid,0xFFFFFFFF,"closing!");}
if(GetObjectPos(GATE6, 1587.89941406,-1718.39941406,1448.59997559)){ MoveObject(GATE6,1587.9688,-1722.7001,1449.6000,2.0); SCM(playerid,0xFFFFFFFF,"opening!"); }
Re: help to fix an error -
Dainyzxz - 16.03.2013
Quote:
Originally Posted by Jari_Johnson*
What happens if you do
pawn Код:
if(GetObjectPos(GATE6, 1587.9688,-1722.7001,1449.6000)){ MoveObject(GATE6,1587.89941406,-1718.39941406,1448.59997559,2.0); SCM(playerid,0xFFFFFFFF,"closing!");} if(GetObjectPos(GATE6, 1587.89941406,-1718.39941406,1448.59997559)){ MoveObject(GATE6,1587.9688,-1722.7001,1449.6000,2.0); SCM(playerid,0xFFFFFFFF,"opening!"); }
|
same error
Re: help to fix an error -
Jstylezzz - 16.03.2013
Do you create the object with CreateDynamicObject or just with the CreateObject function?
Re: help to fix an error -
tyler12 - 16.03.2013
I'd recommend reading the wiki page for
GetObjectPos.
pawn Код:
new Float:x,Float:y,Float:z;
GetObjectPos(GATE6, x, y, z);
if(x == 1587.89941406 && y == -1718.39941406 && z = 1448.59997559)
{
MoveObject(GATE6,1587.9688,-1722.7001,1449.6000,2.0);
SCM(playerid,0xFFFFFFFF,"opening!");
}
else if(x == 1587.9688 && y == -1722.7001 && z == 1449.6000)
{
MoveObject(GATE6,1587.89941406,-1718.39941406,1448.59997559,2.0);
SCM(playerid,0xFFFFFFFF,"closing!");
}
Re: help to fix an error -
Dainyzxz - 16.03.2013
Quote:
Originally Posted by tyler12
I'd recommend reading the wiki page for GetObjectPos.
pawn Код:
new Float:x,Float:y,Float:z; GetObjectPos(GATE6, x, y, z); if(x == 1587.89941406 && y == -1718.39941406 && z = 1448.59997559) { MoveObject(GATE6,1587.9688,-1722.7001,1449.6000,2.0); SCM(playerid,0xFFFFFFFF,"opening!"); } else if(x == 1587.9688 && y == -1722.7001 && z == 1449.6000) { MoveObject(GATE6,1587.89941406,-1718.39941406,1448.59997559,2.0); SCM(playerid,0xFFFFFFFF,"closing!"); }
|
i have readed wiki, but I didn't know how how to make this before:
Код:
if(x == 1587.9688 && y == -1722.7001 && z == 1449.6000)
thank you for code, it's working fine