Range bug [Giving rep] [small 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: Range bug [Giving rep] [small problem] (
/showthread.php?tid=310153)
Range bug [Giving rep] [small problem] -
Twinki1993 - 10.01.2012
Well what I am doing here wrong..
Код:
if (strcmp("/Russiangateopen", cmdtext, true) == 0 || (strcmp("/Rgo", cmdtext, true) == 0))
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, -1820.6879, 1.8925, 15.1172))
{
SendClientMessage(playerid, COLOR_RED, "<!>You are not in range of that gate!");
return 1;
}
SendClientMessage(playerid, COLOR_YELLOW, "<!>You have just opened the gate!");
MoveObject(gateR1, -1817.5251, 1.9901, 10.4987, 1, 0.00, 0.00, 91.00); //opened
return 1;
}
I made gates that are working but only if you are 20 feet away from them... I wanted to make it if you are 20feet+ away that you cannot open it. Gates are working but only if you are 20+ feet away...
Re: Range bug [Giving rep] [small problem] -
Norck - 10.01.2012
Check it out:
pawn Код:
if (strcmp("/Russiangateopen", cmdtext, true) == 0 || (strcmp("/Rgo", cmdtext, true) == 0))
{
if(!IsPlayerInRangeOfPoint(playerid, 20.0, -1820.6879, 1.8925, 15.1172)) // not in range
{
SendClientMessage(playerid, COLOR_RED, "<!>You are not in range of that gate!");
return 1;
}
SendClientMessage(playerid, COLOR_YELLOW, "<!>You have just opened the gate!");
MoveObject(gateR1, -1817.5251, 1.9901, 10.4987, 1, 0.00, 0.00, 91.00); //opened
return 1;
}
Re: Range bug [Giving rep] [small problem] -
Twinki1993 - 10.01.2012
Thanks mate!
Sent the rep ^_^