public OnGameModeInit()
{
vehcam[0] = CreateVehicle(414, 1052.8551, 1917.7247, 10.8981, 0.0000, -1, -1, 100);
vehcam[1] = CreateVehicle(414, 1060.3757, 1917.9557, 10.8981, 0.0000, -1, -1, 100);
vehcam[2] = CreateVehicle(414, 1067.8254, 1917.8627, 10.8981, 0.0000, -1, -1, 100);
vehcam[3] = CreateVehicle(414, 1076.5006, 1917.8225, 10.8981, 0.0000, -1, -1, 100);
vehcam[4] = CreateVehicle(414, 1082.6708, 1917.7721, 10.8981, 0.0000, -1, -1, 100);
vehcam[5] = CreateVehicle(414, 1091.2550, 1917.8107, 10.8981, 0.0000, -1, -1, 100);
vehcam[6] = CreateVehicle(414, 1106.0496, 1920.0028, 10.8981, 90.0000, -1, -1, 100);
vehcam[7] = CreateVehicle(414, 1106.0044, 1925.8887, 10.8981, 90.0000, -1, -1, 100);
vehcam[8] = CreateVehicle(414, 1106.0172, 1934.7740, 10.8981, 90.0000, -1, -1, 100);
vehcam[9] = CreateVehicle(414, 1106.0516, 1911.2572, 10.8981, 90.0000, -1, -1, 100);
vehcam[10] = CreateVehicle(414, 1106.1534, 1903.8564, 10.8981, 90.0000, -1, -1, 100);
vehcam[11] = CreateVehicle(414, 1106.1299, 1896.6113, 10.8981, 90.0000, -1, -1, 100);
vehcam[12] = CreateVehicle(414, 1091.7219, 1889.2329, 10.8981, 180.0000, -1, -1, 100);
vehcam[13] = CreateVehicle(414, 1082.8315, 1889.2240, 10.8981, 180.0000, -1, -1, 100);
vehcam[14] = CreateVehicle(414, 1076.6324, 1889.3217, 10.8981, 180.0000, -1, -1, 100);
for(new i; i < MAX_CAMIONES; i++)
{
InformacionCam[i][CAM_ID] = vehcam[i];
}
return 1;
}
stock GetCamionID(vehicleid)
{
for(new i; i < MAX_CAMIONES; i++)
{
if(InformacionCam[i][CAM_ID] != vehicleid)
continue;
return i;
}
return -1;
}
stock GetCamionID(vehicleid){
new id;
for(new xx=0, xxx<MAX_CAMIONES; xx<=xxx; xx++){{
if(InformacionCam[xx][CAM_ID] == vehicleid) id = xx;
else id = -1;
}
return id;
}
new vhTruckCount;
public OnGameModeInit()
{
CreateTruck(414, 1052.8551, 1917.7247, 10.8981, 0.0000, -1, -1, 100);
CreateTruck(414, 1060.3757, 1917.9557, 10.8981, 0.0000, -1, -1, 100);
CreateTruck(414, 1067.8254, 1917.8627, 10.8981, 0.0000, -1, -1, 100);
CreateTruck(414, 1076.5006, 1917.8225, 10.8981, 0.0000, -1, -1, 100);
CreateTruck(414, 1082.6708, 1917.7721, 10.8981, 0.0000, -1, -1, 100);
CreateTruck(414, 1091.2550, 1917.8107, 10.8981, 0.0000, -1, -1, 100);
CreateTruck(414, 1106.0496, 1920.0028, 10.8981, 90.0000, -1, -1, 100);
CreateTruck(414, 1106.0044, 1925.8887, 10.8981, 90.0000, -1, -1, 100);
CreateTruck(414, 1106.0172, 1934.7740, 10.8981, 90.0000, -1, -1, 100);
CreateTruck(414, 1106.0516, 1911.2572, 10.8981, 90.0000, -1, -1, 100);
CreateTruck(414, 1106.1534, 1903.8564, 10.8981, 90.0000, -1, -1, 100);
CreateTruck(414, 1106.1299, 1896.6113, 10.8981, 90.0000, -1, -1, 100);
CreateTruck(414, 1091.7219, 1889.2329, 10.8981, 180.0000, -1, -1, 100);
CreateTruck(414, 1082.8315, 1889.2240, 10.8981, 180.0000, -1, -1, 100);
CreateTruck(414, 1076.6324, 1889.3217, 10.8981, 180.0000, -1, -1, 100);
return 1;
}
stock CreateTruck(model, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
{
InformacionCam[vhTruckCount][CAM_ID] = CreateVehicle(model, x, y, z, angle, color1, color2, respawn_delay, addsiren);
vhTruckCount ++;
}
stock GetTruckID(vehicleid)
{
new truckid = -1;
for(new i = 0; i < MAX_CAMIONES; i ++)
{
if(InformacionCam[i][CAM_ID] == vehicleid)
{
truckid = i;
break;
}
}
return truckid;
}
Vas bien, pero hay algunos notas. No es necesario hacer un loop para asignar una variable como el ID de un vehнculo y cuando vayas a retornar un valor en un loop, parra el loop primero con "break;", y luego retorna el valor.
pawn Код:
|
if(GetTruckID(veh) == -1) return MensajeError(playerid, -1, "No estas en un vehнculo del trabajo.");
C:\Users\Equipo\PosibleRP\gamemodes\Gamemode.pwn(9 19) : error 001: expected token: "-string end-", but found "-identifier-" |
if(GetTruckID(veh) == -1) return SendClientMessage(playerid, -1, "No estas en un vehнculo del trabajo.");
pawn Код:
|
#define MensajeError(%0,%1) SendClientMessage(%0,-1,"{FF0000}[ERROR]:{FFFFFF} "%1)
Pero yo ya tengo esto:
pawn Код:
|