SA-MP Forums Archive
open house problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: open house problem (/showthread.php?tid=463865)



open house problem - caoraivoso3 - 14.09.2013

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;
}

i create a this command to make open and close my house but it just work with house id 0 and i cannot open the others. can you explain me why and how can i fix this issue? thanks i am not seeing the problem here