Skin doesn't load with Frame Limiter On
#1

Hello,

when I want to join my server with the frame limiter off everything works fine but if I turn it on the skin saved in my account file doesn't load but everything else does.
I also tried it on another server and it works there, so my skin loads there with the frame limiter on.
How can I fix it? (I am using a Vortex RP edit). I am also using MySQL for the account system.

Here my code OnPlayerSpawn(indents aren't shown correctly here but it is right in my script):
Код:
public OnPlayerSpawn(playerid) {
	#if defined DEBUG
	    printf("[debug] OnPlayerSpawn(%d)", playerid);
	#endif
	
	PreloadAnimLib(playerid,"BOMBER");
	PreloadAnimLib(playerid,"RAPPING");
	PreloadAnimLib(playerid,"SHOP");
	PreloadAnimLib(playerid,"BEACH");
	PreloadAnimLib(playerid,"SMOKING");
	PreloadAnimLib(playerid,"ON_LOOKERS");
	PreloadAnimLib(playerid,"DEALER");
	PreloadAnimLib(playerid,"CRACK");
	PreloadAnimLib(playerid,"CARRY");
	PreloadAnimLib(playerid,"COP_AMBIENT");
	PreloadAnimLib(playerid,"PARK");
	PreloadAnimLib(playerid,"INT_HOUSE");
	PreloadAnimLib(playerid,"FOOD");
	PreloadAnimLib(playerid,"GANGS");
	PreloadAnimLib(playerid,"PED");
	PreloadAnimLib(playerid,"FAT");

	SetPlayerColor(playerid, COLOR_WHITE);
	SetPlayerFightingStyle(playerid, playerVariables[playerid][pFightStyle]);

    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 998); // Skilled, but not dual-wield.

	if(playerVariables[playerid][pPrisonTime] >= 1) {
	    switch(playerVariables[playerid][pPrisonID]) {
			case 1: {
			    SetPlayerPos(playerid, -26.8721, 2320.9290, 24.3034);
				SetPlayerInterior(playerid, 0);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 2: {
				SetPlayerPos(playerid, 264.58, 77.38, 1001.04);
				SetPlayerInterior(playerid, 6);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 3: {

				SetPlayerInterior(playerid, 10);
				SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+1);

				new spawn = random(sizeof(JailSpawns));

				SetPlayerPos(playerid, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
				SetPlayerFacingAngle(playerid, 0);
			}
		}
		return 1;
	}

	if(playerVariables[playerid][pTutorial] == 1) {
		SetPlayerInterior(playerid, 14);
		SetPlayerPos(playerid, 216.9770, -155.4791, 1000.5234);
		SetPlayerFacingAngle(playerid, 267.9681);
		TogglePlayerControllable(playerid, false);
		return 1;
	}

	if(playerVariables[playerid][pHospitalized] >= 1)
	    return initiateHospital(playerid);

	SetPlayerSkin(playerid, playerVariables[playerid][pSkin]);
	SetPlayerPos(playerid, playerVariables[playerid][pPos][0], playerVariables[playerid][pPos][1], playerVariables[playerid][pPos][2]);
	SetPlayerInterior(playerid, playerVariables[playerid][pInterior]);
	SetPlayerVirtualWorld(playerid, playerVariables[playerid][pVirtualWorld]);
	SetCameraBehindPlayer(playerid);
	
	
	playerVariables[playerid][pSkinSet] = 1;

	ResetPlayerWeapons(playerid);
	givePlayerWeapons(playerid);

	if(playerVariables[playerid][pEvent] >= 1)
		playerVariables[playerid][pEvent] = 0;

	if(playerVariables[playerid][pAdminDuty] == 1) {
		SetPlayerHealth(playerid, 500000.0);
	}
	else {
		SetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
		SetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
	}

	if(!GetPlayerInterior(playerid)) {
		SetPlayerWeather(playerid, weatherVariables[0]);
	}
	else {
		SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
	}

	syncPlayerTime(playerid);
	TogglePlayerControllable(playerid, true);

	return 1;
}
Any help would be appreciated.
Reply
#2

Now I had someone else getting on the server and he had the frame limiter on and the skin was loading fine for him so I have no clue what the hell is going on.

Now I he relogged and got the same problem as me when logging back on for the second time.
Reply
#3

By the way, I have my FPS limit set to 20, I figuered out now that it doesn't work properly for me but for many others but not always, but I would like it to work for anyone and everytime properly.

Anyone has any ideas?
Reply
#4

I doubt it's your frame limiter, you have a few returns in there which you're probably triggering before SetPlayerSkin
Reply
#5

But the thing is it works fine for me when I have my frame limiter in my game options turned off and it works for some other people fine as well, so this seems to be weird
Reply
#6

Any more ideas?
Reply
#7

prove me wrong that it the script doesn't stop before SetPlayerSkin
Reply
#8

Код:
public OnPlayerSpawn(playerid) {
	#if defined DEBUG
	    printf("[debug] OnPlayerSpawn(%d)", playerid);
	#endif
	
	PreloadAnimLib(playerid,"BOMBER");
	PreloadAnimLib(playerid,"RAPPING");
	PreloadAnimLib(playerid,"SHOP");
	PreloadAnimLib(playerid,"BEACH");
	PreloadAnimLib(playerid,"SMOKING");
	PreloadAnimLib(playerid,"ON_LOOKERS");
	PreloadAnimLib(playerid,"DEALER");
	PreloadAnimLib(playerid,"CRACK");
	PreloadAnimLib(playerid,"CARRY");
	PreloadAnimLib(playerid,"COP_AMBIENT");
	PreloadAnimLib(playerid,"PARK");
	PreloadAnimLib(playerid,"INT_HOUSE");
	PreloadAnimLib(playerid,"FOOD");
	PreloadAnimLib(playerid,"GANGS");
	PreloadAnimLib(playerid,"PED");
	PreloadAnimLib(playerid,"FAT");

	SetPlayerColor(playerid, COLOR_WHITE);
	SetPlayerFightingStyle(playerid, playerVariables[playerid][pFightStyle]);

        SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998);
        SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 998); // Skilled, but not dual-wield.

	if(playerVariables[playerid][pPrisonTime] >= 1) {
	    switch(playerVariables[playerid][pPrisonID]) {
			case 1: {
			    SetPlayerPos(playerid, -26.8721, 2320.9290, 24.3034);
			    SetPlayerInterior(playerid, 0);
			    SetPlayerVirtualWorld(playerid, 0);
			}
			case 2: {
				SetPlayerPos(playerid, 264.58, 77.38, 1001.04);
				SetPlayerInterior(playerid, 6);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 3: {

				SetPlayerInterior(playerid, 10);
				SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+1);

				new spawn = random(sizeof(JailSpawns));

				SetPlayerPos(playerid, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
				SetPlayerFacingAngle(playerid, 0);
			}
		}
		return 1;
	}

	if(playerVariables[playerid][pTutorial] == 1) {
		SetPlayerInterior(playerid, 14);
		SetPlayerPos(playerid, 216.9770, -155.4791, 1000.5234);
		SetPlayerFacingAngle(playerid, 267.9681);
		TogglePlayerControllable(playerid, false);
		return 1;
	}

	if(playerVariables[playerid][pHospitalized] >= 1)
	    return initiateHospital(playerid);

	SetPlayerSkin(playerid, playerVariables[playerid][pSkin]);
	SetPlayerPos(playerid, playerVariables[playerid][pPos][0], playerVariables[playerid][pPos][1], playerVariables[playerid][pPos][2]);
	SetPlayerInterior(playerid, playerVariables[playerid][pInterior]);
	SetPlayerVirtualWorld(playerid, playerVariables[playerid][pVirtualWorld]);
	SetCameraBehindPlayer(playerid);
	
	
	playerVariables[playerid][pSkinSet] = 1;

	ResetPlayerWeapons(playerid);
	givePlayerWeapons(playerid);

	if(playerVariables[playerid][pEvent] >= 1)
		playerVariables[playerid][pEvent] = 0;

	if(playerVariables[playerid][pAdminDuty] == 1) {
		SetPlayerHealth(playerid, 500000.0);
	}
	else {
		SetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
		SetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
	}

	if(!GetPlayerInterior(playerid)) {
		SetPlayerWeather(playerid, weatherVariables[0]);
	}
	else {
		SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
	}

	syncPlayerTime(playerid);
	TogglePlayerControllable(playerid, true);

	return 1;
}
As you can see there are returns if the player is either prisoned, in the tutorial or was dead or in hospital when logged out. Those returns there are fine. The script is supposed to stop loading the following things there at this point.
Reply
#9

Any other ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)