Unknown command *Help please*
#1

I have this code:

Код:
	if(strcmp(cmd, "/tplant", true) == 0)
	{
 		if(gTeam[playerid] == TEAM_USA)
  		{
  		new tanker = GetClosestPlayer(playerid);
  		if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
			{
				if(gTeam[tanker] == TEAM_USA)
				{
  				SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
				  return 1;
				}
				new tank = GetPlayerVehicleID(tanker);
				if(GetVehicleModel(tank) == 432)
				{
					SetVehicleHealth(tank, 0.0);
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
			}
		}
			else if(gTeam[playerid] == TEAM_GERMANY)
			{
			  new tanker = GetClosestPlayer(playerid);
			  if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
			  {
			    if(gTeam[tanker] == TEAM_GERMANY)
			    {
			      SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
			      return 1;
			    }
			    new tank = GetPlayerVehicleID(tanker);
			    if(GetVehicleModel(tank) == 432)
			    {
			      SetVehicleHealth(tank, 0.0);
    				}
    			}
    			else
    			{
    			  SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
    			}
			}
			return 1;
		}
If the person on the other team is driving a tank the player can do /tplant and his tank will go on fire.

When i do the command ingame it says unknown command. Is it because noboby is near me + no one is in server? ( 127 . 0 . 0 . 7 - LAN )
Reply
#2

bump
Reply
#3

Quote:
Originally Posted by Yoyoyo
bump
It has been said alot recently that all the OMG <!> <!> Unknown command <!> <!> OMG stuff is very annoying and you will find alot of people will just ignore them.
Try saying Please help with my problem. No exclamation points or OMG or fuck,fuck,fuck.
Reply
#4

pawn Код:
if(strcmp(cmd, "/tplant", true) == 0)
    {
        if(gTeam[playerid] == TEAM_USA)
        {
        new tanker = GetClosestPlayer(playerid);
        if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
            {
                if(gTeam[tanker] == TEAM_USA)
                {
                SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
                  return 1;
                }
                new tank = GetPlayerVehicleID(playerid);
                if(GetVehicleModel(tank) == 432)
                {
                    SetVehicleHealth(tank, 100.0);
                    return 1;
                }
            }
            else
            {
              SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
                return 1;
            }
        }
        else if(gTeam[playerid] == TEAM_GERMANY)
        {
            new tanker = GetClosestPlayer(playerid);
            if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
            {
                if(gTeam[tanker] == TEAM_GERMANY)
                {
                SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
                return 1;
            }
              new tank = GetPlayerVehicleID(playerid);
              if(GetVehicleModel(tank) == 432)
              {
                SetVehicleHealth(tank, 0.0);
                    return 1;
                }
                else
                {
                  SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
                    return 1;
                }
            }
            return 1;
        }
        return 1;
    }
Reply
#5

Quote:
Originally Posted by Mr_FinnigaN
Quote:
Originally Posted by Yoyoyo
bump
It has been said alot recently that all the OMG <!> <!> Unknown command <!> <!> OMG stuff is very annoying and you will find alot of people will just ignore them.
Try saying Please help with my problem. No exclamation points or OMG or fuck,fuck,fuck.
lol ok
Reply
#6

try to add returns in your code
Reply
#7

Quote:
Originally Posted by ►☺◄©ookie►☺◄
pawn Код:
if(strcmp(cmd, "/tplant", true) == 0)
    {
        if(gTeam[playerid] == TEAM_USA)
        {
        new tanker = GetClosestPlayer(playerid);
        if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
            {
                if(gTeam[tanker] == TEAM_USA)
                {
                SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
                  return 1;
                }
                new tank = GetPlayerVehicleID(playerid);
                if(GetVehicleModel(tank) == 432)
                {
                    SetVehicleHealth(tank, 100.0);
                    return 1;
                }
            }
            else
            {
              SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
                return 1;
            }
        }
        else if(gTeam[playerid] == TEAM_GERMANY)
        {
            new tanker = GetClosestPlayer(playerid);
            if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
            {
                if(gTeam[tanker] == TEAM_GERMANY)
                {
                SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
                return 1;
            }
              new tank = GetPlayerVehicleID(playerid);
              if(GetVehicleModel(tank) == 432)
              {
                SetVehicleHealth(tank, 0.0);
                    return 1;
            }
            else
            {
              SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
                    return 1;
            }
            }
            return 1;
        }
        return 1;
    }
still dosnt work...
Reply
#8

bump
Reply
#9

can someone please help me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)