How could I make this working w/ commands?
#1

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_JUMP))
    {
        new
            Float:x,
            Float:y,
            Float:z;
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z + 10.0);
    }
    return 1;
}
Like, /sjump activate it---2nd time you type /sjump, you deactivate it
EDIT:If this is easy to make please show me how:

pawn Код:
if(IsPlayerVipType(playerid,2))
You have to be a Gold VIP Member to use this
Reply
#2

Please, answer me as soon as possible.
Reply
#3

Quote:
Originally Posted by XVK
Посмотреть сообщение
Please, answer me as soon as possible.
What exactly do you want?

How to check for a key being pressed
Reply
#4

-You have to "ACTIVATE IT" to use it, like /sjump activates it, the second time i use /sjump it deactivates it
-You have to be a Gold VIP member, to activate it
Reply
#5

Quote:
Originally Posted by XVK
Посмотреть сообщение
-You have to "ACTIVATE IT" to use it, like /sjump activates it, the second time i use /sjump it deactivates it
-You have to be a Gold VIP member, to activate it
Maybe, I'm stupid. But I still don't get it, can you post your /sjump command?
Reply
#6

pawn Код:
new SuperJumpEnabled[MAX_PLAYERS] = 0;

COMMAND:sjump(playerid, params[])
{
    if(IsPlayerVipType(playerid, 2))
    {
        if(SuperJumpEnabled[playerid] == 0) {
            SuperJumpEnabled[playerid] = 1;
            SendClientMessage(playerid, COLOR, "[Action] You have enabled super jump. Jump to see the effects! Use /sjump to disable it!");
        }
        else {
            SuperJumpEnabled[playerid] = 0;
            SendClientMessage(playerid, COLOR, "[Action] You have disabled super jump. Use /sjump to enable it again!");
        }
    }
    else return SendClientMessage(playerid, ERROR_COLOR, "[Error]: You are not a VIP Gold Member.");
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_JUMP))
    {
        if(IsPlayerVipType(playerid, 2) && SuperJumpEnabled[playerid] == 1)
        {
                new
                    Float:x,
                    Float:y,
                    Float:z;
                GetPlayerPos(playerid, x, y, z);
                SetPlayerPos(playerid, x, y, z + 10.0);
        }
    }
    return 1;
}
Something like this should be sufficient.
Reply
#7

Ohhhhh!!!! Thanks for that!!!!!!!!!

Can't you make something like that?


-When you finish fighting-
-You have to wait 10 seconds after finishing the fight to use commands-
Reply
#8

It tells you, "You were recently in a gun fight, so you can't use cmds".
Reply
#9

you can set a timer!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)