ForcePlayerClassSelection - 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: ForcePlayerClassSelection (
/showthread.php?tid=428314)
ForcePlayerClassSelection -
faff - 05.04.2013
pawn Код:
public round()
{
new string[128];
RoundStarted = 0;
KillTimer(roundd);
roundd = SetTimer("round", 600000, false); // Set a timer of 1000 miliseconds (1 second)
SetTimer("startround", 30000, false); // Set a timer of 1000 miliseconds (1 second)
format( string, sizeof(string), "New round started. wait 30 Seconds untill respawn!");
GameTextForAll( string, 5000, 3 );
foreach(Player, i)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pTeam] == 0)
{
TogglePlayerSpectating(i, 0);
IsDead[i] = 0;
KillCount[i] = 0;
ForceClassSelection(i);
TogglePlayerSpectating(i, 0);
}
}
return 0;
}
So, Ehmm.
I've added this, It will happen when an admin will type /round..
Or.. when the current round is ended.
Or when the bomb will explode :P
Well..
When i type /round ingame.
It's says, ''Server Closed Connection''.
I dont know why, can anybody help me?
I diddnt even scripted any ''ban();'' in my gamemode, or filterscripts, so it's kinda weird.
Re: ForcePlayerClassSelection -
faff - 05.04.2013
After they force him to the Class Selection, This will happen.
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
new string[128];
SetPlayerPos(playerid, 786.2990,845.2061,176.7938);
SetPlayerCameraPos(playerid, 779.6148,845.5803,180.1051);
SetPlayerCameraLookAt(playerid, 786.2990,845.2061,176.7938);
if(RoundStarted == 1)
{
new ranplayer = GetPlayerRandomPlayer();
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerSpectating(playerid, 1);
PlayerInfo[playerid][pTeam] = 0;
PlayerSpectatePlayer(playerid, ranplayer);
IsDead[playerid] = 1;
}
else if(classid == 0)
{
format(string, sizeof(string), "~r~Terrorists");
GameTextForPlayer(playerid, string, 3000, 6);
SetPlayerSkin(playerid, 294);
PlayerInfo[playerid][pTeam] = 1;
SetPlayerColor(playerid, COLOR_RED);
return 0;
}
else if(classid == 1)
{
format(string, sizeof(string), "~b~Counter-Terrorists");
GameTextForPlayer(playerid, string, 3000, 6);
SetPlayerSkin(playerid, 285);
PlayerInfo[playerid][pTeam] = 2;
SetPlayerColor(playerid, COLOR_BLUE);
return 0;
}
return 1;
}
I'm not sure if i did something whrong.