SA-MP Forums Archive
how to delay OnPlayerConnect? +rep! :) - 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: how to delay OnPlayerConnect? +rep! :) (/showthread.php?tid=322066)



how to delay OnPlayerConnect? +rep! :) - PawnoQ - 29.02.2012

hi,

how can i delay the callback OnPlayerConnect?
I tried it like setting a timer in that callback but after connect at once the class selection appears.
So how can i prevent that? How can i delay the class selsection?
Is it possible?

thx and ofc + rep for help

thx!


Re: how to delay OnPlayerConnect? +rep! :) - Mike_Peterson - 29.02.2012

I honestly do not think it could be done with scripting in a gamemode.. that easy
I'll see myself, ill post if i found sumthn


Re: how to delay OnPlayerConnect? +rep! :) - Psymetrix - 29.02.2012

To delay the class selection, put the player into spectate mode. This prevents the class selection screen from appearing.

This might work
pawn Код:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, true);
    SetTimerEx("OnPlayerConnectDelay", 3000, false, "i", playerid);
    return 1;
}

forward OnPlayerConnectDelay(playerid);
public OnPlayerConnectDelay(playerid)
{
    TogglePlayerSpectating(playerid, false);
    return 1;
}
but it may also skip the class selection. I can't remember.

If it does skip, just force them back to class selection.


Re: how to delay OnPlayerConnect? +rep! :) - PawnoQ - 29.02.2012

thx!
Always wanted to try out y_classes but untill now i thought i wouldnt really need it.
But thats AWESOME! I really just can disable the class selection using this function then: Class_DisableSelection(playerid); ?

Would also the Spawn button disappear then? (+the arrows to choose your skin you know...)

thx Psymetrix i will try it out now

//edit:

thx a LOT to Psymetrix. works perfect and is very simple

+rep all THX!