SA-MP Forums Archive
Dm arenas - 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: Dm arenas (/showthread.php?tid=298104)



Dm arenas - vassilis - 19.11.2011

hey guys can you help me...emm i wonder how i can make it to my script so when they are teleported to dm arenas then they have to press /exitdm to exit
Regards,Blacklisted


Re: Dm arenas - Unte99 - 19.11.2011

pawn Код:
SendClientMessage(playerid, -1,"Type /exitdm to exit the arena.");
?

If for real, then you have to use OnPlayerKeyStateChange.


Re: Dm arenas - Kostas' - 19.11.2011

pawn Код:
new bool:pDM[MAX_PLAYERS];

CMD:dmenter(playerid, o[])
{
    pDM[playerid] = 1
        SetPlayerPos(playerid, X, Y, Z);
    return 1;
}


CMD:lsa(playerid, o[])
{
    if(pDM[playerid] == 1) {
        SendClientMessage(playerid, COLOR, "You cannot teleport. Use /dmexit");
    }
    else {
        SetPlayerPos(playerid, X, Y, Z);
    }
    return 1;
}


CMD:dmexit(playerid, o[])
{
    if(pDM[playerid] == 0) {
        SendClientMessage(playerid, COLOR, "[ERROR]: You are not in the DM Zone!");
    }
    else {
        pDM[playerid] == 0
            SetPlayerPos(playerid, X, Y, Z);
    }
    return 1;
}