OnPlayerCommandText -
Ghazal - 17.04.2014
Hello,
So i have added this under OnPlayerCommandText
Код:
if(Minigames[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You cant use commands now."), 0;
And its working fine
But i got a question .. I want to enable just one command When player is in minigames
Help please.
Re: OnPlayerCommandText -
offon - 17.04.2014
Define a variable and use it to check if the player is in the minigame.
Re: OnPlayerCommandText -
HitterHitman - 17.04.2014
Then add that command above the line. I believe it will work.
Re: OnPlayerCommandText -
Gaurav_Rawat - 17.04.2014
While creating your command
use the variable
CMD:balbla(playerid,params[])
{
if(Minigames[playerid] == 1)
{
Your things
}
return 1;
}
Re: OnPlayerCommandText -
Hanuman - 17.04.2014
Just try to put ur command above that line
pawn Код:
//your command
if(Minigames[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You cant use commands now."), 0;
Re: OnPlayerCommandText -
Bingo - 17.04.2014
https://sampforum.blast.hk/showthread.php?tid=507362
I explained you right?
pawn Код:
dcmd_command(playerid,params[])
{
if(Minigames[playerid] == 1)
{
SendClientMessage........
//goes your stuff
}
return 1;
}
Re: OnPlayerCommandText -
Ghazal - 17.04.2014
Quote:
Originally Posted by Bingo
|
Dude, Will i just add that if in 200 command? lol.
Re: OnPlayerCommandText -
Bingo - 17.04.2014
Quote:
Originally Posted by Maro06
Dude, Will i just add that if in 200 command? lol.
|
You stated above only 'one' cmd, So which cmd you want that players can use while in minigames you've to add

.
Re: OnPlayerCommandText -
Hanuman - 17.04.2014
Quote:
Originally Posted by Bingo
|
I think Bingo has forgotten to add "||Minigames[playerid] == 0" bcoz he need's that the player can use his command inside minigame as well as outside minigame.
From Bingo codes u should do it like this.
pawn Код:
dcmd_command(playerid,params[])
{
if(Minigames[playerid] == 1 || Minigames[playerid] == 0)
{
SendClientMessage........
//goes your stuff
}
return 1;
}
Re: OnPlayerCommandText -
Bingo - 17.04.2014
Quote:
Originally Posted by Hanuman
I think Bingo has forgotten to add "||Minigames[playerid] == 0" bcoz he need's that the player can use his command inside minigame as well as outside minigame.
From Bingo codes u should do it like this.
pawn Код:
dcmd_command(playerid,params[]) { if(Minigames[playerid] == 1 || Minigames[playerid] == 0) { SendClientMessage........ //goes your stuff } return 1; }
|
if(Minigames[playerid] == 1 - If player in minigame
Minigames[playerid] == 0) - If player not in minigame
So he wants some commands to be utilizied inside minigame so this (if(Minigames[playerid] == 1).