Where is the error?

KrooB

  • Jr. Member
  • BEN TÜRKÜM
  • Posts: 87
Where is the error?
«  »

Where is the worng ?

Code: [Select]
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 );
}


we are new because we are watching the old ???

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 335
Re: Where is the error?
« Reply #1,  »Last edited
Quote from KrooB on July 2nd, 12:39 PM
Where is the worng ?

Code: [Select]
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

Code: [Select]
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 );
        }
}

KrooB

  • Jr. Member
  • BEN TÜRKÜM
  • Posts: 87
Re: Where is the error?
« Reply #2,  »
Quote from kennedyarz on July 2nd, 01:24 PM
Quote from KrooB on July 2nd, 12:39 PM
Where is the worng ?

Code: [Select]
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

Code: [Select]
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
      {
we are new because we are watching the old ???

Athanatos

  • Hero Member
  • Working on maybe the best VC:MP server ever
  • Posts: 636
Re: Where is the error?
« Reply #3,  »
There's a } missing. You will need a brain donor to fix it.

D.VICTOR

  • Newbie
  • *VCMP*
  • Posts: 34
Re: Where is the error?
« Reply #4,  »
use
Code: [Select]
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 );
        }
 }

KrooB

  • Jr. Member
  • BEN TÜRKÜM
  • Posts: 87
Re: Where is the error?
« Reply #5,  »
@D.VilCTOR its worked but I can not use the command again
we are new because we are watching the old ???

D.VICTOR

  • Newbie
  • *VCMP*
  • Posts: 34
Re: Where is the error?
« Reply #6,  »
I came back a short time pro vcmp I still did not remember the right functions but try this

Code: [Select]
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;
 }

KrooB

  • Jr. Member
  • BEN TÜRKÜM
  • Posts: 87
we are new because we are watching the old ???

D.VICTOR

  • Newbie
  • *VCMP*
  • Posts: 34

umar4911

  • Sr. Member
  • Creating own server!
  • Posts: 376
Re: Where is the error?
« Reply #9,  »
What you want to do? Means what should happen when player use command arava
I am gamer, programmer and hacker. Try to find me!
xD

KrooB

  • Jr. Member
  • BEN TÜRKÜM
  • Posts: 87
Re: Where is the error?
« Reply #10,  »
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
we are new because we are watching the old ???

umar4911

  • Sr. Member
  • Creating own server!
  • Posts: 376
I am gamer, programmer and hacker. Try to find me!
xD

KrooB

  • Jr. Member
  • BEN TÜRKÜM
  • Posts: 87
Re: Where is the error?
« Reply #12,  »
Once you have used the command, wait 5 seconds for one more command
we are new because we are watching the old ???

umar4911

  • Sr. Member
  • Creating own server!
  • Posts: 376
Re: Where is the error?
« Reply #13,  »
Quote from KrooB on July 2nd, 08:35 PM
Once 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.
Re: Where is the error?
« Reply #14,  »
The code is fixed
Code: [Select]
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 );
        }
 }
I am gamer, programmer and hacker. Try to find me!
xD