Player Must wait to chose skins
#1

Hi SA-MP.

How to make so when the player connect he can't choose skins for 10 seconds. When player will connect to the server he will see the first skin but he cant scroll all the skins, he will see only 1 skin, then after 10 sec he can scroll skins.

Tnx for help.
Reply
#2

pawn Код:
forward ConnectionTimer(playerid);
public ConnectionTimer(playerid)
{
     TogglePlayerControllable(playerid, 0);
}

public OnPlayerConnect(playerid)
{
     SetTimerEx("ConnectionTimer", 10000, false, "i", playerid);
     TogglePlayerControllable(playerid, 1);
     return 1;
}
I have no idea if it will work, but its worth a try.
Reply
#3

After that timer is set, the next line is exectued, so that code wouldn't work.

Correction:
pawn Код:
forward ConnectionTimer(playerid);
public ConnectionTimer(playerid)
{
     TogglePlayerControllable(playerid, 1);
}

public OnPlayerConnect(playerid)
{
     TogglePlayerControllable(playerid, 0);
     SetTimerEx("ConnectionTimer", 10000, false, "i", playerid);
     return 1;
}
<This forum requires that you wait 120 seconds between posts. Please try again in 31 seconds.> Argh..
Reply
#4

pawn Код:
new bool:CanConnect[MAX_PLAYERS];

public OnPlayerRequestClass(playerid,classid)
{
if(!CanConnect[playerid]) return 0;
return 1;
}

public OnPlayerConnect(playerid)
{
   CanConnect[playerid]=false;
   SetTimerEx("CanConnec",10*1000,false,"i",playerid);
}

forward CanConnec(playerid);
public CanConnec(playerid) return CanConnect[playerid]=true;
This would be correct
Reply
#5

It works. It sets my screen to other but after 10 sec the player request class not appear.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)