[HELP] Error with /enter command - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Error with /enter command (
/showthread.php?tid=149962)
[HELP] Error with /enter command -
LTomi - 24.05.2010
Hey, y'all!
A new day has begun and a new problem has appeared as I tried to upgrade my script. I made an enter command for businesses, based on the LARP's one. Unfortunately, it is bugged, because it says that you are not at the business' entrance even if you are there. Do you have any ideas? (Yeah, it is messed up with the tabulators here, but it looks fine in pawno.)
pawn Код:
if(strcmp("/enter", cmdtext, true) == 0)
{
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if(IsPlayerInRangeOfPoint(3, playerid, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(GetPVarInt(playerid, "BizOwner") == 1 || BizzInfo[i][bLocked] == 0)
{
if(GetPVarInt(playerid, "BizOwner") == 1 || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
SetPlayerVirtualWorld(playerid, BizzInfo[i][bVW]);
SetPlayerFacingAngle(playerid, BizzInfo[i][bExitAngle]);
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
SetPVarInt(playerid, "InBiz", i);
SetCameraBehindPlayer(playerid);
}
else
{
SendClientMessage(playerid, piros, "Nincs nбlad elйg pйnz.");
}
}
else
{
SendClientMessage(playerid, piros, "Az ьzlet zбrva van.");
}
}
else
{
SendClientMessage(playerid, piros, "Nem vagy bejбrat kцzelйben.");
}
}
return 1;
}
Re: [HELP] Error with /enter command -
LTomi - 24.05.2010
No ideas?
Re: [HELP] Error with /enter command -
[MWR]Blood - 24.05.2010
pawn Код:
if(IsPlayerInRangeOfPoint(3, playerid, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
What's this "3"?
Re: [HELP] Error with /enter command -
LTomi - 24.05.2010
Quote:
|
Originally Posted by ikarus❶❸❸❼
pawn Код:
if(IsPlayerInRangeOfPoint(3, playerid, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
What's this "3"?
|
It is the furthest distance from the entrance point. I can see the problem now, I have to swap the playerid and the number 3.