/enter and /exit using KEY_SECONDARY_ATTACK key
#1

Is there a way to use the same KEY_SECONDARY_ATTACK to exit?

I've tried this, but it does not work. I can enter. But not exit using the same key.

Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{


if( newkeys & KEY_SECONDARY_ATTACK ){
return OnPlayerCommandText(playerid, "/enter");

// return true;
}

if( newkeys & KEY_SECONDARY_ATTACK ){
return OnPlayerCommandText(playerid, "/exit");

// return true;
}

Reply
#2

Obviously it never gets a chance to call /exit try it like this, it shouldn't exit even though you try because your position won't be fully updated if it does then you'll have to try some other stuff but it should work I would think.

pawn Код:
if( newkeys & KEY_SECONDARY_ATTACK ){
    OnPlayerCommandText(playerid, "/enter");
    OnPlayerCommandText(playerid, "/exit");
}
Reply
#3

Ty it's working! Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)