Movegate Errors - 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: Movegate Errors (
/showthread.php?tid=390617)
Movegate Errors -
Joshswag - 07.11.2012
Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT
#endif
new Gate,
bool:Open;
//Single gate
public OnFilterScriptInit()
{
Gate = CreateObject(989,F1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962,Float:DrawDistance = 0.0);
return 1;
}
CMD:gate(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid,10,1428.6456, 242.0033, 20.3020)//Gate 1
{
switch(Open{0})//Check whether the gate opened or closed
{
case true://If the gate opened
{
MoveObject(Gate[0],1428.6456, 242.0033, 20.3020,4);//Close the gate
Open{0} == false;//false for closed
}
case false://If the gate closed
{
MoveObject(Gate[0],1426.5259, 237.4716, 20.3020,4);//Open the gate
Open{0} == true;//true for opened
}
}
return 1;
}
SendClientMessage(playerid,color,"You're not close enough to the gate.");//Send error message if player isn't near any gate
return 1;
}
Errors
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 017: undefined symbol "F1428"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 017: undefined symbol "DrawDistance"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
If someone could help, that'd be muchly appreciated, thanks.
Re: Movegate Errors -
cosbraa - 07.11.2012
pawn Код:
switch(Open)//Check whether the gate opened or closed
{
case true://If the gate opened
{
MoveObject(Gate,1428.6456, 242.0033, 20.3020,4);//Close the gate
Open = false;//false for closed
}
case false://If the gate closed
{
MoveObject(Gate,1426.5259, 237.4716, 20.3020,4);//Open the gate
Open = true;//true for opened
}
}
You also need to make Gate = CreateObject(...) //The object you're moving.
Re: Movegate Errors -
Joshswag - 07.11.2012
Still get the same errors.
Re: Movegate Errors -
cosbraa - 07.11.2012
Replace the switch statement with the one I have above
Re: Movegate Errors -
Joshswag - 07.11.2012
I did.
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 017: undefined symbol "DrawDistance"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 001: expected token: ";", but found ")"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Movegate Errors -
Joshswag - 07.11.2012
This is line 16
Код:
Gate = CreateObject(989,1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962,Float:DrawDistance = 0.0);
Re: Movegate Errors -
cosbraa - 07.11.2012
Gate = CreateObject(989,1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962, 0.0);
Re: Movegate Errors -
Joshswag - 07.11.2012
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(25) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Movegate Errors -
cosbraa - 07.11.2012
Line 25?
Re: Movegate Errors -
Joshswag - 07.11.2012
Just a {