SA-MP Forums Archive
Need help again - 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: Need help again (/showthread.php?tid=83358)



Need help again - Namaco - 24.06.2009

Hello i need next help xD


well i have questino how to do FBI and Cops can do /duty in the same place?

can someone help me?

Cops place where to do /duty is in LSPD lockers




Re: Whats Wrong? - Namaco - 24.06.2009

Sorry for dobule post


Re: Need help again - NigNog1 - 24.06.2009

I don't understand what your point is. SAMP has lots of different gamemodes and scripts, so you need to be a little more specific.


Re: Need help again - Stah - 24.06.2009

Put this next to your forward's
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Put this anywhere in the script.
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
Put this in OnPlayerCommandText.
pawn Код:
if (strcmp("/duty", cmdtext, true, 10) == 0)
{
   if(PlayerToPoint(4.0, playerid, X, Y, Z))
   {
     //your code here.
   }
}