SA-MP Forums Archive
[BUG]Not saving skins - 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: [BUG]Not saving skins (/showthread.php?tid=536610)



[BUG]Not saving skins - Connor Smith - 10.09.2014

Server dont save skins..When I left from server my skin is not saved, any help?I tried..many solutions and nothing give me ur opinion now


Re: [BUG]Not saving skins - Stinged - 10.09.2014

Are you saving them in a file/database?


Re: [BUG]Not saving skins - M0HAMMAD - 10.09.2014

Use This :
pawn Код:
new Skin[MAX_PLAYERS];
// In Skin Shop
Skin[playerid] =modelid;
//OnPlayerSpawn
SetPlayerSkin(playerid,Skin[playerid]);
+rep :P


Re: [BUG]Not saving skins - Don_Cage - 10.09.2014

Post code where you save it


Re : [BUG]Not saving skins - Connor Smith - 11.09.2014

I save them at file..server is not mysql

EDIT:

Код:
	if(strcmp(cmd, "/setskin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "{FFFF00}USAGE:{FFFFFF}/setskin [ID/Name of Player] [Skin-ID].");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(level > 299 || level < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "{840042}ERROR:{FFFFFF}Dont go below 1 or 299.");
				return 1;
			}
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pChar] = level;
						format(string, sizeof(string), "{FFFF00}INFO:{FFFFFF}Administrator %s changed ur skin.", sendername);
						SendClientMessage(para1, WHITE, string);
						format(string, sizeof(string), "{FFFF00}INFO:{FFFFFF}U changed skin on player %s.", giveplayer);
						SendClientMessage(playerid, WHITE, string);
					    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, WHITE, "{840042}ERROR:{FFFFFF}You dont have permission to use this command.");
			}
		}
		return 1;
	}
Maybe problem because its not saving its there..because when I set skin with command /setskin it doesnt save skins..



Re: [BUG]Not saving skins - Stinged - 11.09.2014

Then show us where you save and load them.


Re : [BUG]Not saving skins - Connor Smith - 11.09.2014

OnPlayerConnect I have this:

Код:
PlayerInfo[playerid][pChar] = 0;
OnPlayerRegister I have this:

Код:
format(var, 32, "Char=%d\n",PlayerInfo[playerid][pChar]);fwrite(hFile, var);
OnPlayerUpdate I have this:

Код:
format(var, 32, "Char=%d\n",PlayerInfo[playerid][pChar]);fwrite(hFile, var);
OnPlayerLogins I have this:

Код:
if( strcmp( key , "Char" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pChar] = strval( val ); }

and this too:

SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);