SA-MP Forums Archive
save player skin - 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: save player skin (/showthread.php?tid=582865)



save player skin - TenTen - 23.07.2015

Ex: OnPlayerSpawn(playerid);
SetPlayerSkin(playerid,//saved skin)


Re: save player skin - trablon - 23.07.2015

Are you using save system or what?

You have to give more details.


Re: save player skin - M4D - 23.07.2015

save skin id for players in a file or sql database
load it into a variable and set it.

a good MySQL register/login (Saving system) Tutorial: https://sampforum.blast.hk/showthread.php?tid=485633
and a file based account saving system tutorial: https://sampforum.blast.hk/showthread.php?tid=352703

i suggest you learn SQL for player account data saving

good luck


Re: save player skin - TenTen - 23.07.2015

Quote:
Originally Posted by trablon
Посмотреть сообщение
Are you using save system or what?

You have to give more details.
Код:
enum UserEnum
{
	//saved data
	u_admin,
	u_vip,
	u_kills,
	u_deaths,
	u_score,
	u_money,
	u_hours,
	u_minutes,
	u_seconds,CMD:savestats(playerid, params[])
{
	if(GetPVarType(playerid, "GAdmin_Loggedin") == PLAYER_VARTYPE_NONE) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You are not registered or logged in.");

    GetPlayerConnectedTime(playerid, gUser[playerid][u_hours], gUser[playerid][u_minutes], gUser[playerid][u_seconds]);

	new userid = BUD::GetNameUID(ReturnPlayerName(playerid));
	BUD::SetStringEntry(userid, "ip", ReturnPlayerIP(playerid));
	BUD::SetIntEntry(userid, "admin", gUser[playerid][u_admin]);
	BUD::SetIntEntry(userid, "vip", gUser[playerid][u_vip]);
	BUD::SetIntEntry(userid, "kills", gUser[playerid][u_kills]);
	BUD::SetIntEntry(userid, "deaths", gUser[playerid][u_deaths]);
	BUD::SetIntEntry(userid, "score", GetPlayerScore(playerid));
	BUD::SetIntEntry(userid, "money", GetPlayerMoney(playerid));
	BUD::SetIntEntry(userid, "hours", gUser[playerid][u_hours]);
	BUD::SetIntEntry(userid, "minutes", gUser[playerid][u_minutes]);
	BUD::SetIntEntry(userid, "seconds", gUser[playerid][u_seconds]);
	BUD::SetIntEntry(userid, "logged", 0);

	SendClientMessage(playerid, COLOR_GREEN, "ACCOUNT: Your stats have been saved. (Your stats automatically saves after disconnect though)");
	PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
	return 1;
}