how to start..
#1

i want make gate which will open on pressing "g" i dont know how to start u know how to ignore that
pawn Код:
CMD:....(playerid, params[])
{
       //code here
       return 1;
}
and what is the code for key "g"
Reply
#2

Post the object locations for the gate open and closed.
Reply
#3

A good place to start would be with a key bind

OnPlayerKeyStateChange

then under that try putting a radius scan so you can see how far away they are from the object if they are inrange allow them to open it check if the gate is open or closed so you can see what the player want it to do
Reply
#4

i do something like this
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new PRESSED;
    if(IsPlayerInRangeOfPoint(playerid, 10, -2811.1684570313, -1524.8093261719, 142.4806060791))
    {
        if(PRESSED(KEY_FIRE))// i just see the exsample from OUL post with key_fire
        {
            MoveObject(vrata, -2811.1684570313,-1524.8093261719,142.4806060791, 2.0);
            return 1;
        }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "use /lock 0 to unlock ur car and /lock 1 to unlock ur car");
    }
    return 1;
}
but i get this errors
pawn Код:
C:\Users\vlado\sa-mp\gamemodes\Mace-Roleplay.pwn(888) : error 012: invalid function call, not a valid address
C:\Users\vlado\sa-mp\gamemodes\Mace-Roleplay.pwn(888) : warning 215: expression has no effect
C:\Users\vlado\sa-mp\gamemodes\Mace-Roleplay.pwn(888) : error 001: expected token: ";", but found ")"
C:\Users\vlado\sa-mp\gamemodes\Mace-Roleplay.pwn(888) : error 029: invalid expression, assumed zero
C:\Users\vlado\sa-mp\gamemodes\Mace-Roleplay.pwn(888) : fatal error 107: too many error messages on one line
Reply
#5

Line 888 is which one?

Also i hope thats ONLY the start of your code other wse once they press it they cant make it go back up as you havnt made that statements
Reply
#6

Just realised somthing can i as why do you have a /lock 1 and 2 when you only have to copy the unlock command to the/lock command and the place a else statement?
Reply
#7

ummm... i just do it like this and its working xD
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInRangeOfPoint(playerid, 10, -2811.1684570313, -1524.8093261719, 142.4806060791))
    {
        if(KEY_FIRE >= 0)// i just see the exsample from OUL post with key_fire
        {
            MoveObject(vrata, -2811.1684570313,-1524.8093261719,142.4806060791, 2.0);
            return 1;
        }
    }
    return 1;
}
but i need the code for "g" key and i need to make to back on g key the gate... xD
Reply
#8

removed because what i wrote was WRONG
Reply
#9

if u asking me about the ip of the server here is it: 77.29.49.210:7777
Reply
#10

https://sampwiki.blast.hk/wiki/GetPlayerKeys

Hope this helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)