Command Crashed my server then internet
#1

Hello everyone. I have this little problem. I was playing on my server with a few other people and all the sudden i typed the admin commands /fuelcar(s) For a few seconds it froze then the server turned up to end up restarting and keep trying to connect. I tried it on my own connection to see if it was a problem with the server but the same thing happen. Here is the code below. Any help would be appreciated. Thanks for reading and helping.

Код:
}
	if(strcmp(cmd, "/fuelcars", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pAdmin] >= 10)
	    {
	      for(new c=0;c<MAX_VEHICLES;c++)
				{
					Fuel[c] = GasMax;
				}
				SendClientMessageToAll(COLOR_ADMINCMD, "(INFO) All cars refueled by administrator %s");
	    }
	    else
	    {
	      SendClientMessage(playerid, COLOR_GREY, "(ERROR) You are not authorized to use that command");
	      return 1;
	    }
	  }
	  return 1;
	}
Reply
#2

Well Try this

pawn Код:
if(strcmp(cmd, "/fuelcars", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] >= 10)
        {
          for(new c=0;c<MAX_VEHICLES;c++)
                {
                    Fuel[c] = GasMax;
                }
                SendClientMessageToAll(COLOR_ADMINCMD, "(INFO) All cars refueled by administrator %s");
        }
        else
        {
          SendClientMessage(playerid, COLOR_GREY, "(ERROR) You are not authorized to use that command");
          return 1;
        }
Reply
#3

That didn`t seem to work and i can`t figure this out at all. It makes no sense. Here a picture to show what happens.




What happens is i connect i`m a 1338 Admin. I type the following command: /fuelcars then no message appears at all saying they were fueled. Then about 10 seconds later the whole server goes down and attempts to reconnect.
Reply
#4

something in " Fuel[c] = GasMax; " must be causing it, post that part too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)