Block commands throughout the server
#5

You could try this out

pawn Code:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(IsInEvent[playerid] && strfind(cmdtext, "LeaveEvent", true) == -1)
    {
        SendClientMessage(playerid, 0xCC0000AA, "You can't use commands in an event!")
        return 0;
    }
    return 1;
}



Also, PVars are basically the same as new IsInEvent[MAX_PLAYERS] = 0;

pawn Code:
CMD:vartest(playerid)
{
    SetPVarInt(playerid, "SomeVar", 0);
    printf("Somevar: %i", GetPVarInt(playerid, "SomeVar"));
    return 1;
}
That's an example
Reply


Messages In This Thread
Block commands throughout the server - by caribe88 - 12.03.2012, 15:32
Re: Block commands throughout the server - by T0pAz - 12.03.2012, 15:40
Re: Block commands throughout the server - by caribe88 - 12.03.2012, 15:44
Re: Block commands throughout the server - by caribe88 - 12.03.2012, 20:14
Re: Block commands throughout the server - by [ABK]Antonio - 12.03.2012, 20:21

Forum Jump:


Users browsing this thread: 1 Guest(s)