31.08.2014, 02:04
Buenas, que tal estбn todos, estuve creando un sistema de creaciуn de vehнculos dentro del juego, pero el problema es que no me crea el vehнculo, їalguien me podrнa ayudar?
Si alguien me ayuda a solucionarlo, le darй su merecido +1, desde ya muchas gracias.
EDIT: No sй si sera esto lo que causa que los coches no se creen, pero igual se los dejo aquн:
pawn Код:
CMD:crearauto(playerid, params[])
{
new modelo, lx, ly, lz, color1, color2, respawn;
new Float:x, Float:y, Float:z, Float:angulo;
new i = SlotAutoLibre();
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "No eres administrador");
if(sscanf(params,"uiiiiii",modelo, lx, ly, lz,color1,color2,respawn)) return SendClientMessage(playerid, -1, "/crearauto (Modelo) (Color1) (Color2) (Tiempo de respawn)");
if(i == -1) return SendClientMessage(playerid, -1, "No se pueden crear mбs coches");
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angulo);
InformacionA[i][aModelo] = modelo;
InformacionA[i][aPosX] = x;
InformacionA[i][aPosY] = y;
InformacionA[i][aPosZ] = z;
InformacionA[i][aRotacion] = angulo;
InformacionA[i][aColor1] = color1;
InformacionA[i][aColor2] = color2;
InformacionA[i][aRespawn] = respawn;
CreateVehicle(modelo, x, y, z, angulo, color1, color2, respawn);
Iter_Add(aAutos,i);
ActualizarAutos(i);
}
return 1;
}
EDIT: No sй si sera esto lo que causa que los coches no se creen, pero igual se los dejo aquн:
pawn Код:
stock SlotAutoLibre()
{
for(new i; i < MAX_CARS; i++)
{
if(!strlen(InformacionA[i][aModelo]) && !InformacionA[i][aPosX] && !InformacionA[i][aPosZ])
{
return i;
}
}
return -1;
}