Command Block - Small Help. -
Hunud - 03.09.2017
Hi
The problem is, when i am inside Deathmatch arena i can use any command like /sf /lv /sfa but when i type it i want it say you can't do this right now. So only when i quit deathmatch arena i will be able to use this commands. How to do it ?
- Is there any way to do it instead of spamming on each command If(InsideDM bla bla bla ) ?
Tnx
Re: Command Block - Small Help. -
Misiur - 03.09.2017
If you are not using y_commands then yes, you have to "spam" each command with that check.
#e: Though, it might be possible with ZCMD "OnCommandReceived" or something like this, I don't use ZCMD so I'm not certain
Re: Command Block - Small Help. -
Hunud - 03.09.2017
Any example ?
Re: Command Block - Small Help. -
grymtn - 03.09.2017
you can just make a variable named
and when they enter dm set their
Код:
indm[10]=1; //(i just gave an example as 10 think of it like playerid)
and add in to your /ls /sf commands like
Код:
if(indm[playerid]==1) return SendClientMessage(playerid,-1,"You are in dm bro just leave dm first");
Re: Command Block - Small Help. -
Hunud - 03.09.2017
Have you even read what i say in my first post....
Re: Command Block - Small Help. -
grymtn - 03.09.2017
yes i did but i wrote it because its the only way to do it. if you dont want to use a number for indm try bool. if this is the black way. bool is the blue of it.

well if your dm arenas are far from where your actual game is you can set area for them but will not work properly
Re: Command Block - Small Help. -
Hunud - 03.09.2017
I know it's posible but i don't know how....
Re: Command Block - Small Help. -
grymtn - 03.09.2017
as i said you can define areas like if a player between some x to x y to y and z to z area you wil STILL set a variable as
you cant carry something out of one thing to another thing without a variable. computer is just a machine it cant guess what other element holds it cant do telepathy. but if you really find something like that please pm me about it. i really would like to know because im sure it would be so useful.
also oncommandrecieved in zcmd will require a variable too as it cant guess if you are in dm out of its ass
Re: Command Block - Small Help. -
Arbico - 03.09.2017
in Zcmd it's super easy just add this to the bottom of the script
Ycmd, This wont work, So i suggest using ZCMD
PHP код:
public OnPlayerPerformCommand(playerid, cmdtext[], success) {
if(InsideDM(playerid) && !strcmp(cmdtext, "/leavedm", true)) return SendClientMessage(playerid, COLOR_RED, "You can't use commands as you are in a DM!");
//change /leavedm to the command you use to leave the dm arena
return 1;
}
Re: Command Block - Small Help. -
Paulice - 03.09.2017
http://forum.sa-mp.com/showpost.php?...44&postcount=9
PHP код:
SetPVarInt(playerid, "/sf", 1),
SetPVarInt(playerid, "/lv", 1),
SetPVarInt(playerid, "/sfa", 1);
To enable use:
PHP код:
SetPVarInt(playerid, "/sf", 0),
SetPVarInt(playerid, "/lv", 0),
SetPVarInt(playerid, "/sfa", 0);
Or (preferred and recommended method):
PHP код:
DeletePVar(playerid, "/sf"),
DeletePVar(playerid, "/lv"),
DeletePVar(playerid, "/sfa");
Done