16.09.2013, 20:11
well i create a cmd to open my house but it only works proprely whitch house id 0, i cannot open the others because the isplayerinrangeofpoint.
the command:
CMD:abrirporta(playerid,params[])
{
for(new i = 0; i < MAX_CASAS;i++)
{
if(!IsPlayerInRangeOfPoint(playerid,8.0,CInfo[i][entradax],CInfo[i][entraday],CInfo[i][entradaz])) return SendClientMessage(playerid,-1,"estas lonje de casas para abrir.");
if ( CInfo[i][estadocasa] == 1)
{
CInfo[i][estadocasa] = 0;
SendClientMessage(playerid,-1,"fexaste casa.");
return 1;
}
if (CInfo[i][estadocasa] == 0)
{
CInfo[i][estadocasa] = 1;
SendClientMessage(playerid,-1,"abriste casa.");
return 1;
}
}
return 1;
}
anyone can help me?
the command:
CMD:abrirporta(playerid,params[])
{
for(new i = 0; i < MAX_CASAS;i++)
{
if(!IsPlayerInRangeOfPoint(playerid,8.0,CInfo[i][entradax],CInfo[i][entraday],CInfo[i][entradaz])) return SendClientMessage(playerid,-1,"estas lonje de casas para abrir.");
if ( CInfo[i][estadocasa] == 1)
{
CInfo[i][estadocasa] = 0;
SendClientMessage(playerid,-1,"fexaste casa.");
return 1;
}
if (CInfo[i][estadocasa] == 0)
{
CInfo[i][estadocasa] = 1;
SendClientMessage(playerid,-1,"abriste casa.");
return 1;
}
}
return 1;
}
anyone can help me?