I need some help with my trucking FS
#1

So I've made FS for trucking, with doesn't give out any warns. Also In-game all of the command errors work like
"you're not in truck" or so, but when I do everything right (Stand on right place, in right vehicle) Server gives out unknown command.

Here is the code:

Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>

new PickUpLoad;
new PickUpUnload;

#if defined FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA



public OnFilterScriptInit()
{
	PickUpLoad = CreatePickup(1239, 1, 2334.8611, -2081.3384, 13.5469, 0); // Loading Point
	PickUpUnload = CreatePickup(1239, 1, -1969.5801, -2431.8479, 30.6250, 0); //Unloading point



	print("\n--------------------------------------");
	print("iron_delivery");
	print("--------------------------------------\n");
	return 1;
}

enum cInfo
{
	iron
};

new CarInfo[700][cInfo];

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

CMD:unloadiron(playerid, params[])
{
	if(GetPlayerScore(playerid) >= -500)
	{

		new vehicleid1 = GetPlayerVehicleID(playerid);
	    if(IsPlayerInRangeOfPoint(playerid, 7.0, 2334.8611, -2081.3384, 13.5469))
	    {
	        if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
	        {
	            if(CarInfo[vehicleid1][iron] == 25)
	            {
	                CarInfo[vehicleid1][iron] = 0;
	                new cash = random(1000-10000)+1000;
	                GivePlayerMoney(playerid, cash);
					new string[64];
					format(string,sizeof(string),"You earned %d from delivery",cash);
					SendClientMessage(playerid,0xFFFFFFAA,string);
					return 1;
				}
				else return SendClientMessage(playerid, 0x00000014, "Your truck is emtpy!");
			}
	        if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
	        {
	            if(CarInfo[vehicleid1][iron] == 50)
	            {
	                CarInfo[vehicleid1][iron] = 0;
	                new cash = random(2000-20000)+2000;
	                GivePlayerMoney(playerid, cash);
					new string[64];
					format(string,sizeof(string),"You earned %d from delivery",cash);
					SendClientMessage(playerid,0xFFFFFFAA,string);
					return 1;
				}
				else return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
			}
			if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
	        {
	            if(CarInfo[vehicleid1][iron] == 100)
	            {
	                CarInfo[vehicleid1][iron] = 0;
	                new cash = random(3000-30000)+3000;
	                GivePlayerMoney(playerid, cash);
					new string[64];
					format(string,sizeof(string),"You earned %d from delivery",cash);
					SendClientMessage(playerid,COLOR_ORANGE,string);
					return 1;
				}
				else return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
			}
			if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
	        {
	            if(CarInfo[vehicleid1][iron] == 100)
	            {
	                CarInfo[vehicleid1][iron] = 0;
	                new cash = random(3000-30000)+3000;
	                GivePlayerMoney(playerid, cash);
					new string[64];
					format(string,sizeof(string),"You earned %d from delivery",cash);
					SendClientMessage(playerid,0xFFFFFFAA,string);
					return 1;
				}
				else return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
			}
			else return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a truck!");
		}
		else return SendClientMessage(playerid, COLOR_ORANGE, "You are not near the delivery point!");
	}
	else return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");
}

CMD:loadiron(playerid, params[])
{
	if(GetPlayerScore(playerid) >= -500)
	{
		new vehicleid1 = GetPlayerVehicleID(playerid);
	    if(IsPlayerInRangeOfPoint(playerid, 7.0, -1969.5801, -2431.8479, 30.6250))
	    {
			if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
	        {
	            if(CarInfo[vehicleid1][iron] == 0)
	            {
	                CarInfo[vehicleid1][iron] = 25;
	                GivePlayerMoney(playerid, -1000);
					SendClientMessage(playerid, COLOR_ORANGE, "You loaded full truck of iron, and paid  $1000 for it! Head to unload place");
					return 1;
				}
				else return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
			}
	        if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
	        {
	            if(CarInfo[vehicleid1][iron] == 0)
	            {
	                CarInfo[vehicleid1][iron] = 50;
	                GivePlayerMoney(playerid, -2000);
					SendClientMessage(playerid, 0x00900082, "You loaded full truck iron, and paid  $2000 for it! Head to unload place");
					return 1;
				}
				else return SendClientMessage(playerid, 0x00000014, "Your truck is emtpy!");
			}
			if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
	        {
	            if(CarInfo[vehicleid1][iron] == 0)
	            {
	                CarInfo[vehicleid1][iron] = 100;
	                GivePlayerMoney(playerid, -3000);
					SendClientMessage(playerid, 0x00900082, "You loaded full truck of iron, and paid  $3000 for it! Head to unload place");
					return 1;
				}
				else return SendClientMessage(playerid, 0x00000014, "Your truck is full!");
			}
			if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
	        {
	            if(CarInfo[vehicleid1][iron] == 0)
	            {
	                CarInfo[vehicleid1][iron] = 100;
	                GivePlayerMoney(playerid, -3000);
					SendClientMessage(playerid, 0x00900082, "You loaded full trailer iron, and paid  $3000 for it! Head to unload place");
					return 1;
				}
				else return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is already full!");
			}
			else return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a iron delivery truck!");
		}
		else return SendClientMessage(playerid, COLOR_ORANGE, "You are not near a loading point!");
	}
	else return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");

}

CMD:helptruck(playerid, params[])
{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks: Bobcat(422), Sadler(543), Yosemite(554)");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks: Rumpo(440), Boxville(609), Mule(414), Yankee(456), Burrito(482)");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks: Linerunner(403), Roadtrain(515), Flatbed(455), Tanker(514)");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers: Article-trailer(435), Article-trailer 2(450), Article-trailer 3(591)");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks can only carry up to 25 pieces of iron, wicth will cost you 1k.");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks can only carry up to 50 pieces of iron, wicth will cost you 2k.");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks and trailers can carry up to 50 pieces of iron, wicth will cost you 3k.");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers can be taken for free from Flint Country gas station.");
}

CMD:frisktruck(playerid, params[])
{
	new vehicleid1 = GetPlayerVehicleID(playerid);
	if(GetPlayerScore(playerid) >= -500)
	{
		if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
	    {
			if(CarInfo[vehicleid1][iron] == 0)
			{
			    SendClientMessage(playerid, 0x00900082, "Iron 0/25");
			    return 1;
			}
			if(CarInfo[vehicleid1][iron] == 25)
			{
				SendClientMessage(playerid, 0x00900082, "Iron 25/25");
				return 1;
			}
		}
		if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
	    {
			if(CarInfo[vehicleid1][iron] == 0)
			{
			    SendClientMessage(playerid, 0x00900082, "Iron 0/50");
			    return 1;
			}
			if(CarInfo[vehicleid1][iron] == 50)
			{
				SendClientMessage(playerid, 0x00900082, "Iron 50/50");
				return 1;
			}
		}
		if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
		{

			if(CarInfo[vehicleid1][iron] == 0)
			{
			    SendClientMessage(playerid, 0x00900082, "Iron 0/100");
			    return 1;
			}
			if(CarInfo[vehicleid1][iron] == 100)
			{
				SendClientMessage(playerid, 0x00900082, "Iron 100/100");
				return 1;
			}
		}
		if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
  		{
			if(CarInfo[vehicleid1][iron] == 0)
			{
			    SendClientMessage(playerid, 0x00900082, "Iron 0/100");
			    return 1;
			}
			if(CarInfo[vehicleid1][iron] == 100)
			{
				SendClientMessage(playerid, 0x00900082, "Iron 100/100");
				return 1;
			}
			return 1;
		}
		else return SendClientMessage(playerid, 0x00000014, "You are not near any trucks!");
	}
	else return SendClientMessage(playerid, 0x00000014, "You cannot use this command");
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
   	if(pickupid == PickUpLoad)
	{
		GameTextForPlayer(playerid,"~b~Use /unloadiron to sell your iron!",2000,1);
	    return 1;
	}
  	if(pickupid == PickUpUnload)
	{
		GameTextForPlayer(playerid,"~b~Use /loadiron to buy your iron!",2000,1);
	    return 1;
	}
	return 1;
}
Reply
#2

Which specific commands give you the "SERVER: Unknown command." ?
Reply
#3

Quote:
Originally Posted by GiamPy.
Посмотреть сообщение
Which specific commands give you the "SERVER: Unknown command." ?
Well I can say all but none... If i do /loadiron in for example turismo on the right place the message saying im not in the right veh. shows up. If I do it kn truck but not in the right place message saying I need to move closer shows. But when im in the right vehicle on the right place it shows unknown command, w/o finishing any functions. Same stuff appear fot frisk and unload. The only working command is helptruck.
Reply
#4

The code was really messy. Try now:

pawn Код:
CMD:unloadiron(playerid, params[])
{
    if(GetPlayerScore(playerid) >= -500)
    {
        new vehicleid1 = GetPlayerVehicleID(playerid);
       
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2334.8611, -2081.3384, 13.5469))
        {
            if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
            {
                if(CarInfo[vehicleid1][iron] == 25)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(1000-10000)+1000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is empty!");
            }
            else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
            {
                if(CarInfo[vehicleid1][iron] == 50)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(2000-20000)+2000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }
            else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
            {
                if(CarInfo[vehicleid1][iron] == 100)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(3000-30000)+3000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,COLOR_ORANGE,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }          
            else if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
            {
                if(CarInfo[vehicleid1][iron] == 100)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(3000-30000)+3000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }
            else
                return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a truck!");
        }
        else
            return SendClientMessage(playerid, COLOR_ORANGE, "You are not near the delivery point!");
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");
   
    return 1;
}

CMD:loadiron(playerid, params[])
{
    if(GetPlayerScore(playerid) >= -500)
    {
        new vehicleid1 = GetPlayerVehicleID(playerid);
       
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -1969.5801, -2431.8479, 30.6250))
        {
            if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 25;
                    GivePlayerMoney(playerid, -1000);
                    SendClientMessage(playerid, COLOR_ORANGE, "You loaded full truck of iron, and paid  $1000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
            }
            else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 50;
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full truck iron, and paid  $2000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is emtpy!");
            }
            else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 100;
                    GivePlayerMoney(playerid, -3000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full truck of iron, and paid  $3000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is full!");
            }
            if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 100;
                    GivePlayerMoney(playerid, -3000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full trailer iron, and paid  $3000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is already full!");
            }
            else
                return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a iron delivery truck!");
        }
        else
            return SendClientMessage(playerid, COLOR_ORANGE, "You are not near a loading point!");
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");

    return 1;
}

CMD:helptruck(playerid, params[])
{
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks: Bobcat(422), Sadler(543), Yosemite(554)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks: Rumpo(440), Boxville(609), Mule(414), Yankee(456), Burrito(482)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks: Linerunner(403), Roadtrain(515), Flatbed(455), Tanker(514)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers: Article-trailer(435), Article-trailer 2(450), Article-trailer 3(591)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks can only carry up to 25 pieces of iron, wicth will cost you 1k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks can only carry up to 50 pieces of iron, wicth will cost you 2k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks and trailers can carry up to 50 pieces of iron, wicth will cost you 3k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers can be taken for free from Flint Country gas station.");
    return 1;
}

CMD:frisktruck(playerid, params[])
{
    new vehicleid1 = GetPlayerVehicleID(playerid);
   
    if(GetPlayerScore(playerid) >= -500)
    {
        if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/25");
            else if(CarInfo[vehicleid1][iron] == 25)
                SendClientMessage(playerid, 0x00900082, "Iron 25/25");
        }
        else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/50");
            else if(CarInfo[vehicleid1][iron] == 50)
                SendClientMessage(playerid, 0x00900082, "Iron 50/50");
        }
        else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/100");
            else if(CarInfo[vehicleid1][iron] == 100)
                SendClientMessage(playerid, 0x00900082, "Iron 100/100");
        }
        else if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/100");
            if(CarInfo[vehicleid1][iron] == 100)
                SendClientMessage(playerid, 0x00900082, "Iron 100/100");
        }
        else
            return SendClientMessage(playerid, 0x00000014, "You are not near any trucks!");
    }
    else
        return SendClientMessage(playerid, 0x00000014, "You cannot use this command");
       
    return 1;
}
Reply
#5

I can't try it now since im on phone, I'll check it tomorrow, and thanks for help !
Reply
#6

Код:
C:\Users\Ziga\Desktop\RP Skripta\Raven's Roleplay 0.3x\filterscripts\Iron_trucking.pwn(141) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Your code gives out that warrning, after removing the return 1; warrning is gone, but server still gives out unknown command, like before
Reply
#7

Try now:

pawn Код:
CMD:unloadiron(playerid, params[])
{
    if(GetPlayerScore(playerid) >= -500)
    {
        new vehicleid1 = GetPlayerVehicleID(playerid);
       
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2334.8611, -2081.3384, 13.5469))
        {
            if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
            {
                if(CarInfo[vehicleid1][iron] == 25)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(1000-10000)+1000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is empty!");
            }
            else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
            {
                if(CarInfo[vehicleid1][iron] == 50)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(2000-20000)+2000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }
            else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
            {
                if(CarInfo[vehicleid1][iron] == 100)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(3000-30000)+3000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,COLOR_ORANGE,string);
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }          
            else if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
            {
                if(CarInfo[vehicleid1][iron] == 100)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(3000-30000)+3000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }
            else
                return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a truck!");
        }
        else
            return SendClientMessage(playerid, COLOR_ORANGE, "You are not near the delivery point!");
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");
   
    return 1;
}

CMD:loadiron(playerid, params[])
{
    if(GetPlayerScore(playerid) >= -500)
    {
        new vehicleid1 = GetPlayerVehicleID(playerid);
       
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -1969.5801, -2431.8479, 30.6250))
        {
            if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 25;
                    GivePlayerMoney(playerid, -1000);
                    SendClientMessage(playerid, COLOR_ORANGE, "You loaded full truck of iron, and paid  $1000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
            }
            else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 50;
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full truck iron, and paid  $2000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is emtpy!");
            }
            else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 100;
                    GivePlayerMoney(playerid, -3000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full truck of iron, and paid  $3000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is full!");
            }
            if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 100;
                    GivePlayerMoney(playerid, -3000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full trailer iron, and paid  $3000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is already full!");
            }
            else
                return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a iron delivery truck!");
        }
        else
            return SendClientMessage(playerid, COLOR_ORANGE, "You are not near a loading point!");
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");

    return 1;
}

CMD:helptruck(playerid, params[])
{
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks: Bobcat(422), Sadler(543), Yosemite(554)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks: Rumpo(440), Boxville(609), Mule(414), Yankee(456), Burrito(482)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks: Linerunner(403), Roadtrain(515), Flatbed(455), Tanker(514)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers: Article-trailer(435), Article-trailer 2(450), Article-trailer 3(591)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks can only carry up to 25 pieces of iron, wicth will cost you 1k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks can only carry up to 50 pieces of iron, wicth will cost you 2k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks and trailers can carry up to 50 pieces of iron, wicth will cost you 3k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers can be taken for free from Flint Country gas station.");
    return 1;
}

CMD:frisktruck(playerid, params[])
{
    new vehicleid1 = GetPlayerVehicleID(playerid);
   
    if(GetPlayerScore(playerid) >= -500)
    {
        if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/25");
            else if(CarInfo[vehicleid1][iron] == 25)
                SendClientMessage(playerid, 0x00900082, "Iron 25/25");
        }
        else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/50");
            else if(CarInfo[vehicleid1][iron] == 50)
                SendClientMessage(playerid, 0x00900082, "Iron 50/50");
        }
        else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/100");
            else if(CarInfo[vehicleid1][iron] == 100)
                SendClientMessage(playerid, 0x00900082, "Iron 100/100");
        }
        else if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/100");
            if(CarInfo[vehicleid1][iron] == 100)
                SendClientMessage(playerid, 0x00900082, "Iron 100/100");
        }
        else
            return SendClientMessage(playerid, 0x00000014, "You are not near any trucks!");
    }
    else
        return SendClientMessage(playerid, 0x00000014, "You cannot use this command");
       
    return 1;
}
Reply
#8

Nope, still shows unknown command.
I might want to note that im using Ravens roleplay as a GM, could that be a difficulty?

EDIT: I think that error appears here:

Код:
                if(CarInfo[vehicleid1] [iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 25;
                    GivePlayerMoney(playerid, -1000);
                    SendClientMessage(playerid, COLOR_ORANGE, "You loaded full truck of iron, and paid  $1000 for it! Head to unload place");
                }
Because everything till now works, untill I come to this, it says unknown command.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)