їPor quй no funciona?
#9

Quote:
Originally Posted by Ghost112397
Посмотреть сообщение
Deberнas darles una ID respectiva a los camiones, hiciste tremendo embole con lo que hiciste.

Te podes guiar con lo siguiente:
PHP код:
#define MAX_CAMIONES 25
enum infocamiones
{
    
ID,
    
bool:Cargado,
    
Chofer
};
new 
InfoCamion[MAX_CAMIONES][infocamiones],ultimocamion;
public 
OnGameModeInit()
{
    
CrearCamion(456,1745.6877,-2072.1392,13.5060,358.5654,6,0,600);
    return 
1;
}
stock CrearCamion(model,Float:x,Float:y,Float:z,Float:r,c1,c2,respawntime)
{
    
InfoCamion[ultimocamion][ID] = AddStaticVehicleEx(model,x,y,z,r,c1,c2,respawntime);
    
InfoCamion[ultimocamion][Cargado] = false;
    
InfoCamion[ultimocamion][Chofer] = -1;
    
ultimocamion++;
}
stock EsUnCamion(vehicleid)
{
    for(new 
0MAX_CAMIONESi++) 
    { 
        if(
InfoCamion[i][ID] == vehicleid)
        {
            return 
true;
            break;
        }
    }
    return 
false;

Al poner todo asн me tira un error en una funciуn cuando cargas el camiуn

Код:
function TrabajoCamionero(playerid, Tipo)
{
	if(Tipo == EntregarArmero)
	{
	SendClientMessage(playerid,-1,"Entrega el camiуn en condiciones para poder recibir el pago.");
	TogglePlayerControllable(playerid,1);
	Cargamento[playerid] =1;
	SetPlayerCheckpoint(playerid,-116.3876,-322.6960,1.4928,7.0);
	Cargado[playerid]=2;
	}
	else if(Tipo == Entregar247)
	{
	SendClientMessage(playerid,-1,"Entrega el camiуn en condiciones para poder recibir el pago.");
	TogglePlayerControllable(playerid,1);
	Cargamento[playerid]=4;
	SetPlayerCheckpoint(playerid,-116.3876,-322.6960,1.4928,7.0);
	Cargado[playerid]=2;
	}
	else if(Tipo == EntregarDroga)
	{
	SendClientMessage(playerid,-1,"Entrega el camiуn en condiciones para poder recibir el pago.");
	TogglePlayerControllable(playerid,1);
	Cargamento[playerid]=3;
	SetPlayerCheckpoint(playerid,-116.3876,-322.6960,1.4928,7.0);
	Cargado[playerid]=2;
	}
	else if(Tipo == EntregarRopa)
	{
	SendClientMessage(playerid,-1,"Entrega el camiуn en condiciones para poder recibir el pago.");
	TogglePlayerControllable(playerid,1);
	Cargamento[playerid]=2;
	SetPlayerCheckpoint(playerid,-116.3876,-322.6960,1.4928,7.0);
	Cargado[playerid]=2;
	}
	else if(Tipo == CargarArmas)
	{
	SendClientMessage(playerid,-1,"Tu camiуn fuй cargado correctamente, lleva el camiуn al punto rojo marcado en el mapa.");
	Cargamento[playerid]=1;
	TogglePlayerControllable(playerid,1);
	SetPlayerCheckpoint(playerid, 2461.9583,-2617.2573,13.5539,7.0);
	}
	else if(Tipo == CargarRopa)
	{
	SendClientMessage(playerid,-1,"Tu camiуn fuй cargado correctamente, lleva el camiуn al punto rojo marcado en el mapa.");
	Cargamento[playerid]=2;
	TogglePlayerControllable(playerid,1);
	SetPlayerCheckpoint(playerid,2234.5420,-1689.8008,13.8677 ,7.0);
	}
	else if(Tipo == CargarDrogas)
	{
	SendClientMessage(playerid,-1,"Tu camiуn fuй cargado correctamente, lleva el camiуn al punto rojo marcado en el mapa.");
	Cargamento[playerid]=3;
	TogglePlayerControllable(playerid,1);
	SetPlayerCheckpoint(playerid,2362.1731,-1180.6930,27.5124,7.0);
	}
	else if(Tipo == Cargar247)
	{
	SendClientMessage(playerid,-1,"Tu camiуn fuй cargado correctamente, lleva el camiуn al punto rojo marcado en el mapa.");
	Cargamento[playerid]=4;
	TogglePlayerControllable(playerid,1);
	SetPlayerCheckpoint(playerid, 1838.1060,-1831.8807,13.4781,7.0);
	}
    return 1;
}
Lo que dice "Cargado[playerid]=2;" lanza error:

error 028: invalid subscript (not an array or too many subscripts): "Cargado"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply


Messages In This Thread
їPor quй no funciona? - by Fagrinht - 28.09.2015, 20:33
Respuesta: їPor quй no funciona? - by Fagrinht - 29.09.2015, 01:16
Respuesta: їPor quй no funciona? - by Zume - 29.09.2015, 01:27
Respuesta: їPor quй no funciona? - by Ghost112397 - 29.09.2015, 01:28
Respuesta: їPor quй no funciona? - by Fagrinht - 29.09.2015, 02:58
Respuesta: їPor quй no funciona? - by Ghost112397 - 29.09.2015, 03:42
Respuesta: їPor quй no funciona? - by Fagrinht - 29.09.2015, 04:05
Respuesta: їPor quй no funciona? - by Ghost112397 - 29.09.2015, 04:30
Respuesta: їPor quй no funciona? - by Fagrinht - 29.09.2015, 04:49
Respuesta: їPor quй no funciona? - by Ghost112397 - 29.09.2015, 15:42

Forum Jump:


Users browsing this thread: 2 Guest(s)