Timer help
#1

the timer won't start when i put any cmd, maybe u guys can help me out!

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    switch(
success)
    {
        case 
0:
        {
            new 
str[128];
            
//format(string, sizeof(string),"The command '%s' is not in the server database try using (/help).", cmdtext);
            //return SendClientMessage(playerid,COLOR_WHITE,string);
            
format(strsizeof(str), "The command '%s' is not in the server database try using (/help)."cmdtext);
            
Cmddraw1 TextDrawCreate(28.000000435.000000str);
            
TextDrawBackgroundColor(Cmddraw1255);
            
TextDrawFont(Cmddraw11);
            
TextDrawLetterSize(Cmddraw10.5000001.000000);
            
TextDrawColor(Cmddraw1, -10270806);
            
TextDrawSetOutline(Cmddraw10);
            
TextDrawSetProportional(Cmddraw11);
            
TextDrawSetShadow(Cmddraw11);
            
TextDrawSetSelectable(Cmddraw10);
            
TextDrawShowForPlayer(playeridCmddraw1);
            
TextDrawShowForPlayer(playeridCmddraw0);
            
SetTimer("Unkowncmdtimer"5000true); 
Reply
#2

The timer function must be public. Have you forwarded it?
Reply
#3

Quote:
Originally Posted by Sithis
Посмотреть сообщение
The timer function must be public. Have you forwarded it?
Yes i have

PHP код:
forward Unkowncmdtimer(playerid);
public 
Unkowncmdtimer(playerid)
{
    
TextDrawHideForPlayer(playeridCmddraw1);
    
TextDrawHideForPlayer(playeridCmddraw0);
    return 
1;

EDIT: nvm i found the problem
Reply
#4

Ah, a playerid! You should use SetTimerEx which allows you to include the playerid. Check the wiki, it contains an example with a playerid. Let me know if it works for you!
Reply
#5

Quote:
Originally Posted by Sithis
Посмотреть сообщение
Ah, a playerid! You should use SetTimerEx which allows you to include the playerid. Check the wiki, it contains an example with a playerid. Let me know if it works for you!
I just realize that lol, thx anyway
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)