Where is the worng ?
spam <- array(GetMaxPlayers(), 0 );
function spam(player)
{
local player=FindPlayer(player);
if(player)
{
spam[player.ID] = 1;
}
}
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else if {
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
Quote from: KrooB on Jul 02, 2018, 11:39 AMWhere is the worng ?
spam <- array(GetMaxPlayers(), 0 );
function spam(player)
{
local player=FindPlayer(player);
if(player)
{
spam[player.ID] = 1;
}
}
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else if {
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
you forgot the closing in the command
use
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else
{
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
}
Quote from: kennedyarz on Jul 02, 2018, 12:24 PMQuote from: KrooB on Jul 02, 2018, 11:39 AMWhere is the worng ?
spam <- array(GetMaxPlayers(), 0 );
function spam(player)
{
local player=FindPlayer(player);
if(player)
{
spam[player.ID] = 1;
}
}
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else if {
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
you forgot the closing in the command
use
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else if
{
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
}
ERROR ->
else if
{
There's a } missing. You will need a brain donor to fix it.
use
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else
{
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
}
@D.VilCTOR its worked but I can not use the command again
I came back a short time pro vcmp I still did not remember the right functions but try this
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
return;
{
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
return 1;
}
Not worked bro :( but thnx for your help :)
Okay
What you want to do? Means what should happen when player use command arava
I want to prevent the car command from being written
LIKE
- /arava
- message :your heal 100
- /arava
- message The command will be active after 5 seconds
I cant understand what you want say
Once you have used the command, wait 5 seconds for one more command
Quote from: KrooB on Jul 02, 2018, 07:35 PMOnce you have used the command, wait 5 seconds for one more command
add a class with a timer. When a player uses this type cmd, set the class to true and run a timer for 5 seconds which changes the value to false. Add a validation at start of the command that if that class is true, give error message otherwise continue.
The code is fixed
else if (cmd == "arava")
{
if(spam[player.ID] == 5 ) MessagePlayer("Dont Spam!",player);
else
{
spam[player.ID]++;
player.Health = 100;
NewTimer( "spam", 5000, 0, player.Name );
}
}