What's wrong with skins? GetPlayerSkin(playerid) & SetPlayerSkin(playerid, skin)
#1

In my mod GetPlayerSkin(playerid) works wrongly. It gets me previous skin that i used, but not that i have.
I tried to do like sayed here: http://forum.sa-mp.com/index.php?topic=166501.0 but sill same thing
Here is code:
Code:
skin[playerid] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pModel] = skin[playerid];
SetPlayerSkin(playerid, skin[playerid]);
But it gives me not that skin that "it gets", as i said he gets and gives previosly used skin

_________________________________________________

In short GetPlayerSkin(playerid) returns not that skin that I have
Here is what I got when I /getskin :


command /getskin
pawn Code:
if(strcmp(cmd, "/getskin", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            format(string, sizeof(string), "* Your skin: %d", GetPlayerSkin(playerid));
            SendClientMessage(playerid, COLOR_GREY,string);
            return 1;
        }
        return 1;
    }

But if I'll give me skin with standart GF command /setstat ID 4(Model) SkinID /getskin returns correct skin
In both cases I use SetPlayerSkin(playerid, SkinID), but It works really normally in second case(/setstat)
Reply
#2

Soorry, can't get anything what your talking about? Please explain better.
Reply
#3

ohh, sorry. my english isn't best)
For example:
I have skin ID 174, I go to the shop and buying new skin, but after I buyed and payed it gives me still skin ID 174, not new.
I have RP mod. I think that this started in SA-MP 0.3 R7, which was updated from R3
Reply
#4

In short GetPlayerSkin(playerid) returns not that skin that I have
Here is what I got when I /getskin :


command /getskin
pawn Code:
if(strcmp(cmd, "/getskin", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            format(string, sizeof(string), "* Your skin: %d", GetPlayerSkin(playerid));
            SendClientMessage(playerid, COLOR_GREY,string);
            return 1;
        }
        return 1;
    }

But if I'll give me skin with standart GF command /setstat ID 4(Model) SkinID /getskin returns correct skin
In both cases I use SetPlayerSkin(playerid, SkinID), but It works really normally in second case(/setstat)
Reply
#5

Updated a little
Reply
#6

Hmm... Copy setstat's skin changing part and copy to buyclothes?
Reply
#7

/setstat
pawn Code:
SetPlayerSkin(giveplayerid, amount);
PlayerInfo[giveplayerid][pModel] = amount;
format(string, sizeof(string), "  The Player Was Set To Model %d", amount);
buy clothes:
pawn Code:
skin[playerid] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pModel] = skin[playerid];
TogglePlayerControllable(playerid, true);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, GetPlayerSkin(playerid));
SavePlayer(playerid);
And after buy clothes SetPlayerSkin it gives old skin

was like that:
pawn Code:
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
TogglePlayerControllable(playerid, true);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
SavePlayer(playerid);
same thing. in both cases gives old skin, and in PlayerInfo[playerid][pModel] & skin[playerid] it writes too old skin...

Also: I think that this started after server was updated from R3 to R7
Reply
#8

Bump. Was problem with mod.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)