SERVER: Unknown command
#1

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.

PHP код:
CMD:comprarcasa(playeridparams[]) 

    new 
houseid = -1
    for(new 
0MAX_CASASi++) 
    { 
        if(
IsPlayerInRangeOfPoint(playerid2.5CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ])) 
        { 
            if(
CasaInfo[houseid][cPropietario] != 0) return SendClientMessage(playeridCOLOR_ROJO"ERROR: {C7C7C7}Esta casa no estб en venta."); 
            if(
CasaInfo[houseid][cPrecio] > PlayerInfo[playerid][Dinero]) return SendClientMessage(playeridCOLOR_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(playeridCOLOR_VERDE_1"INFORMACIУN: {C7C7C7}Has adquirido una nueva casa por %s."FormatoCantidad(CasaInfo[i][cPrecio])); 
        } 
        else return 
SendClientMessage(playeridCOLOR_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

Reply
#2

pawn Код:
CMD:comprarcasa(playerid, params[])
{
    for(new i = 0; i < MAX_CASAS; i++)  
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.5, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]))  
        {
            if(CasaInfo[i][cPropietario] != 0) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}Esta casa no estб en venta.");  
            if(CasaInfo[i][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(i);  
            GuardarCasas(i);  
            GivePlayerMoney(playerid, -CasaInfo[i][cPrecio]);  
            SendClientMessageEx(playerid, COLOR_VERDE_1, "INFORMACIУN: {C7C7C7}Has adquirido una nueva casa por %s.", FormatoCantidad(CasaInfo[i][cPrecio]));
            return 1;
        }
    }

    SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No estбs cerca de una casa para utilizar el comando.");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)