[Ajuda] Server:Unknown command error
#1

Bom galera desculpa incomodar, mas estou com uma dificuldade nesse comando
Код:
	if(strcmp(cmd, "/load", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			new tmpcar = GetPlayerVehicleID(playerid);
			if(!IsATruck(tmpcar))
			{
				GameTextForPlayer(playerid, "~r~Voce nao esta num caminhao", 5000, 1);
				return 1;
			}
			format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
			SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
		}
		return 1;
	}
aparece 0/0 nгo importa o caminhao
Код:
forward IsATruck(vehicleid);
enum pHaul
{
	pCapasity,
	pLoad,
};
new PlayerHaul[MAX_VEHICLES][pHaul];
Код:
public IsATruck(vehicleid)
{
	for(new i = 0; i < sizeof(caminhaocar); i++)
	{
	    if(vehicleid == caminhaocar[i]) return 1;
	}
	return 0;
}
Код:
public OnGameModeInit()
{

	caminhaocar[0] = AddStaticVehicleEx(403,2458.5984,-2077.5225,13.5469,180.8157,1,0,30000); // Linerunner
	caminhaocar[1] = AddStaticVehicleEx(403,2470.1030,-2075.8335,13.5469,177.9956,1,0,30000); // Linerunner
	caminhaocar[2] = AddStaticVehicleEx(403,2437.5808,-2107.2761,13.5530,1.1290,1,0,30000); // Linerunner
	caminhaocar[3] = AddStaticVehicleEx(403,2430.3086,-2106.7422,13.5469,5.5157,1,0,30000); // Linerunner
	caminhaocar[4] = AddStaticVehicleEx(456,2508.9116,-2111.7759,13.7206,0,-1,-1, 30000); // Component Truck Yankee 108
	caminhaocar[5] = AddStaticVehicleEx(456,2484.5356,-2111.7759,13.7196,0,-1,-1,30000); // Component Truck Yankee 109
	caminhaocar[6] = AddStaticVehicleEx(440,2529.0413,-2085.3999,13.6651,90,-1,-1,30000); // Component Truck Rumpo 110
	caminhaocar[7] = AddStaticVehicleEx(440,2528.9482,-2092.6104,13.6631,90,-1,-1,30000); // Component Truck Rumpo 111
	caminhaocar[8] = AddStaticVehicleEx(456,1670.7562,-1476.2228,13.5562,88.9853,5,5,-1); // truck 1    [ 390 ]
	caminhaocar[9] = AddStaticVehicleEx(456,1680.2968,-1476.3918,13.5573,88.9854,86,86,-1); // truck 2    [ 391 ]
	caminhaocar[10] = AddStaticVehicleEx(440,1697.7805,-1476.0262,13.4957,90.0862,14,14,-1); // truck 3    [ 392 ]
	caminhaocar[11] = AddStaticVehicleEx(440,1691.4647,-1476.0363,13.5047,90.0953,2,2,-1); // truck 4    [ 393 ]


	PlayerHaul[caminhaocar[0]][pCapasity]=100;
	PlayerHaul[caminhaocar[1]][pCapasity]=90;
	PlayerHaul[caminhaocar[2]][pCapasity]=80;
	PlayerHaul[caminhaocar[3]][pCapasity]=70;
	PlayerHaul[caminhaocar[4]][pCapasity]=60;
	PlayerHaul[caminhaocar[5]][pCapasity]=50;
	PlayerHaul[caminhaocar[6]][pCapasity]=40;
	PlayerHaul[caminhaocar[7]][pCapasity]=30;
	PlayerHaul[caminhaocar[8]][pCapasity]=25;
	PlayerHaul[caminhaocar[9]][pCapasity]=20;
	PlayerHaul[caminhaocar[10]][pCapasity]=15;
	PlayerHaul[caminhaocar[11]][pCapasity]=10;

	return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)