Help needed of an advanced scripter - 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: Help needed of an advanced scripter (
/showthread.php?tid=339226)
Help needed of an advanced scripter -
speediekiller2 - 02.05.2012
how can I create a script that disables a command with a timer,
for example:
Код:
if(!strcmp("/warusa", cmdtext, true))
{
SetPlayerPos(playerid,2525,-1893,14);
SetPlayerFacingAngle(playerid,180);
}
that the timer does that command turn off
thnx for your help
Re: Help needed of an advanced scripter -
Scenario - 02.05.2012
Add an if-statement in the command to determine if the timer has disabled the command.
Re: Help needed of an advanced scripter -
Jstylezzz - 02.05.2012
pawn Код:
if(!strcmp("/warusa", cmdtext, true))
{
if(GetPVarInt(playerid,"DisabledCMD") == 1) return SendClientMessage(playerid,COLOR_RED,"You can't use this command, you just used it!");
SetPlayerPos(playerid,2525,-1893,14);
SetPlayerFacingAngle(playerid,180);
SetPVarInt(playerid,"DisabledCMD",1);
SetTimer("DisabledCMD,your_time_here,0); //change the your_time_here to your time!
}
forward DisabledCMD(playerid);
public DisabledCMD(playerid)
{
SetPVarInt(playerid,"DisabledCMD",0);
SendClientMessage(playerid,COLOR_GREEN,"You can use the command again!");
}
Not tested, please tell me if it worked
Re: Help needed of an advanced scripter -
HDFord - 02.05.2012
well i think i have something but i have no time to compile so!
pawn Код:
native IsCommandLocked(something);
forward Command();
public Command()
{
IsCommandLocked(1);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/commandlock", cmdtext, true))
{
SetTimer("Command", 10000, false);
}
if(!strcmp("/warusa", cmdtext, true))
{
if (IsCommandLocked(0))
{
SetPlayerPos(playerid,2525,-1893,14);
SetPlayerFacingAngle(playerid,180);
}
else
{
SendClientMessage(playerid,0xFFFFFFFF,"LALALALA");
}
}
return 0;
}
i dont even know if it work just try
Re: Help needed of an advanced scripter -
speediekiller2 - 02.05.2012
thnx Jari_Johnson* it works

your a great,.,.,
thnx for helping all!! im so happy
Re: Help needed of an advanced scripter -
Jstylezzz - 02.05.2012
Quote:
Originally Posted by speediekiller2
thnx Jari_Johnson* it works  your a great,.,.,
thnx for helping all!! im so happy 
|
Your'e welcome