Block teleport ?
#1

I'm using this filterscript for minigun deathmatch..

https://sampforum.blast.hk/showthread.php?tid=362040

But how should i block teleport commands if i am in minigun deathmatch (/mdm) like /aa /sfa and etc ?

And instead to leave /mdm i have to type /leave
Reply
#2

pawn Код:
//Here are the /aa and /sfa etc.. commands
if(InMDM{ playerid } ) return SendClientMessage(playerid, -1, "* You must leave the Minigun-DM before using teleports!");
//rest of the /aa and /sfa etc.. script
Reply
#3

pawn Код:
if (InMDM[playerid] = 1)
{
//code for when player is in DM
}
else if (inMDM[playerid] = 0)
{
//code for when player is not in DM
}
This is what you've got to do:

pawn Код:
COMMAND:leave(playerid, params[])
{
    if (InMDM[playerid] = 1)
    {
        SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
        SendClientMessage(playerid, -1 , "You have left the DM arena.");
    }
     else if (inMDM[playerid] = 0)
    {
        SendClientMessage(playerid, -1 , "You are not in the DM arena.");
    }
    return 1;
}
I used ZCMD, but If you're using another command processor, the thing you need is in there.

If you want to block a specific command, just do it like this:

pawn Код:
COMMAND:getgun(playerid, params[])
{
    if (InMDM[playerid] = 1)
    {
        SendClientMessage(playerid, -1 , "You can't use commands while in the MDM arena!");
    }
     else if (inMDM[playerid] = 0)
    {
        //code to give the gun, for example
    }
    return 1;
}
Reply
#4

Error while compiling leave script

Код:
#include <a_samp>

COMMAND:leave(playerid, params[])
{
    if (InMDM[playerid] = 1)
    {
        SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
        SendClientMessage(playerid, -1 , "You have left the Minigun Deathmatch Arena.");
    }
     else if (inMDM[playerid] = 0)
    {
        SendClientMessage(playerid, -1 , "You are not in the Minigun Deathmatch Arena.");
    }
    return 1;
}
warning 203: symbol is never used: "leave"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#5

Did you include ZCMD? What command processor are you using?
Reply
#6

Quote:
Originally Posted by Twizted
Посмотреть сообщение
Did you include ZCMD? What command processor are you using?
Yes

#include <zcmd>

If you don't mind can you please give me script cause i am new to samp :\
Reply
#7

Post your script to Pastebin and then post the address linking to it here, I'll add it for you.
Reply
#8

Quote:
Originally Posted by Twizted
Посмотреть сообщение
Post your script to Pastebin and then post the address linking to it here, I'll add it for you.
http://pastebin.com/AFQHDAJ0
Reply
#9

Watch out for fails when scripting.
pawn Код:
COMMAND:leave(playerid, params[])
{
    if (InMDM[playerid] = 1)
    {
        SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
        SendClientMessage(playerid, -1 , "You have left the DM arena.");
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)