Disabling FS While In MiniGame +REP -
[PDS]DarioKeic - 31.07.2012
Hello,
I had a question. Okay, I have a carspawner filterscript. And i made a DM arena in my gamemode. Okay, I used variables to disable commands like, /kill etc. Commands that were in my GM. Soo, The problem is people are spawning cars in /dmarena. How can i disable /v? And no its not in my gamemode. Its a filterscript. If someone helps me, I will +REP.
Re: Disabling FS While In MiniGame +REP -
NuLIO - 31.07.2012
hey i make topic like this here
https://sampforum.blast.hk/showthread.php?tid=364493
try the helps , because i try all of that but dont work
Re: Disabling FS While In MiniGame +REP -
[PDS]DarioKeic - 31.07.2012
I fixed that, But i want to disable filterscript commands. Here i can help.
Add this somewhere at the very top of your script.
Then, Add this to the teleport command that takes you to your minigame.
Next, Add this to every command you want disabled.
Quote:
if(dm[playerid]== 1) return SendClientMessage(playerid, 0xFF0000C8, "You CANNOT Use ThisCommand!,Type /leavedm!");
|
Then you wanna make a command like /leavedm that removes you from the minigame.
Then under that command add.
Your done.
Re: Disabling FS While In MiniGame +REP -
[MM]RoXoR[FS] - 31.07.2012
pawn Код:
new PlayerDM[MAX_PLAYERS];
//When Player Enter DM
PlayerDM[playerid] = 1;
//a public function
forward IsPlayerInDM(playerid);
public IsPlayerInDM(playerid)
{
return PlayerDM[playerid];
}
In Your FS
pawn Код:
// in /v command
new dmcheck = CallRemoteFunction("IsPlayerInDM","i",playerid);
if(dmcheck == 1) return SendClientMessage(playerid,-1,"You must leave DM arena");
//Your other code here
Re: Disabling FS While In MiniGame +REP -
[PDS]DarioKeic - 31.07.2012
Okay, I plugged this into my /v.
Quote:
// in /v command
new dmcheck = CallRemoteFunction("IsPlayerInDM","i",playerid);
if(dmcheck == 1) return SendClientMessage(playerid,-1,"You must leave DM arena");
//Your other code here
|
This is what it looked like.
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(v, 1,cmdtext);
return 0;
}
dcmd_v(playerid, params[])
{
#pragma unused params
ShowVehicleDialog(playerid);
new dmcheck = CallRemoteFunction("IsPlayerInDM","i",playerid);
if(dmcheck == 1) return SendClientMessage(playerid,-1,"You must leave DM arena");
return 1;
}
|
Then. When i enter /dmarena, and try /v it says "You Must leave DM arena" But it still spawns a car.
Re: Disabling FS While In MiniGame +REP -
NuLIO - 31.07.2012
its hard to make in all cmds
PHP код:
if(dm[playerid]== 1) return SendClientMessage(playerid, 0xFF0000C8, "You CANNOT Use ThisCommand!,Type /leavedm!");
its better do
PHP код:
if(IsPlayerInDM[playerid] == true) return SendClientMessage(playerid,-1,"You must leave DM to use this command.Use /leavedm");
Add this to the teleport command that takes you to your minigame
Re: Disabling FS While In MiniGame +REP -
[PDS]DarioKeic - 31.07.2012
Nevermind, I fixed it. I see what i did. +REP and thank you.
Re: Disabling FS While In MiniGame +REP -
[MM]RoXoR[FS] - 31.07.2012
Quote:
Originally Posted by [PDS]DarioKeic
Okay, I plugged this into my /v.
This is what it looked like.
Then. When i enter /dmarena, and try /v it says "You Must leave DM arena" But it still spawns a car.
|
You must first check for DM and then show player dialog.
pawn Код:
dcmd_v(playerid, params[])
{
#pragma unused params
new dmcheck = CallRemoteFunction("IsPlayerInDM","i",playerid);
if(dmcheck == 1) return SendClientMessage(playerid,-1,"You must leave DM arena");
ShowVehicleDialog(playerid);
return 1;
}
Re: Disabling FS While In MiniGame +REP -
[PDS]DarioKeic - 31.07.2012
Wait nope. I did everything. Then when i join my server and type /v, It works, When i goto /dmarena it wont. So then i leave /leavedm, Then it still wont work. Help.
Re: Disabling FS While In MiniGame +REP -
[PDS]DarioKeic - 31.07.2012
Fixed. Sorry, You forgot to tell me to add this under the /leavedm command.