skin/xyz saving and loading with y_ini [need help]
#3

Quote:
Originally Posted by biker122
Посмотреть сообщение
Inside your player enum (Put this in the middle, if you put this in the last, remove the "," at the last variable)
pawn Код:
Float:SX,
Float:SY,
Float:SZ,
Skin,
under OnPlayerDisconnect (Where you save player's stats while disconnecting)
pawn Код:
GetPlayerPos(playerid, pInfo[playerid][SX], pInfo[playerid][SY], pInfo[playerid][SZ]);
INI_WriteFloat(File, "XPos", pInfo[playerid][SX]);
INI_WriteFloat(File, "YPos", pInfo[playerid][SY]);
INI_WriteFloat(File, "ZPos", pInfo[playerid][SZ]);
INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
and on "LoadUser_data" function or whatever.
pawn Код:
INI_Float("XPos", pInfo[playerid][XPos]);
INI_Float("YPos", pInfo[playerid][YPos]);
INI_Float("ZPos", pInfo[playerid][ZPos]);
INI_Int("Skin", pInfo[playerid][Skin]);
Under OnPlayerSpawn
pawn Код:
SetPlayerPos(playerid, pInfo[playerid][XPos], pInfo[playerid][YPos], pInfo[playerid][ZPos]);
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
Thanks dude , i appreciate your help . +rep
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)