SetPlayerSkin bug?
#1

Hi all,
i've got a problem with SetPlayerSkin
I Change player skin with command (/teammix)
pawn Код:
dcmd_teammix(playerid,params[])
{
    #pragma unused params
    if(RoundActive) return SendClientMessage(playerid, COLOR_RED, "Round startato.");
    if(!IsPlayerAdminCommand(playerid,"teammix")) return SendClientMessage(playerid, COLOR_RED, ADMIN_REQUEST);
    foreach(Player,i)
    {
        new rand = random(MAX_TEAMS);
        while(rand==0||rand==3) rand = random(MAX_TEAMS);
        gTeam[i] = rand;
        FixPlayer(i);
    }
    SendClientMessageToAll(0x009EB6AA,"[Team Mix] Team mixati.");
    return 1;
}
After 5/6 mix player has been blocked (can't move ecc) it's bug of SetPlayerSkin ?

FixPlayer:
pawn Код:
FixPlayer(playerid)
{
    SendClientMessage(playerid,COLOR_RED,"FixPlayer(%d)",playerid);
    if(gTeam[playerid] == TEAM_CASA)
    {
        SendClientMessage(playerid,COLOR_RED,"Casa");
        SetPlayerSkin(playerid, Skins[TEAM_CASA]);
        SetPlayerColor(playerid, TeamColor[TEAM_CASA]);
    }
    else if(gTeam[playerid] == TEAM_SFIDANTE)
    {
        SendClientMessage(playerid,COLOR_RED,"sfidante");
        SetPlayerSkin(playerid, Skins[TEAM_SFIDANTE]);
        SetPlayerColor(playerid, TeamColor[TEAM_SFIDANTE]);
    }
    else if(gTeam[playerid] == TEAM_REF)
    {
        SendClientMessage(playerid,COLOR_RED,"ref");
        SetPlayerSkin(playerid, Skins[TEAM_REF]);
        SetPlayerColor(playerid, COLOR_GREY);
    }

}
Reply
#2

I've never heard of that bug. Try putting TogglePlayerControllable(playerid, 1) at the end of FixPlayer() to unfreeze them
Reply
#3

It happens when you (example) shoot, and then set your skin, you will get frozen, try adding

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+5); //Will slap the player, so he gets unbugged
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)