Fuction doesn't work
#1

Hey! hello guys, i have a problem with my second fuction; the textdrawn never hide, and toggleplayercontrollable doesnґt switch. (fuction "TerminoCargarObjetos" never work.)

PHP код:
public CargarObjetos(playerid);
CargarObjetos(playerid)
{
    
TogglePlayerControllable(playerid0);
    
TextDrawShowForPlayer(playeridCARGAOBJ0);
    
TextDrawShowForPlayer(playeridCARGAOBJ1);
     
SetTimer("TerminoCargarObjetos"3500false);
    return 
1;
}
public 
TerminoCargarObjetos(playerid);
TerminoCargarObjetos(playerid)
{
    
TogglePlayerControllable(playerid1);
    
TextDrawHideForPlayer(playeridCARGAOBJ0);
    
TextDrawHideForPlayer(playeridCARGAOBJ1);
    return 
1;

what's my error?
Reply
#2

If it doesnt go to
public TerminoCargarObjetos(playerid);
Then there is something wrong with your settimer.

*Edit

Try and use SetTimerEx("TerminoCargarObjetos", 3500, false, "i", playerid);
Reply
#3

If you want to pass a value to a function (in this case the playerid) you have to use SetTimerEx

pawn Код:
SetTimerEx("TerminoCargarObjetos", 3500, false, "u", playerid);
Reply
#4

Nope, doesnґt work.
Reply
#5

Quote:
Originally Posted by CoR3
Посмотреть сообщение
Nope, doesnґt work.
You tried mine or his?
Reply
#6

pawn Код:
forward CargarObjetos(playerid);
public CargarObjetos(playerid)
{
    TogglePlayerControllable(playerid, 0);
    TextDrawShowForPlayer(playerid, CARGAOBJ0);
    TextDrawShowForPlayer(playerid, CARGAOBJ1);
     SetTimer("TerminoCargarObjetos", 3500, false);
    return 1;
}
forward TerminoCargarObjetos(playerid);
public TerminoCargarObjetos(playerid)
{
    TogglePlayerControllable(playerid, 1);
    TextDrawHideForPlayer(playerid, CARGAOBJ0);
    TextDrawHideForPlayer(playerid, CARGAOBJ1);
    return 1;
}

On a side note, what does CoR stand for? I used to have a community called 'Call of Rebellion', so I was interested in your name.
Reply
#7

Quote:
Originally Posted by Glenn332
Посмотреть сообщение
If it doesnt go to
public TerminoCargarObjetos(playerid);
Then there is something wrong with your settimer.

*Edit

Try and use SetTimerEx("TerminoCargarObjetos", 3500, false, "i", playerid);
Quote:
Originally Posted by Schneider
Посмотреть сообщение
If you want to pass a value to a function (in this case the playerid) you have to use SetTimerEx

pawn Код:
SetTimerEx("TerminoCargarObjetos", 3500, false, "u", playerid);
Quote:
Originally Posted by Crayder
Посмотреть сообщение
pawn Код:
forward CargarObjetos(playerid);
public CargarObjetos(playerid)
{
    TogglePlayerControllable(playerid, 0);
    TextDrawShowForPlayer(playerid, CARGAOBJ0);
    TextDrawShowForPlayer(playerid, CARGAOBJ1);
     SetTimer("TerminoCargarObjetos", 3500, false);
    return 1;
}
forward TerminoCargarObjetos(playerid);
public TerminoCargarObjetos(playerid)
{
    TogglePlayerControllable(playerid, 1);
    TextDrawHideForPlayer(playerid, CARGAOBJ0);
    TextDrawHideForPlayer(playerid, CARGAOBJ1);
    return 1;
}

On a side note, what does CoR stand for? I used to have a community called 'Call of Rebellion', so I was interested in your name.
No brother my name dont have relation with "Call of Rebellion"...

I found this include, it helped me; thanks for your helps
https://sampforum.blast.hk/showthread.php?tid=257826
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)