30.09.2014, 01:30
Buenas, estuve intentando hacer este comando pero no me da -_-" al momento de usarlo me dice que no puedo tener mбs vehнculos mientras que no tengo ninguno.
De antemano muchas gracias.
pawn Код:
CMD:comprarveh(playerid, params[])
{
foreach(aAutos,i)
{
new texto[128], veh;
veh = GetPlayerVehicleID(playerid);
if(InformacionA[i][aComprado] == true) return SendClientMessage(playerid, -1, "El vehнculo no se encuentra comprado");
if(GetPlayerMoney(playerid) < InformacionA[i][aPrecio]) return SendClientMessage(playerid, -1, "No tines suficiente dinero");
if(Informacion[playerid][pLlaves1] == 999999)
{
Informacion[playerid][pLlaves1] = veh;
InformacionA[i][aComprado] = true;
format(texto, sizeof(texto), "{FFFFFF}Felicidades, compraste el vehнculo por {00FF40}%i",InformacionA[i][aPrecio]);
SendClientMessage(playerid, -1, texto);
GivePlayerMoney(playerid, -InformacionA[i][aPrecio]);
}
else if(Informacion[playerid][pLlaves2] == 999999)
{
Informacion[playerid][pLlaves2] = veh;
GivePlayerMoney(playerid, -InformacionA[i][aPrecio]);
InformacionA[i][aComprado] = true;
format(texto, sizeof(texto), "{FFFFFF}Felicidades, compraste el vehнculo por {00FF40}%i",InformacionA[i][aPrecio]);
SendClientMessage(playerid, -1, texto);
}
else
{
SendClientMessage(playerid, -1, "No puedes tener mбs vehнculos");
}
}
return 1;
}