Rotating objects, 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: Rotating objects, error (
/showthread.php?tid=414747)
Rotating objects, error -
BigGroter - 10.02.2013
I get these errors with the code below.
pawn Код:
C:\Users\PC\Downloads\samp03x_svr_R1-2_win32\pawno\map.pwn(124) : error 029: invalid expression, assumed zero
C:\Users\PC\Downloads\samp03x_svr_R1-2_win32\pawno\map.pwn(129) : error 029: invalid expression, assumed zero
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/door", cmdtext, true, 10) == 0)
{
if (IsPlayerInRangeOfPoint(playerid,2,1435.58, 1532.59, 9.96))
{
new Float:RotX, Float:RotY, Float:RotZ;
GetObjectRot(door1,RotX,RotY,RotZ);
if RotZ == 90
{ //First error here.
SetObjectRot(door1,RotX,RotY,0);
return 1;
}
else if RotZ == 0
{ // Second here.
SetObjectRot(door1,RotX,RotY,90);
return 1;
}
}
return 1;
}
return 0;
}
Re: Rotating objects, error -
MP2 - 10.02.2013
if RotZ == 90
->
if(RotZ == 90)
else if RotZ == 0
->
else if(RotZ == 0)
Missing parenthesis ().
Re: Rotating objects, error -
BigGroter - 10.02.2013
Yes, of course! Thank you so much.
Re: Rotating objects, error -
MP2 - 10.02.2013
No problem. Sometimes these things are hard to spot!