ublic function lacks forward declaration?
#1

Trying to compile after I made my timer, this is the warning I get


Код:
TDM.pwn(279) : warning 235: public function lacks forward declaration (symbol "myfunction")
The code I wrote

under game mode init
Код:
SetTimer("myfunction",200000, 1);
and the function

Код:
public myfunction(playerid)
{
	SendClientMessage(playerid, COLOR_YELLOW, "Enjoy your stay at Hudgens Funserver");
	return 1;
}
Note: It works fine in-game but I want the code to be clean.
Reply
#2

add
pawn Код:
forward myfunction(playerid);
Reply
#3

Do you mean:

Код:
forward myfunction(playerid)
{
	SendClientMessage(playerid, COLOR_YELLOW, "Enjoy your stay at Hudgens Funserver");
	return 1;
}
Cuz' that aint working .
Reply
#4

pawn Код:
forward myfunction(playerid);
public myfunction(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "Enjoy your stay at Hudgens Funserver");
    return 1;
}
Reply
#5

Oh never mind I solved it now(sorry for double post).
Reply
#6

good!!


Happy 2011!!
Reply
#7

Thanks and to you to mate
Reply
#8

Your timer is wrong btw, it should be:
pawn Код:
SetTimerEx("myfunction", 200000, 1, "i", playerid);
But then you would need to put it at OnPlayerConnect or something or replace the code in your callback with SendClientMessageToAll. Because the code as you have it now will only work for ID 0.
Reply
#9

Quote:
Originally Posted by [03]Garsino
Посмотреть сообщение
Your timer is wrong btw, it should be:
pawn Код:
SetTimer("myfunction", 200000, 1, "i", playerid);
But then you would need to put it at OnPlayerConnect or something or replace the code in your callback with SendClientMessageToAll. Because the code as you have it now will only work for ID 0.
Actually, it would be "SetTimerEx".
Reply
#10

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Actually, it would be "SetTimerEx".
Yeah, I know, I just copied his code so I didn't had to rewrite it, but I forgot to add Ex at the end ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)