[help] save the skin and attachments also
#1

hi everyone! i am a newbie obviously. so i need help. I am using COD7 gamemode by Excel and Lux Admin system. Everthing is fine only i want is that when I (admin) change mine or someones skin the next time he spawns he will use the last skin that was changed by me. Is this possible?
Also i want another feature known as clothes/player objects like the attachments system. Is there any script that can use all objects as clothes and also save them too??! and use mouse to position them I will be thankful
Also if you want to try my server than ask me i will give you the ip
Reply
#2

Yes it's possible. Declare a variable to save player's skin, and save it when player disconnects.
Reply
#3

I don't know about it at all, why you not post at his thread?
Reply
#4

Quote:
Originally Posted by AzaMx
Посмотреть сообщение
I don't know about it at all, why you not post at his thread?
Don't turn the topic into off-topic.

OnTopic:

Step1: Declare a var to save player's skin:

pawn Код:
new
    pSkin[MAX_PLAYERS];
Step2: Hook SetPlayerSkin to know player's current skin:
pawn Код:
stock MyLib_SetPlayerSkin(playerid, skinid)
{
    // Call the old version, no need to check if it exists.
    SetPlayerSkin(playerid, skinid);
    pSkin[playerid] = skinid;
    return 1;
}

#if defined _ALS_SetPlayerSkin
    #undef SetPlayerSkin
#else
    #define _ALS_SetPlayerSkin
#endif

#define SetPlayerSkin MyLib_SetPlayerSkin
Step3: Save pSkin to database/file when player disconnects.

Step4: Load pSkin from database/file when player connects.

Step5: Set Player's skin when spawn.
pawn Код:
public OnPlayerSpawn(playerid) { SetPlayerSkin(playerid, pSkin[playerid]); }
Please answer if i helped.
Don't Add Reputation also. Thanks.
Reply
#5

Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Don't turn the topic into off-topic.

OnTopic:

Step1: Declare a var to save player's skin:

pawn Код:
new
    pSkin[MAX_PLAYERS];
Step2: Hook SetPlayerSkin to know player's current skin:
pawn Код:
stock MyLib_SetPlayerSkin(playerid, skinid)
{
    // Call the old version, no need to check if it exists.
    SetPlayerSkin(playerid, skinid);
    pSkin[playerid] = skinid;
    return 1;
}

#if defined _ALS_SetPlayerSkin
    #undef SetPlayerSkin
#else
    #define _ALS_SetPlayerSkin
#endif

#define SetPlayerSkin MyLib_SetPlayerSkin
Step3: Save pSkin to database/file when player disconnects.

Step4: Load pSkin from database/file when player connects.

Step5: Set Player's skin when spawn.
pawn Код:
public OnPlayerSpawn(playerid) { SetPlayerSkin(playerid, pSkin[playerid]); }
Please answer if i helped.
Don't Add Reputation also. Thanks.
Thanks god someone helped me *-*
but when i respawned it loaded the old skin again.
i think it can never be changed unless i implement some code in gamemode.
coz the game takes me to select the selected skin on each spawn
Thanks man. This could help me in any other time THANKS VERY MUCH
Reply
#6

Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Yes it's possible. Declare a variable to save player's skin, and save it when player disconnects.
i think a 10 year kid know this too Thanks :P i wanted the code dude . btw thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)