OnPlayerCommandText
#1

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

Define a variable and use it to check if the player is in the minigame.
Reply
#3

Then add that command above the line. I believe it will work.
Reply
#4

While creating your command
use the variable
CMD:balbla(playerid,params[])
{
if(Minigames[playerid] == 1)
{
Your things
}
return 1;
}
Reply
#5

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

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

Quote:
Originally Posted by Bingo
Посмотреть сообщение
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;
}
Dude, Will i just add that if in 200 command? lol.
Reply
#8

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

Quote:
Originally Posted by Bingo
Посмотреть сообщение
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;
}
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;
}
Reply
#10

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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)