Help with timers
#1

I need help. I've tried to figure out by myself what the problem might be but I failed. The code will tell you what I have tried to do.

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetTimerEx("ObjLoad", 3000,false,"i",playerid);
       TogglePlayerControllable(playerid,0);
    GameTextForPlayer(playerid,"~w~Objects ~g~Loading",2000,0);
    print("Freezed"); // For debug.
    return 1;
}

public ObjLoad(playerid) // The forward is up somewhere.
{
    TogglePlayerControllable(playerid,1);
    GameTextForPlayer(playerid,"~w~Objects ~g~Loaded",2000,0);
    print("Unfrezzed"); // For debug
    return 1;
}
Now the problem is in the console I see >> Frezzed but I do not see Unfrezzed and ALSO It does not unfrezze the player.
Reply
#2

Set The:
pawn Код:
SetTimerEx("ObjLoad", 3000,false,"i",playerid);
to:
pawn Код:
SetTimerEx("ObjLoad", 3000, false, "d", playerid);
Reply
#3

Do you realize that d and i are same ?

Код:
Placeholder 	Meaning
%b 	Inserts a number at this position in binary radix
%c 	Inserts a single character.
%d 	Inserts an integer (whole) number
%f 	Inserts a floating point number.
%i 	Inserts an integer.
%s 	Inserts a string.
%x 	Inserts a number in hexadecimal notation.
%% 	Inserts the literal '%'
(wiki)
Reply
#4

BUMP
Reply
#5

This work to me:

pawn Код:
forward ObjLoad(playerid);

public OnPlayerSpawn(playerid)
{


    SetTimerEx("ObjLoad", 3000,false,"i",playerid);
       TogglePlayerControllable(playerid,false);
    GameTextForPlayer(playerid,"~w~Objects ~g~Loading",2000,0);
    SendClientMessage(playerid, 0xFFFFFFFF,"Objects Loading.");
    print("Freezed");
    return 1;
}

public ObjLoad(playerid)
{
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, 0xFFFFFFFF,"Objects Loaded.");
    print("Unfrezzed");
}
Reply
#6

You must have some other scripts corrupting this one, because it works fine for me.
Reply
#7

Yes. Thank you all! I will attemp to fix it tomorrow I am soooo sleppy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)