Command ever 60 seconds
#1

OK
I make if player make /a j
it write him : XXXXXXXXXXXX
But now I want he make /a j and if the player make /a j again
its write him : You been asked to join the activity wait another 60 seconds
Then another 60 seconds he could make the command again
Reply
#2

Put this at the top of the command:
pawn Код:
static LastAction[MAX_PLAYERS]; // very important that it's declared static!

if((gettime() - LastAction[playerid]) < 60)
    return SendClientMessage(playerid, COLOR_RED, "Please wait 60 seconds!");

LastAction[playerid] = gettime();

// rest of stuff here
Reply
#3

OK TNX
and if the 60 seconds have passed
I want its write : 60 seconds have passed you can use the command again
Reply
#4

HELP ??
Reply
#5

pawn Код:
if((gettime() - LastAction[playerid]) == 60)
    return SendClientMessage(playerid, COLOR_RED, "60 seconds have passed you can use the command again");
that is little bit annoying player will wait 60 seconds turn it to 3, 5 seconds or whatever so no user will complain about your anti command spam
Reply
#6

Dont work
its not send message : 60 seconds passed
PHP код:
static LastAction[MAX_PLAYERS]; 
        if((
gettime() - LastAction[playerid]) < 60) return SendClientMessage(playerid,White"бйчщъ одазшай мцшу аеък мфтймеъ , злд гчд еъелм мдщъощ щеб бфчегд");
        if((
gettime() - LastAction[playerid]) == 60) return SendClientMessage(playerid,White"гчд тбшд , аъд йлем мбчщ мдцишу мфтймеъ щеб");
        
LastAction[playerid] = gettime(); 
Reply
#7

Set a 60 second timer instead of using gettime().

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#8

I dont understand you
Reply
#9

I put this :
ActivityJoin[playerid] = SetTimerEx("ActivityJoin",1000,0, "i", playerid);
Error:
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
Reply
#10

Show the declaration of ActivityJoin. Also, are you sure it's on THAT line?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)