how to disable all commands
#2

pawn Code:
new bool:Spawned[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Spawned[playerid] = false;
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    Spawned[playerid] = false;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    Spawned[playerid] = true;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    Spawned[playerid] = false;
    return 1;
}

//Commands that you want to be disabled

CMD:mycommand1(playerid, params[])
{
    if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command.");
    //rest of command
    return 1;
}

CMD:mycommand2(playerid, params[])
{
    if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command.");
    //rest of command
    return 1;
}

//etc.
Reply


Messages In This Thread
how to disable all commands - by kbalor - 22.10.2013, 14:55
Re: how to disable all commands - by Threshold - 22.10.2013, 15:03
Re: how to disable all commands - by ]Rafaellos[ - 22.10.2013, 15:05
Re: how to disable all commands - by Wizzy951 - 22.10.2013, 15:06
Re: how to disable all commands - by kbalor - 22.10.2013, 15:12
Re: how to disable all commands - by Threshold - 22.10.2013, 15:19
Re: how to disable all commands - by kbalor - 22.10.2013, 15:21
Re: how to disable all commands - by kbalor - 22.10.2013, 15:27
Re: how to disable all commands - by Threshold - 22.10.2013, 15:33
Re: how to disable all commands - by gotwarzone - 22.10.2013, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)