Machine
#1

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;
}
Reply
#2

guys pls help me fast!
Reply
#3

Show us any error's ?
Reply
#4

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.
Reply
#5

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
Reply
#6

First at all..
pawn Code:
if (newkeys && /gate)
What does it stands for? It has no-pawn-sense

What are you exactly want to check with this conditional function??

Greetz,
LetsOWN
Reply
#7

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
Reply
#8

Tell creator of this command, that he failed hard..
Instead of
pawn Code:
if(newkeys && /gate)
use
pawn Code:
if(newkeys == KEY_FIRE)
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 :>>
Reply
#9

i dont wanna key i wanna command
Reply
#10

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
Reply
#11

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!
Reply
#12

come an people ! help me
Reply
#13

pls all i need your help plssss!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)