SA-MP Forums Archive
How could I make this working w/ commands? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How could I make this working w/ commands? (/showthread.php?tid=203999)



How could I make this working w/ commands? - XVK - 28.12.2010

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


Re: How could I make this working w/ commands? - XVK - 28.12.2010

Please, answer me as soon as possible.


Re: How could I make this working w/ commands? - _rAped - 28.12.2010

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


Re: How could I make this working w/ commands? - XVK - 28.12.2010

-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


Re: How could I make this working w/ commands? - _rAped - 28.12.2010

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?


Re: How could I make this working w/ commands? - Sky4D - 28.12.2010

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.


Re: How could I make this working w/ commands? - XVK - 28.12.2010

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-


Re: How could I make this working w/ commands? - XVK - 28.12.2010

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


Re: How could I make this working w/ commands? - samp03c - 05.01.2011

you can set a timer!