13.05.2016, 00:50
This is the second command that I'm creating as I had never created any command and CMD, hope not to bother and if they can help me since I have upset many friends.
I do not speak English and I'm using the ****** translator, a thousand apologies.
This happens when I create a second home, the error only happens with ID 1 House the other houses not
I do not speak English and I'm using the ****** translator, a thousand apologies.
PHP код:
CMD:comprarcasa(playerid, params[])
{
new houseid = -1;
for(new i = 0; i < MAX_CASAS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]))
{
if(CasaInfo[houseid][cPropietario] != 0) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}Esta casa no estб en venta.");
if(CasaInfo[houseid][cPrecio] > PlayerInfo[playerid][Dinero]) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No tienes el dinero suficiente para adquirir estб casa.");
CasaInfo[i][cPropietario] = PlayerInfo[playerid][ID];
ActualizarCasas(houseid);
GuardarCasas(houseid);
GivePlayerMoney(playerid, -CasaInfo[i][cPrecio]);
SendClientMessageEx(playerid, COLOR_VERDE_1, "INFORMACIУN: {C7C7C7}Has adquirido una nueva casa por %s.", FormatoCantidad(CasaInfo[i][cPrecio]));
}
else return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No estбs cerca de una casa para utilizar el comando.");
}
return 1;
}
This happens when I create a second home, the error only happens with ID 1 House the other houses not