Disabling FS While In MiniGame +REP
#1

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.
Reply
#2

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
Reply
#3

I fixed that, But i want to disable filterscript commands. Here i can help.

Add this somewhere at the very top of your script.
Quote:

dm[MAX_PLAYERS];

Then, Add this to the teleport command that takes you to your minigame.
Quote:

dm[playerid] = 1;

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.
Quote:

dm[playerid] = 0;

Your done.
Reply
#4

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
Reply
#5

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.
Reply
#6

its hard to make in all cmds
PHP код:
if(dm[playerid]== 1) return SendClientMessage(playerid0xFF0000C8"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
Reply
#7

Nevermind, I fixed it. I see what i did. +REP and thank you.
Reply
#8

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;
}
Reply
#9

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.
Reply
#10

Fixed. Sorry, You forgot to tell me to add this under the /leavedm command.
Quote:

PlayerDM[playerid] = 1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)