SelfMade /enter not working. [Rep+] - 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: SelfMade /enter not working. [Rep+] (
/showthread.php?tid=320385)
SelfMade /enter not working. [Rep+] -
ricardo178 - 22.02.2012
Hello. I made this /enter command for my house system, but it is not working.. It simply says i am not near any house when i am..
pawn Код:
CMD:enter(playerid, params[])
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, HouseInfo[i][X], HouseInfo[i][Y], HouseInfo[i][Z]))
{
if(HouseInfo[i][Lock] == 0)
{
SetPlayerPos(playerid, HouseInfo[i][IntX], HouseInfo[i][IntY], HouseInfo[i][IntZ]);
SetPlayerInterior(playerid, HouseInfo[i][Int]);
SetPlayerVirtualWorld(playerid, HouseInfo[i][Vw]);
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "This house is locked.");
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not near a house.");
}
return 1;
}
The load houses:
pawn Код:
forward LoadHouses();
public LoadHouses()
{
for(new i = 1; i < sizeof(HouseInfo); i++)
{
format(file, sizeof(file), "RRP/houses/%d.ini", i);
if(fexist(file))
{
HouseInfo[i][X] = dini_Int(file, "X");
HouseInfo[i][Y] = dini_Int(file, "Y");
HouseInfo[i][Z] = dini_Int(file, "Z");
HouseInfo[i][Int] = dini_Int(file, "Int");
HouseInfo[i][Vw] = dini_Int(file, "Vw");
HouseInfo[i][Owner] = dini_Int(file, "Owner");
HouseInfo[i][Lock] = dini_Int(file, "Lock");
HouseInfo[i][Price] = dini_Int(file, "Price");
HouseInfo[i][IntX] = dini_Int(file, "IntX");
HouseInfo[i][IntY] = dini_Int(file, "IntY");
HouseInfo[i][IntZ] = dini_Int(file, "IntZ");
}
}
print("[RRP]: Houses Loadeds");
return 1;
}
Thank you.
Re : SelfMade /enter not working. [Rep+] -
ricardo178 - 22.02.2012
Fixed it, by changing 0 to 1 in for.