[BUG]Not saving skins
#1

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
Reply
#2

Are you saving them in a file/database?
Reply
#3

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

Post code where you save it
Reply
#5

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..
Reply
#6

Then show us where you save and load them.
Reply
#7

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]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)