Help me!
#1

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 ??
Reply
#2

zcmd include have these callbacks

public OnPlayerCommandReceived(playerid, cmdtext[])

and

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=605252
Reply
#4

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
Reply
#5

i still don't get it any one can explain
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=354077
Reply
#7

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 !"
Reply
#8

or you mean like this

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    
SetPVarInt(playerid"crukk11"GetTickCount());
    return 
true;
}
public 
OnPlayerCommandReceived(playeridcmdtext[])
{
    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;

Reply
#9

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
Reply
#10

you mean like this

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


Forum Jump:


Users browsing this thread: 1 Guest(s)