Screen Freezing OnPlayerRequestClass
#1

Hey, I am facing a problem happens sometime to every player (not at same times) that there PC freezes, happens only while selecting class. They can't do anything can't select class, can't be spawned, can't type a comand. Players can only use cursor but then again they can only move it. Players can see the server timers moving fine chatbox keeps on moving. For that they have to logoff the PC/restart it.

The server is missions type, so this means it restarts after every mission to change mode. Happens randomly on almost all missions no set pattern or anything that we can note.

I am using crashdetect with -d3 flag.

http://i.imgur.com/oIlPQZu.png
Here's a screenshot of how this looks.

OnPlayerRequestClass for that script
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid,533.9351,-1338.4342,34.9412);
	SetPlayerFacingAngle(playerid,283.0057);
	SetPlayerCameraPos(playerid,537.182617 , -1338.024536 , 36.544498);
	SetPlayerCameraLookAt(playerid,533.9351,-1338.4342,34.9412);
	
	CallRemoteFunction("textdraw_ShowClassSelection","ddsddd",playerid, randA,"Racer", PedInfo[classid][Weapon1], PedInfo[classid][Weapon2], PedInfo[classid][Weapon3]);
	SetPlayerColor(playerid,COLOR_SERVER);
	pInfo[playerid][rClassID]=classid;
        return 1;
}

//textdraw_ShowClassSelection
FUNCTION textdraw_ShowClassSelection(playerid, teamid,team_name[], w1, w2, w3)
{
	PlayerTextDrawHide(playerid,PlayerClassSelection[0]);
	if(w1 != 0 || w2 != 0 || w3 != 0)
	{
		new string[125];
		new weapons[3][35];

		if(!w1) weapons[0] = "---"; else GetWeaponName(w1, weapons[0], 30);
		if(!w2) weapons[1] = "---"; else GetWeaponName(w2, weapons[1], 30);
		if(!w3) weapons[2] = "---"; else GetWeaponName(w3, weapons[2], 30);

		format(string, sizeof(string), "%s~n~%s~n~%s", weapons[0], weapons[1], weapons[2]);
		PlayerTextDrawSetString(playerid,PlayerClassSelection[1], string);
		TextDrawShowForPlayer(playerid,ClassSelection);
		PlayerTextDrawShow(playerid,PlayerClassSelection[1]);
	}	
	switch(teamid)
	{
		case 0: PlayerTextDrawColor(playerid, PlayerClassSelection[0], COLOR_TEAM_DEFEND);
		case 1: PlayerTextDrawColor(playerid, PlayerClassSelection[0], COLOR_TEAM_ATTACK);
		case 2: PlayerTextDrawColor(playerid, PlayerClassSelection[0], COLOR_SERVER);
	}	
	PlayerTextDrawSetString(playerid,PlayerClassSelection[0],team_name);
	PlayerTextDrawShow(playerid,PlayerClassSelection[0]);
	return 1;
}

//FUNCTION
#define FUNCTION%1(%2) 					forward public %1(%2); 	public %1(%2)
Reply
#2

Just noticed a new thing, that also happens sometimes as the player spawns. Like if we press the spawn key we get spawned normally, but get freeze like I explained up.
Reply
#3

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid,533.9351,-1338.4342,34.9412);
    
SetPlayerFacingAngle(playerid,283.0057);
    
SetPlayerCameraPos(playerid,537.182617 , -1338.024536 36.544498);
    
SetPlayerCameraLookAt(playerid,533.9351,-1338.4342,34.9412);
    
    
textdraw_ShowClassSelection(playeridrandA,"Racer"PedInfo[classid][Weapon1], PedInfo[classid][Weapon2], PedInfo[classid][Weapon3]);
        
SetPlayerColor(playerid,COLOR_SERVER);
    
pInfo[playerid][rClassID]=classid;
        return 
1;
}
//textdraw_ShowClassSelection
function textdraw_ShowClassSelection(playeridteamid,team_name[], w1w2w3)
{
    
PlayerTextDrawHide(playerid,PlayerClassSelection[0]);
    if(
w1 != || w2 != || w3 != 0)
    {
        new 
string[125];
        new 
weapons[3][35];
        if(!
w1weapons[0] = "---"; else GetWeaponName(w1weapons[0], 30);
        if(!
w2weapons[1] = "---"; else GetWeaponName(w2weapons[1], 30);
        if(!
w3weapons[2] = "---"; else GetWeaponName(w3weapons[2], 30);
        
format(stringsizeof(string), "%s~n~%s~n~%s"weapons[0], weapons[1], weapons[2]);
        
PlayerTextDrawSetString(playerid,PlayerClassSelection[1], string);
        
TextDrawShowForPlayer(playerid,ClassSelection);
        
PlayerTextDrawShow(playerid,PlayerClassSelection[1]);
    }    
    switch(
teamid)
    {
        case 
0PlayerTextDrawColor(playeridPlayerClassSelection[0], COLOR_TEAM_DEFEND);
        case 
1PlayerTextDrawColor(playeridPlayerClassSelection[0], COLOR_TEAM_ATTACK);
        case 
2PlayerTextDrawColor(playeridPlayerClassSelection[0], COLOR_SERVER);
    }    
    
PlayerTextDrawSetString(playerid,PlayerClassSelection[0],team_name);
    
PlayerTextDrawShow(playerid,PlayerClassSelection[0]);
    return 
1;

Reply
#4

Could you explain me what you changed?

I need that remote function because it's in another script.
Reply
#5

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
Could you explain me what you changed?

I need that remote function because it's in another script.
removed CallRemoteFunction ?

and i replaced it with origine expression also FUNCTION -> function
Reply
#6

I am using CallRemoteFunction as the OnPlayerRequestClass is from another file while textdraw.... one is another one.

FUNCTION -> function why?

FUNCTION is the one i defined sscanf uses 'function' define already I think.
Reply
#7

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
I am using CallRemoteFunction as the OnPlayerRequestClass is from another file while textdraw.... one is another one.

FUNCTION -> function why?

FUNCTION is the one i defined sscanf uses 'function' define already I think.
i hate caps :3

btw FUNCTION or fucntion doesn't matter just use the one u have

about CallRemoteFunction better merge the function on FS or files to gamemode
Reply
#8

I can't do that lot of things in script so I did in separate files because of that it's a missions server Mini Missions.
Reply
#9

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
I can't do that lot of things in script so I did in separate files because of that it's a missions server Mini Missions.
i have a gamemode with 47 files and i merge every time

just try to start after 5 mins u find uself finished
Reply
#10

won't work here reasons server restart every mission almost every 5.2 mins
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)