23.11.2013, 17:13
-REMOVED-
DisableInteriorEnterExits();
First of all you need a User System where you can save the Skin ID in.
On InGameModeInit if I'm right place AddClass( etc etc. ) OnPlayerRequestClass make a system to save it in the User System And when the player joins and is logged in that he loads the Skin ID etc. I'm not gonna create a whole script for you, mate. with this you can learn not with asking scripts. |
Well i'm not good scripter and i can't make register system i tried from videos and Tutorials but everytime there is a problem...
|
Well i'm not good scripter and i can't make register system i tried from videos and Tutorials but everytime there is a problem... I don't want register system just to save it like a House System but with skins ?
|
#include <YSI\y_ini>
#define UserPath "%s.ini"
enum PlayerInfo
{
Skin,
}
new pInfo[MAX_PLAYERS][PlayerInfo];
stock Path(playerid)
{
new str[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), UserPath, name);
return str;
}
forward loadskin_user(playerid, name[], value[]);
public loadskin_user(playerid, name[], value[])
{
INI_Int("Skin", pInfo[playerid][Skin]);
return 1;
}
public OnPlayerConnect(playerid)
{
if(pInfo[playerid][Skin] != -1)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file, "Player's Skin");
INI_WriteInt(file, "Skin", pInfo[playerid][Skin]);
INI_Close(file);
return 1;
}
CMD:saveskin(playerid, params[])
{
new skin = GetPlayerSkin(playerid);
pInfo[playerid][Skin] = skin;
SendClientMessage(playerid, -1, "Your skin has been saved !");
return 1;
}