#1

Hey all, I did the timer how It said in the wiki.

then I did this for the timer functions:

Код:
public outofhospital()
{
 SetPlayerPos(playerid, 1179.1493,-1322.9857,14.1552);
 TogglePlayerControllable(playerid, 1);
 SendClientMessage(playerid, COLOR_GREEN, "You are out of hospital");
}
All seemed ok untill it said that the 1st 2nd and 3rd function was giving error: undefined symbol "playerid".

So I tried removing playerid and I got an error saying: Number of arguments dont match the definition?

could someone help?
thanks
Reply
#2

public outofhospital(playerid)

and use SetTimerEx instead of SetTimer.
Reply
#3

Quote:
Originally Posted by RKS_
public outofhospital(playerid)
thanks :P

Quote:

and use SetTimerEx instead of SetTimer.

whats the difference?
Reply
#4

SetTimerEx allows you to define the variables of the function, in this case 'playerid'

example:
SetTimerEx("outofhospital",30000,0,"i",playerid); the "i" mean that the variable is an integer, check the wiki for more uses
Reply
#5

Quote:
Originally Posted by SA:MP Wiki
format[] Special format indicating the types of the variables following
{Float,_}:... Indefinite number of arguments to pass
I dont really understand that, guess I should just continue using SetTimer?
Reply
#6

if you will do that, it will only work for id 0. If you want to use SetTimer, make sure you make a loop in the function than.
Reply
#7

Код:
public outofhospital(playerid)
Quote:

C:\samp02Xserver.win32\gamemodes\script.pwn(1813) : error 025: function heading differs from prototype

please help
Reply
#8

you had forward outofhospital();
make it outofhospital(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)