SA-MP Forums Archive
Simple /enter and /exit CMD's - 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: Simple /enter and /exit CMD's (/showthread.php?tid=266793)



Simple /enter and /exit CMD's - Mr.Black - 06.07.2011

Well.. many formats of /enter and /exit commands are Complicated and not easy to use , so i was looking for an easy format...and not a Complicated Cmd *Note : i want the CMD works ONLY when player at point and same to /exit CMD , if you can do it in a Fromat Code it would be greate, Thanks


Re: Simple /enter and /exit CMD's - Wesley221 - 06.07.2011

pawn Код:
CMD:enter(playerid, cmdtext[])
{
    if(IsPlayerInRangeOfPoint(playerid, range, x, y, z)
    {
        // Codes here
    }
    else if (IsPlayerInRangeOfPoint(playerid, range, x, y, z)
    {
        // Other codes here
    }
    else if (IsPlayerInRangeOfPoint(playerid, range, x, y, z)
    {
        // Again, other codes here
    } else return SendClientMessage(playerid, -1, "You are not in range of the 3 places above");
    return 1;
}
This one uses ZCMD, change it to dcmd, strcmp, anything you want.


Re: Simple /enter and /exit CMD's - Outcast - 06.07.2011

Can't you just make it like:

pawn Код:
CMD:enter(playerid)
{
    IsPlayerInRangeOfPoint(playerid, 10, X, Y, Z...)
    {
     SetPlayerPos(playerid, x2, y2, z2);
    }

and so on, for every location the co-ordinates of the entrance, and the final destination. use search to find that isplayerinrangeofpoint code...
}
Crap, Wesley was faster xD


Re: Simple /enter and /exit CMD's - Mr.Black - 06.07.2011

can you use strcmp ?


Re: Simple /enter and /exit CMD's - Wesley221 - 06.07.2011

Just change "CMD:enter(playerid)" to "if(!strcmp(cmdtext, "/enter", true, 6))".