i want to make press "c" for teleport and .. -
sofano - 16.12.2012
Hi , i want to change "/enter" is press "C" for teleport
and press "Shift" for Start Engine
what should i do ? , teach me. I want to learn it. (i'm beginner)
Sorry for my bad english ,If you do not understand (i'm thai)
Re: i want to make press "c" for teleport and .. -
[HK]Ryder[AN] - 16.12.2012
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: i want to make press "c" for teleport and .. -
Red_Dragon. - 16.12.2012
Try this
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: i want to make press "c" for teleport and .. -
sofano - 16.12.2012
you have a simple of this ?
Re: i want to make press "c" for teleport and .. -
SilverKiller - 16.12.2012
for "C" try
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if (PRESSED(KEY_CROUCH))
{
your command here
}
}
return 1;
Re: i want to make press "c" for teleport and .. -
Threshold - 16.12.2012
You don't really want to use 'PRESSED', because if the player is holding it, let alone pressing it once, it will teleport him multiple times.
Re: i want to make press "c" for teleport and .. -
SilverKiller - 16.12.2012
i know but he didnt mention what teleport he want ... and what is it going to be (pressing or holding)
Re: i want to make press "c" for teleport and .. -
Threshold - 16.12.2012
Doesn't matter what kind of teleport it is, nobody is going to want to teleport to the same place, more than once at a time.
Re: i want to make press "c" for teleport and .. -
maramizo - 16.12.2012
pawn Код:
CMD:enter(playerid, params[])
{
//code here
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH)
{
//the code from /enter goes here.
}
return 1;
}
Re: i want to make press "c" for teleport and .. -
Threshold - 16.12.2012
Quote:
Originally Posted by maramizo
pawn Код:
CMD:enter(playerid, params[]) { //code here }
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys & KEY_CROUCH) { //the code from /enter goes here. } return 1; }
|
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CROUCH)
{
//the code from /enter goes here.
}
return 1;
}
You just put & instead of == :S
To be completely honest, I'm sure if that even makes a difference, but just in case.
EDIT: I'm not sure*