Disable all Commands Except...
#10

pawn Code:
CMD:drag(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)){
        SetPlayerPos(playerid, -2911.2407,-194.6217,2.7821);
        CreateDynamicObject(4247, -3037.851074, -103.473968, 1.177714, 0.000000, 0.000000, 0.000000,1,-1,-1,300.0);//floor
        SetPlayerFacingAngle(playerid, 0.0);
        SetPlayerInterior(playerid, 0);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{6666FF}(/drag) {00CCFF}%s {6666FF}has Teleported to Drag Area",pName);
        SendClientMessageToAll(playerid, string);
        SetPlayerVirtualWorld(playerid, 1);
    }
    else{
        new veh = GetPlayerVehicleID(playerid);
        LinkVehicleToInterior(veh, 0);
        SetVehiclePos(veh, -2911.2407,-194.6217,2.7821);
        SetVehicleZAngle(veh, 0.0);
        SetPlayerPos(playerid, -2911.2407,-194.6217,2.7821);
        CreateDynamicObject(4247, -3037.851074, -103.473968, 1.177714, 0.000000, 0.000000, 0.000000,1,-1,-1,300.0);//floor
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{6666FF}(/drag) {00CCFF}%s {6666FF}has Teleported to Drag Area",pName);
        SendClientMessageToAll(playerid, string);
        PutPlayerInVehicle(playerid, veh, 0);
        SetVehicleVirtualWorld(veh, 1);
        SetPlayerVirtualWorld(playerid, 1);
    }
    gCommandsDisabled[playerid]==true;//add this <-<-<-<-<-<-<-<-<-<
    return SendClientMessage(playerid, 0xFF0000FF, "You have been teleported to Drag Arena");

}
pawn Code:
OnPlayerCommandText(playerid,cmdtext[])
{
     if(strcmp(cmdtext,"/t")==0 && cmdtext[2]=='\0')
     {
          if(gCommandsDisabled[playerid]==true)
          {
                // Now show him the dialog
                return 1:
          }
            //...
     }
so after the command /drag is used, the /t command is not available for player.
Once you want to enable the command, for example: when player dies just put the gCOmmandsDisabled[playerid]=false;
pawn Code:
OnPlayerDeath(//blah blah)
{
     gCOmmandsDisabled[playerid]=false;
     //rest of the code
}
Reply


Messages In This Thread
Disable all Commands Except... - by kbalor - 13.07.2012, 20:53
Re: Disable all Commands Except... - by Roko_foko - 13.07.2012, 20:58
Re: Disable all Commands Except... - by kbalor - 13.07.2012, 21:00
Re: Disable all Commands Except... - by Roko_foko - 13.07.2012, 21:00
Re: Disable all Commands Except... - by kbalor - 13.07.2012, 21:10
Re: Disable all Commands Except... - by Larceny - 13.07.2012, 21:21
Re: Disable all Commands Except... - by Roko_foko - 13.07.2012, 21:23
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 09:35
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 10:01
Re: Disable all Commands Except... - by Roko_foko - 14.07.2012, 10:14
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 12:44
Re: Disable all Commands Except... - by Mark™ - 14.07.2012, 12:47
Re: Disable all Commands Except... - by Blunt - 14.07.2012, 12:48
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 12:56
Re: Disable all Commands Except... - by Mark™ - 14.07.2012, 13:00
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 13:06
Re: Disable all Commands Except... - by Mark™ - 14.07.2012, 13:09
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 13:15
Re: Disable all Commands Except... - by Mark™ - 14.07.2012, 13:17
Re: Disable all Commands Except... - by Andi_Evandy - 14.07.2012, 13:27
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 13:28
Re: Disable all Commands Except... - by Mark™ - 14.07.2012, 13:33
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 13:39
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 13:42
Re: Disable all Commands Except... - by kbalor - 14.07.2012, 14:21
Re: Disable all Commands Except... - by Roko_foko - 14.07.2012, 22:00

Forum Jump:


Users browsing this thread: 1 Guest(s)