How could I make this working w/ commands?
#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


Messages In This Thread
How could I make this working w/ commands? - by XVK - 28.12.2010, 15:06
Re: How could I make this working w/ commands? - by XVK - 28.12.2010, 15:45
Re: How could I make this working w/ commands? - by _rAped - 28.12.2010, 15:53
Re: How could I make this working w/ commands? - by XVK - 28.12.2010, 16:13
Re: How could I make this working w/ commands? - by _rAped - 28.12.2010, 16:15
Re: How could I make this working w/ commands? - by Sky4D - 28.12.2010, 16:24
Re: How could I make this working w/ commands? - by XVK - 28.12.2010, 16:30
Re: How could I make this working w/ commands? - by XVK - 28.12.2010, 16:36
Re: How could I make this working w/ commands? - by samp03c - 05.01.2011, 17:31

Forum Jump:


Users browsing this thread: 5 Guest(s)