SA-MP Forums Archive
Loading ... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loading ... (/showthread.php?tid=311538)



Loading ... - vassilis - 17.01.2012

Hey guys emm what is wrong because i can't find a way to solve this....

pawn Код:
public Loading(playerid)
{
TogglePlayerControllable(playerid,0);
 GameTextForPlayer(playerid, "~b~Loading ~g~Map ~w~Please Wait..",3000,5);
SetTimer("LoadingFinshed",2000,0);
return 1;
}

public LoadingFinished(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}
i am using loading system..to freeze players for 2 seconds so the map will load..i used this onPlayerSpawn callback.
however it is not unfreezing the player after 2 seconds the play remains frozen..what i should do

P.S:i have made that with SetTimerEx...


Re: Loading ... - thimo - 17.01.2012

Use this under onplayerspawn?
pawn Код:
TogglePlayerControllable(playerid,0);
 GameTextForPlayer(playerid, "~b~Loading ~g~Map ~w~Please Wait..",3000,5);
SetTimer("LoadingFinshed",2000,0)



Re: Loading ... - vassilis - 17.01.2012

doesnt work..pff i can't understand this..to my old gamemode it was working..prbbly problem with 0.3d.?


Re: Loading ... - thimo - 17.01.2012

Try using this:
pawn Код:
stock LoadPlayer(playerid)
{
    SetTimerEx("Loading", 3000, false, "i", playerid);
    GameTextForPlayer(playerid, "Loading environment Please wait", 3000, 5);
    TogglePlayerControllable(playerid, 0);
    return 1;
}
forward Loading(playerid);
public Loading(playerid)
{
    TogglePlayerControllable(playerid, 1);
    GameTextForPlayer(playerid, "Loaded", 3000, 5);
    return 1;
}

//Put this under OnPlayerSpawn
LoadPlayer(playerid);



Re: Loading ... - vassilis - 17.01.2012

working +rep thanks man i couldnt understand however..on my old gamemode i was using public ...and it was working as well..thanks .


Re: Loading ... - thimo - 17.01.2012

No problem! Dont hestitate to ask help from me!


Re: Loading ... - park4bmx - 17.01.2012

It didt work becouse you used SetTimer and it didn't pass the "playerid" variable
And that's why the end func didn work