How to put more in OnPlayerKeyStateChange?
#1

I got this:


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pInfo[playerid][superadmin] == 1)
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_JUMP))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y + 10.0, z + 10.0);
}
return 1;
}

But i want more too, like:

if(pInfo[playerid][superadmin] == 1)
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_LEFT))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x - 10.0, y, z);

just an example there, but how to put it together?
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pInfo[playerid][superadmin] == 1)
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_JUMP))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y + 10.0, z + 10.0);
}
if(pInfo[playerid][superadmin] == 1)
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_LEFT))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x - 10.0, y, z);
return 1;
}
Reply
#3

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pInfo[playerid][superadmin] == 1)
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_JUMP))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y + 10.0, z + 10.0);
}
if(pInfo[playerid][superadmin] == 1)
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_LEFT))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x - 10.0, y, z);
return 1;
}
Ok, thanks!
Reply
#4

FYI - the movement keys do not trigger the callback
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)