Machine -
mohanad - 18.12.2012
hello whats wrong in this code?
it gives me erros
i wanna when player make /gate open gate and when he make /gate again close it
Help pls!
Code:
#include <a_samp>
new IsGateOpen;
//House Gate
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys && /gate)
{
new name[24];
GetPlayerName(playerid, name,sizeof(name));
if (strcmp(name, "Callum_Teller",true) == 0)
{
if (IsGateOpen == 0)
{
MoveObject(971, 263.6000061, -1333.8000488, 55.5999985, 0.00, 0.00, 34.0000000);
IsGateOpen = 1;
return 1;
}
if (IsGateOpen == 1)
{
MoveObject(971, 263.6000061, -1333.8000488, 46.0000000, 0.00, 0.00, 34.0000000);
IsGateOpen = 0;
return 1;
}
}
}
return 1;
}
Re: Machine -
mohanad - 18.12.2012
guys pls help me fast!
Re: Machine -
yaron0600 - 18.12.2012
Show us any error's ?
Re: Machine -
mohanad - 18.12.2012
C:\MTA San Andreas 1.3\sa-mp\filterscripts\Untitled.pwn(9) : error 029: invalid expression, assumed zero
C:\MTA San Andreas 1.3\sa-mp\filterscripts\Untitled.pwn(9) : error 017: undefined symbol "gate"
C:\MTA San Andreas 1.3\sa-mp\filterscripts\Untitled.pwn(9) : error 029: invalid expression, assumed zero
C:\MTA San Andreas 1.3\sa-mp\filterscripts\Untitled.pwn(9) : 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: Machine -
Mike_Peterson - 18.12.2012
I just scripted this command:
https://sampforum.blast.hk/showthread.php?tid=400470
now I'm using it on you /fp mohanad.
haha, just kidding man, I know that you are new.
But commands are supposed to go in the OnPlayerCommandText callback.
look here:
https://sampwiki.blast.hk/wiki/OnPlayerCommandText
Re: Machine -
LetsOWN[PL] - 18.12.2012
First at all..
What does it stands for? It has no-pawn-sense
What are you exactly want to check with this conditional function??
Greetz,
LetsOWN
Re: Machine -
mohanad - 18.12.2012
man i didnt say i made it i said i just wanna use it for gate and ofcours all copyright to you!
but can you make the script i dont know how to make it lol
it just wont work
Re: Machine -
LetsOWN[PL] - 18.12.2012
Tell creator of this command, that he failed hard..
Instead of use So the script will be executed if you press KEY_FIRE, which by default is LMB.
Greetz,
LetsOWN
PS. No, no copyrights to me. I am not oficial creator of this cmd :>>
Re: Machine -
mohanad - 18.12.2012
i dont wanna key i wanna command
Re: Machine -
LetsOWN[PL] - 18.12.2012
Well then.
You do have zcmd, right?
pawn Code:
COMMAND:gate(playerid, params[])
{
new name[24];
GetPlayerName(playerid, name,sizeof(name));
if (IsGateOpen == 0)
{
MoveObject(971, 263.6000061, -1333.8000488, 55.5999985, 0.00, 0.00, 34.0000000);
IsGateOpen = 1;
return 1;
}
else if(IsGateOpen == 1)
{
MoveObject(971, 263.6000061, -1333.8000488, 46.0000000, 0.00, 0.00, 34.0000000);
IsGateOpen = 0;
return 1;
}
return 1;
}
Place it anywhere in your script (but not under any public's)
It's messy, I know.. Fix the mess 4 urself
Good luck,
Greetz,
LetsOWN
Re: Machine -
mohanad - 19.12.2012
well i fix some of it take a look
Код:
#include <a_samp>
COMMAND:gate(playerid, params[])
{
new name[24];
GetPlayerName(playerid, name,sizeof(name));
if (strcmp(name, "Callum_Teller",true) == 0)
if (IsGateOpen == 0)
{
MoveObject(971, 263.6000061, -1333.8000488, 55.5999985, 0.00, 0.00, 34.0000000);
IsGateOpen = 1;
return 1;
}
else if(IsGateOpen == 1)
{
MoveObject(971, 263.6000061, -1333.8000488, 46.0000000, 0.00, 0.00, 34.0000000);
IsGateOpen = 0;
return 1;
}
return 1;
}
it gives me only 1 warning C:\MTA San Andreas 1.3\sa-mp\filterscripts\me.pwn(2) : warning 203: symbol is never used: "gate"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
so how can i fix lol!
Re: Machine -
mohanad - 19.12.2012
come an people ! help me
Re: Machine -
mohanad - 19.12.2012
pls all i need your help plssss!