їPor quй esta funciуn no me deja compilar? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: їPor quй esta funciуn no me deja compilar? (
/showthread.php?tid=602691)
їPor quй esta funciуn no me deja compilar? -
Fagrinht - 11.03.2016
Al agregar esta funciуn el pawno deja de funcionar їquй tiene de malo?..
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid,"Trans_Inicio") == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsATransportistaCar(GetPlayerVehicleID(playerid)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
const size_s = 60*(sizeof(Cargas_L_T)+1);
new string[size_s];
format(string, sizeof(string), "Producto\tGanancias\tLugar\n");
for(new i; i < sizeof(Cargas_L_T); i++)
{
format(string, sizeof(string), "%s%s\tMin $%i\t%s\n", string, Cargas_L_T[i][ct_Name], Cargas_L_T[i][ct_Precio], Cargas_L_T[i][ct_Lugar]);
}
ShowPlayerDialog(playerid, DIALOG_TRANSPORTISTA, DIALOG_STYLE_TABLIST_HEADERS, "Escoge que quieres transportar", string, "Aceptar", "Salir");
DeletePVar(playerid, "Trans_Inicio");
DisablePlayerCheckpoint(playerid);
}
}
}
return 1;
}
DisablePlayerCheckpoint(playerid);
return 1;
}
if(GetPVarInt(playerid, "Trans_Entrega") == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsATransportistaCar(GetPlayerVehicleID(playerid)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
Tiempo_L_T[playerid][0] = 0;
Tiempo_L_T[playerid][1] = 0;
PlayerTextDrawHide(playerid, Trans_Tiempo[playerid]);
PlayerTextDrawDestroy(playerid, Trans_Tiempo[playerid]);
GameTextForPlayer(playerid, "~r~Descargando...", 12000, 1);
SetTimerEx("Func_Descargar", 12000, false, "ii", playerid, GetPVarInt(playerid, "Trans_ID_Carga"));
DisablePlayerCheckpoint(playerid);
}
}
}
return 1;
}
if(GetPVarInt(playerid, "Trans_Entrega") == 2)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsATransportistaCar(GetPlayerVehicleID(playerid)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
new trailerid = GetVehicleTrailer(GetPlayerVehicleID(playerid));
DetachTrailerFromVehicle(trailerid);
SetVehicleToRespawn(trailerid);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, "Has hecho una entrega.");
DisablePlayerCheckpoint(playerid);
DeletePVar(playerid, "Trans_Entrega");
DeletePVar(playerid, "Trans_ID_Carga");
}
}
}
return 1;
}
Respuesta: їPor quй esta funciуn no me deja compilar? -
FelipeAndres - 11.03.2016
Faltaba cerrar una llave
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid,"Trans_Inicio") == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsATransportistaCar(GetPlayerVehicleID(playerid)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
const size_s = 60*(sizeof(Cargas_L_T)+1);
new string[size_s];
format(string, sizeof(string), "Producto\tGanancias\tLugar\n");
for(new i; i < sizeof(Cargas_L_T); i++)
{
format(string, sizeof(string), "%s%s\tMin $%i\t%s\n", string, Cargas_L_T[i][ct_Name], Cargas_L_T[i][ct_Precio], Cargas_L_T[i][ct_Lugar]);
}
ShowPlayerDialog(playerid, DIALOG_TRANSPORTISTA, DIALOG_STYLE_TABLIST_HEADERS, "Escoge que quieres transportar", string, "Aceptar", "Salir");
DeletePVar(playerid, "Trans_Inicio");
DisablePlayerCheckpoint(playerid);
}
}
}
return 1;
}
DisablePlayerCheckpoint(playerid);
if(GetPVarInt(playerid, "Trans_Entrega") == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsATransportistaCar(GetPlayerVehicleID(playerid)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
Tiempo_L_T[playerid][0] = 0;
Tiempo_L_T[playerid][1] = 0;
PlayerTextDrawHide(playerid, Trans_Tiempo[playerid]);
PlayerTextDrawDestroy(playerid, Trans_Tiempo[playerid]);
GameTextForPlayer(playerid, "~r~Descargando...", 12000, 1);
SetTimerEx("Func_Descargar", 12000, false, "ii", playerid, GetPVarInt(playerid, "Trans_ID_Carga"));
DisablePlayerCheckpoint(playerid);
}
}
}
}
if(GetPVarInt(playerid, "Trans_Entrega") == 2)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsATransportistaCar(GetPlayerVehicleID(playerid)))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
new trailerid = GetVehicleTrailer(GetPlayerVehicleID(playerid));
DetachTrailerFromVehicle(trailerid);
SetVehicleToRespawn(trailerid);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, "Has hecho una entrega.");
DisablePlayerCheckpoint(playerid);
DeletePVar(playerid, "Trans_Entrega");
DeletePVar(playerid, "Trans_ID_Carga");
}
}
}
}
return 1;
}