Command Timer
#1

Hi guys! Can you help me with adding a timer at this command? (to use the command in 5 to 5 minutes ) (5 minutes=300000) ...im trying for 2 hours and nothing..

Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIGHTGREEN 0x90EE90FF
#define COLOR_GALEBENF 0xFFCC66AA
#define COLOR_AG_SYNTAX 0x0090ba9b
#define COLOR_GREEN 0x33AA33AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA

#define suggestPATH "Suggestions/suggestionlog.txt"

#if defined FILTERSCRIPT

#else

#endif

COMMAND:suggest(playerid, params[])
{
    new string[128],suggestion[128],pName[MAX_PLAYER_NAME];
    new File:Log = fopen(suggestPATH, io_append);
    new logData[128];
    if(sscanf(params,"s[128]",suggestion)) return SendClientMessage(playerid, COLOR_AG_SYNTAX,"USAGE: /suggest [sugestie]");
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_GALEBENF, "» Sugestia ta a fost trimisa catre admini!");
    format(logData, sizeof logData, "%s a trimis o sugestie: %s \r\n",pName,suggestion);
    fwrite(Log, logData);
    fclose(Log);
    return 1;
}
Thank you, and have a nice day!
Reply
#2

pawn Код:
COMMAND:suggest(playerid, params[])
{
    SetTimer("message", (1000 * 60 * 5), false);
    return 1;
}

forward message();
public message()
{
    print("1 second has passed.");
}
https://sampwiki.blast.hk/wiki/SetTimer

If you are going to make that timer set a variable to 0 (false) so that you are able to use the command again then use timestamps instead. Over-check: https://sampforum.blast.hk/showthread.php?tid=254915.
Reply
#3

Kevin, i've posted here because i don't know PAWN (almost nothing). Thanks anyway!
Reply
#4

Quote:
Originally Posted by AlexR
Посмотреть сообщение
Kevin, i've posted here because i don't know PAWN (almost nothing). Thanks anyway!
That isn't an excuse to avoid learning.

References:
Reply
#5

I tried those tutorials, but i can't do it man, and i need this command in 1 hour....understand me, i just can't
Reply
#6

Quote:
Originally Posted by AlexR
Посмотреть сообщение
I tried those tutorials, but i can't do it man, and i need this command in 1 hour....understand me, i just can't
Please, at least try. Read http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf.

I already gave you an example of a timer also, you have the wiki too.

If you don't want to script anything and want others to do all the work for you, please post in this thread: https://sampforum.blast.hk/showthread.php?tid=447813.

If you don't even bother to try, you are going to go no-where in the world of programming.

C'mon, give it a try! You can do it!
Good luck, my friend!
Reply
#7

Wow, thanks for your help, i just said...I've been trying for 2 hours and i need this script in 1 hour, thats why i posted here. I don't have time to learn at 8pm when i need to learn for exams. And btw, it's just a small command which will take you 2 minutes, but anyway, there are others good people who can help me. Try to understand that not all of us have time.
Reply
#8

If you don't have time for anything (except to reply to this thread) and have no prior knowledge of PAWN, then you shouldn't be scripting or creating a server; rather learning. This section isn't a place where people just ask for things to be done for them, it's a place to ask for help on things they created; I provided an example, yet you don't want to take it into consideration. Go post in that thread I told you about earlier.

Please refer to the forum rules and read what it says about this section. Hmmm, you know what. I'll post the part for you.
Quote:
◦Script Requests - If you are requesting a script be made for you, rather than help with your coding, post in the Looking for scripters/helpers? Post here! Thread.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)