04.10.2014, 06:44
PHP код:
new PlayerInfo[playerid][pSkin]; //make new global var to store player skin
public OnPlayerRequestClass(playerid, classid)
{
if(IsLogged[playerid] == 1)
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
}
return 1;
}
//make a command to save a skin to account
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/saveskin", cmdtext, true, 10) == 0)
{
if(IsLogged[playerid]==1)
{
PlayerInfo[playerid][pSkin]=GetPlayerSkin(playerid);
SendClientMessage(playerid,-1,"Skin Saved");
}
else
{
SendClientMessage(playerid,-1,"You must be logged to save a skin");//print if the player isnt logged
}
return 1;
}
return 0;
}