SetPlayerSkin bug? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerSkin bug? (
/showthread.php?tid=196312)
SetPlayerSkin bug? -
ReVo_ - 05.12.2010
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);
}
}
Re: SetPlayerSkin bug? -
dice7 - 05.12.2010
I've never heard of that bug. Try putting TogglePlayerControllable(playerid, 1) at the end of FixPlayer() to unfreeze them
Re: SetPlayerSkin bug? -
Mean - 05.12.2010
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