Skin reset after death
#1

When i login to the server the skin is set normally but when player dead and spawn again his skin changes to CJ must i use SetPlayerSkin every time the player spawns !!
Reply
#2

Show me Your OnPlayerSpawn and OnPlayerConnect
Reply
#3

pawn Код:
public OnPlayerConnect(playerid)
{  
    pInfo[playerid][prSTEP] = 0; pInfo[playerid][pSEX] = 0; FirstTimerSpawn[playerid] = 0; pInfo[playerid][pSQ] = 0;
    pInfo[playerid][pSA] = 0; pInfo[playerid][pIP] = 0; pInfo[playerid][pRDATE] = 0; pInfo[playerid][pADMINLVL] = 0;
    pInfo[playerid][pVIPLVL] = 0; pInfo[playerid][pPLAYERRANK] = 0; pInfo[playerid][pWANTEDLVL] = 0; pInfo[playerid][pSCORE] = 0;
    pInfo[playerid][pMONEY] = 0; pInfo[playerid][pKILLS] = 0; pInfo[playerid][pDEATHS] = 0; pInfo[playerid][pX] = 0;
    pInfo[playerid][pY] = 0; pInfo[playerid][pZ] = 0; pInfo[playerid][pINTERIOR] = 0; pInfo[playerid][pWORLD] = 0;
    pInfo[playerid][pHEALTH] = 0; pInfo[playerid][pARMOR] = 0; pInfo[playerid][pSKIN] = 0; pInfo[playerid][pWEAP1] = 0;
    pInfo[playerid][pWEAP1A] = 0; pInfo[playerid][pWEAP2] = 0; pInfo[playerid][pWEAP2A] = 0; pInfo[playerid][pWEAP3] = 0;
    pInfo[playerid][pWEAP3A] = 0; pInfo[playerid][pWEAP4] = 0; pInfo[playerid][pWEAP4A] = 0; pInfo[playerid][pWEAP5] = 0;
    pInfo[playerid][pWEAP5A] = 0; pInfo[playerid][pWEAP6] = 0; pInfo[playerid][pWEAP6A] = 0; pInfo[playerid][pWEAP7] = 0;
    pInfo[playerid][pWEAP7A] = 0; pInfo[playerid][pWEAP8] = 0; pInfo[playerid][pWEAP8A] = 0; pInfo[playerid][pWEAP9] = 0;
    pInfo[playerid][pWEAP9A] = 0; pInfo[playerid][pWEAP10] = 0; pInfo[playerid][pWEAP10A] = 0; pInfo[playerid][pWEAP11] = 0;
    pInfo[playerid][pWEAP11A] = 0; pInfo[playerid][pWEAP12] = 0; pInfo[playerid][pWEAP12A] = 0; pInfo[playerid][pVEHI1] = 0;
    pInfo[playerid][pVEHI2] = 0; pInfo[playerid][pVEHI3] = 0; pInfo[playerid][pVEHI4] = 0; pInfo[playerid][pVEHI5] = 0;
    pInfo[playerid][pJAILED] = 0; pInfo[playerid][pJAILTIME] = 0; pInfo[playerid][pWARNINGS] = 0; pInfo[playerid][pMUTED] = 0;
    pInfo[playerid][pMUTED] = 0; pInfo[playerid][pCOLOR] = 0; pInfo[playerid][pORIGIN] = 0; DeadPlayer[playerid] = 0;
    HasLoggedIn[playerid] = 0;
   
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][prSTEP] == 3)
    {
        setPlayerStats(playerid);//Gives the player required money and set the score, skin , etc...
        pInfo[playerid][prSTEP] = 4;//DONE REGISTERING
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerPos(playerid, 1612.3240,-2330.1670,13.5469);//Will Be Random
    }
    else if(pInfo[playerid][prSTEP] == 4)
    {
        if(HasLoggedIn[playerid] == 1)//If it is a first time spawn
        {
            setPlayerStats(playerid);
            HasLoggedIn[playerid] = 0;//First Time Spawn OFF
            SetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);//Normally Spawn The Player
        }
        else
        {
            SetPlayerPos(playerid, pInfo[playerid][pX], pInfo[playerid][pY], pInfo[playerid][pZ]);//Normally Spawn The Player
        }
    }
    return 1;
}
Reply
#4

Show the OnPlayerDeath too
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}
Still Empty One
Reply
#6

There might be this script code under OnPlayerDeath
pawn Код:
public OnPlayerDeath.....
{
    SetPlayerSkin(playerid,0);//0 id sets to CJ skin.
    //There might be a skin function used below OnPlayerDeath which sets player skin to Cj.
Edit:Oh i didnt see the scripts you posted above before posting this.
Reply
#7

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
There might be this script code under OnPlayerDeath
[pawn]
public OnPlayerDeath.....
{
SetPlayerSkin(playerid,0);//0 id sets to CJ skin.
//There might be a skin function used below OnPlayerDeath which sets player skin to Cj.
Look Above i posted my on player death it is EMPTY
Reply
#8

ANYHELP ?
Reply
#9

Try this?
pawn Код:
//onplayerdeath
GetPlayerSkin(....);
//onplayerspawn
SetPlayerSkin(playerid,GetPlayerSkin(playerid));
Not sure about that, but it works on my server.
Reply
#10

must i set the skin every time player spawns ? if that the problem i know how to fix it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)