[Help] Minigame's
#1

Hey there,
I wanna make some minigames. I know how I can make that..
But how can I disable commands for players, when they are in a minigame?
If they try to make a command in a minigame, they will see this message: Sorry you are currectly in a minigame, /kill to leave!

And when a player leaved it they can use commands.


Thanks

BEER-Samp
Reply
#2

Use a variable or boolean to detect that.
EX:
pawn Code:
new IsInMinigame[MAX_PLAYERS] = 0;

// Under OnPlayerConnect
IsInMinigame[playerid] = 0;

// On Your Commands
if(IsInMinigame[playerid] == 1) return SendClientMessage(playerid,-1,"Type /Kill To Leave");

// /Kill ;p
CMD:kill(playerid,params[])
{
SetPlayerHealth(playerid,0);
IsInMinigame[playerid] = 0;
return 1;
}
Reply
#3

You can easily create a variable that sets to 1 when the player is in a minigame, and you can make a stock to check if the player is in a minigame. If he is, you can return a SendClientMessage with the message.

EDIT: Looks like someone already did something similar, post above. Much better to see it then read what I wrote.
Reply
#4

Quote:
Originally Posted by Kindred
View Post
You can easily create a variable that sets to 1 when the player is in a minigame, and you can make a stock to check if the player is in a minigame. If he is, you can return a SendClientMessage with the message.

EDIT: Looks like someone already did something similar, post above. Much better to see it then read what I wrote.
Can u show a example of that? And I didnt use ZCMD
Reply
#5

I didnt use ZCMD, and I didnt know exactly what u mean. Can u send an example of that what u mean? or better info
Reply
#6

Just put your command in your minigame and remove commands in one other gamemode
Reply
#7

But when I that do, will it again work?
Reply
#8



Try it.
Reply
#9

Anyone they can help me?
Reply
#10

Hey i used this method also put IsInMinigame[playerid] = 0; on player death but after death player is still not able to use commands its again saying use /kill
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)