Help me! - 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 me! (
/showthread.php?tid=640286)
Help me! -
TYDS - 31.08.2017
i am using zcmd to create command i want every command player have to wait about 8 seconds to do a next command
when player /somecommand and use another command or that command again it will have a alert something like
"You have to wait %d seconds to use next command"
any ideas ??
Re: Help me! -
TYDS - 31.08.2017
zcmd include have these callbacks
public OnPlayerCommandReceived(playerid, cmdtext[])
and
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
Re: Help me! -
crukk11 - 31.08.2017
https://sampforum.blast.hk/showthread.php?tid=605252
Re: Help me! -
TYDS - 31.08.2017
Quote:
Originally Posted by crukk11
|
show i just do something like this :
if(gettime() < timer_Waiting[playerid])
// and then
timer_Waiting[playerid] = gettime() + seconds; // Replace seconds with whatever.
in OnPlayerCommandReceived and OnPlayerCommandPerformed
Re: Help me! -
TYDS - 31.08.2017
i still don't get it any one can explain
Re: Help me! -
crukk11 - 31.08.2017
https://sampforum.blast.hk/showthread.php?tid=354077
Re: Help me! -
TYDS - 31.08.2017
Quote:
Originally Posted by crukk11
|
in SendClientMessage(playerid,0xFF0000FF,"You can only type ONE command every THREE seconds!");
how can i make it's for count down like SendClientMessage(playerid,0xFF0000FF,"You can only type ONE command every %d seconds !"
Re: Help me! -
crukk11 - 31.08.2017
or you mean like this
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
SetPVarInt(playerid, "crukk11", GetTickCount());
return true;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(GetTickCount()-GetPVarInt(playerid, "crukk11") < 1000*5)
{
SendClientMessage(playerid, -1, "You must wait 5 seconds to return to using a command.");
return true;
}
return true;
}
Re: Help me! -
TYDS - 31.08.2017
i mean when i /somecommand
and use another command it's will be like this
Please Wait 5 Seconds to use next command
the number 5 will count down to 0
Re: Help me! -
crukk11 - 31.08.2017
you mean like this
https://sampforum.blast.hk/showthread.php?tid=528046