CreateCP
#1

hi guys i want save Skin From Skinlist (OnPlayerModelSelection)
Help me Please i Want is Saving

PHP код:
enum
    Skin
,
LoadPlayerAccount
    INI_Int
("Skin"PlayerInfo[playerid][Skin]);
OnPlayerConnect
    PlayerInfo
[playerid][Skin] = 0;
OnPlayerSpawn
    SetPlayerSkin
playeridPlayerInfo[playerid][Skin] );
OnPlayerModelSelection
    
if(listid == skinlist)
    {
        if(
response)
        {
           if(
PlayerInfo[playerid][Skin] == 1)
           {
           new 
skinid;
           
SetPlayerSkin(PlayerInfo[playerid][Skin], modelid);
           new 
INI:File INI_Open(UserPath(playerid));
           
INI_SetTag(File,"Player's Data");
           
INI_WriteInt(File"Skin",skinid);
           
INI_Close(File);
           
SendClientMessage(playerid0xFF0000FF" skin Changed");
           }
        }
        else 
SendClientMessage(playerid0xFF0000FF"Canceled skin selection");
        return 
1;
    }
OnPlayerDisconnect
        INI_WriteInt
(File"Skin"PlayerInfo[playerid][Skin]); 
Reply
#2

I did not quite understand what you want to do.
Reply
#3

PHP код:
SetPlayerSkin(PlayerInfo[playerid][Skin], modelid);
INI_WriteInt(File"Skin",skinid);
new 
skinid
These lines are wrong, it should be because:
Line 1) You are using the setskin syntax wrong, corrected: (playerid,modelid)
Line 2) You are saving an empty variable as player's skin, corrected: saving the modelid player chose
Line 3) You are creaitng an empty variable and also unnecessary one, corrected: changing player's skin in enum to the one he chose
PHP код:
SetPlayerSkin([playeridmodelid);
INI_WriteInt(File"Skin",modelid);
PlayerInfo[playerid][Skin]=modelid
and also this should be deleted, it doesn't make any sense and actually makes your system fail (unless you want the guy to save his skin only if he had skin ID 1 before.)
PHP код:
           if(PlayerInfo[playerid][Skin] == 1)
           { 
           } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)