Block teleport ? - 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: Block teleport ? (
/showthread.php?tid=495202)
Block teleport ? -
vikassharma - 16.02.2014
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
Re: Block teleport ? -
Kyance - 16.02.2014
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
Re: Block teleport ? -
Twizted - 16.02.2014
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;
}
Re: Block teleport ? -
vikassharma - 16.02.2014
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.
Re: Block teleport ? -
Twizted - 16.02.2014
Did you include ZCMD? What command processor are you using?
Re: Block teleport ? -
vikassharma - 16.02.2014
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 :\
Re: Block teleport ? -
Twizted - 16.02.2014
Post your script to Pastebin and then post the address linking to it here, I'll add it for you.
Re: Block teleport ? -
vikassharma - 16.02.2014
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
Re: Block teleport ? -
Necip - 16.02.2014
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.");
}
}