|
|
#1 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: May 2012
Location: Philippines
Posts: 910
Reputation: 30
|
How can I disable all commands except.
This /w - weapons menu /v- vehicle menu /stats /pm and so on.. I have here an example where i want to enable those commands. 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);
}
return SendClientMessage(playerid, 0xFF0000FF, "You have been teleported to Drag Arena");
}
|
|
|
|
|
|
#2 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Jul 2009
Location: Croatia, Split
Posts: 530
Reputation: 37
|
make a variable that will show if the commands are disabled or not for each player.
pawn Code:
pawn Code:
pawn Code:
pawn Code:
|
|
|
|
|
|
#3 | |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: May 2012
Location: Philippines
Posts: 910
Reputation: 30
|
Quote:
|
|
|
|
|
|
|
#4 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Jul 2009
Location: Croatia, Split
Posts: 530
Reputation: 37
|
i have edited my first post
|
|
|
|
|
|
#5 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: May 2012
Location: Philippines
Posts: 910
Reputation: 30
|
|
|
|
|
|
|
#6 |
|
Big Clucker
![]() ![]() Join Date: Apr 2006
Location: Summoner's Rift
Posts: 167
Reputation: 116
|
Are you using zcmd, right?
You can use this: pawn Code:
|
|
|
|
|
|
#7 | |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Jul 2009
Location: Croatia, Split
Posts: 530
Reputation: 37
|
Quote:
pawn Code:
for example I don't want player to /suicide after he uses command /teleport, but if really needed player can use command /sorry to enable commands: pawn Code:
|
|
|
|
|
|
|
#8 | |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: May 2012
Location: Philippines
Posts: 910
Reputation: 30
|
Quote:
Okay to make it simple. I only want to disable /t -teleport command in drag. If you can see on my first post. If player tried to use /t- teleport a DIALOG_STYLE_MSGBOX will show "You can't use teleport while in Drag" "Leave" "Stay" If player click Leave - He will die and respawn in different spawn place. If player click stay - Dialog will close and he/she still in drag area. |
|
|
|
|
|
|
#9 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: May 2012
Location: Philippines
Posts: 910
Reputation: 30
|
Edit: You'll understand now.
|
|
|
|
|
|
#10 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Jul 2009
Location: Croatia, Split
Posts: 530
Reputation: 37
|
pawn Code:
pawn Code:
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:
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to disable commands in jail? | Sensitive | Scripting Help | 27 | 25/08/2011 12:46 PM |
| How to disable commands? | Ernests | Help Archive | 2 | 30/04/2011 01:47 PM |
| Disable Commands | CraZy_KiLLaH | Help Archive | 1 | 20/03/2011 06:38 PM |
| disable commands | addysnow1 | Help Archive | 0 | 07/10/2009 09:13 PM |
| How do i enable and disable commands? | Coolman12 | Help Archive | 9 | 18/04/2009 10:47 AM |