24.05.2012, 18:14
Well, the skin variable is loaded correctly, and saved correctly as well. But for some weird reason it won't change from CJ one to the one in the variable.
OnPlayerSpawn
The part of the login script that calls the OnPlayerSpawn
Anyways, the skin doesn't change, it stays on ID 0 (cj skin) all the time.
Skin is loaded correctly, part from the log:
OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
if(gPlayerLogged[playerid] == 1)
{
//==================================[FUEL TEXDRAW]==================================
FuelText[playerid] = TextDrawCreate(509, 99,"Fuel: 100");
TextDrawLetterSize(Text:FuelText[playerid], 0.370000, 1.500000);
TextDrawColor(Text:FuelText[playerid], -1361844506);
TextDrawSetOutline(Text:FuelText[playerid], 1);
TextDrawSetProportional(Text:FuelText[playerid], 1);
//==================================[RESETTING PLAYER VARIABLES]==================================
SetPlayerWeapons(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SendClientMessage(playerid, COLOR_WHITE, "Skin changed"); // This doesn't show up as well!
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
print("Skin SET");
//gPlayerLogged[playerid] = 0;
print("Variable set to FALSE");
SetPlayerSpawn(playerid);
}
return 1;
}
pawn Код:
SetSpawnInfo(playerid, 0, 0,2334.9993,240.1232,26.4758,180,0,0,0,0,0,0);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SpawnPlayer(playerid);
new string[100];
format(string, sizeof(string), "Skin is: %d", PlayerInfo[playerid][pSkin]);
print(string);
gPlayerLogged[playerid] = 1;
print("Variable set to TRUE.");
OnPlayerSpawn(playerid);
Skin is loaded correctly, part from the log:
Код:
[20:19:32] Number of vehicle models: 7 [20:19:51] Incoming connection: 127.0.0.1:53644 [20:19:51] [join] xxxx_yyyy has joined the server (0:127.0.0.1) [20:19:53] Skin is: 264 [20:19:53] Variable set to TRUE. [20:19:53] Skin SET [20:19:53] Variable set to FALSE