SA-MP Forums Archive
Command 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: Command problem (/showthread.php?tid=467209)



Command problem - AnonScripter - 02.10.2013

how to make the command works in different points, this doesnt work:
pawn Код:
CMD:robstore(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,313.7608,-133.8826,999.6016)) && if(IsPlayerInRangeOfPoint(playerid,1.0,313.7608,-133.8826,999.6016))
    {



Re: Command problem - UnknownGamer - 02.10.2013

pawn Код:
CMD:robstore(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,313.7608,-133.8826,999.6016) || IsPlayerInRangeOfPoint(playerid,1.0,313.7608,-133.8826,999.6016))
    {
Enjoy


Re: Command problem - AnonScripter - 02.10.2013

i tried it and it made the command only works for the first point, and it doesn't do anything if you are in the second point


Re: Command problem - xganyx - 02.10.2013

pawn Код:
CMD:robstore(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,313.7608,-133.8826,999.6016) && IsPlayerInRangeOfPoint(playerid,1.0,313.7608,-133.8826,999.6016))
    {



Re: Command problem - AnonScripter - 02.10.2013

it worked, thank you, but now i have another problem.
how to make the robbery fails if the player left the store or checkpoint


Re: Command problem - PaulDinam - 02.10.2013

You can check with a timer if the player is commiting a robbery and check if he leaves the x y z, or you can use onplayerleavecheckpoint function.


Re: Command problem - Konstantinos - 02.10.2013

Use OnPlayerInteriorChange or OnPlayerLeaveCheckpoint (or Streamer's callback if you use one).


Re: Command problem - AnonScripter - 02.10.2013

OnPlayerLeaveDynamicCP or OnPlayerInteriorChange
then what ? how to script the robbery failed system ? and stop the robbing timer ?


Re: Command problem - Konstantinos - 03.10.2013

Quote:
Originally Posted by AnonScripter
Посмотреть сообщение
OnPlayerLeaveDynamicCP or OnPlayerInteriorChange
then what ? how to script the robbery failed system ? and stop the robbing timer ?
If the player must stay in the checkpoint and then leave it, that means the robbery failed so do your code.

If the player is in an interior such as shop/casino etc (different from interior 0) and then leave the shop the OnPlayerChangeInterior will be called and you can check if it was in robbery and if the new interior is 0. If so, the robbery failed so do your code.