how to delay OnPlayerConnect? +rep! :)
#1

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!
Reply
#2

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
Reply
#3

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.
Reply
#4

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)