SA-MP Forums Archive
Unknown command *Help please* - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Unknown command *Help please* (/showthread.php?tid=94621)



Unknown command *Help please* - Yoyoyo - 31.08.2009

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 )


Re: OMG <!> <!> Unknown command <!> <!> OMG - Yoyoyo - 31.08.2009

bump


Re: OMG <!> <!> Unknown command <!> <!> OMG - Mr_Finnigan - 31.08.2009

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.


Re: OMG <!> <!> Unknown command <!> <!> OMG - mirkoiz - 31.08.2009

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



Re: OMG <!> <!> Unknown command <!> <!> OMG - Yoyoyo - 31.08.2009

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


Re: OMG <!> <!> Unknown command <!> <!> OMG - James_Alex - 31.08.2009

try to add returns in your code


Re: OMG <!> <!> Unknown command <!> <!> OMG - Yoyoyo - 31.08.2009

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


Re: Unknown command *Help please* - Yoyoyo - 31.08.2009

bump


Re: Unknown command *Help please* - Yoyoyo - 31.08.2009

can someone please help me!