My skin keep changing without reason - 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: My skin keep changing without reason (
/showthread.php?tid=114685)
My skin keep changing without reason -
addysnow1 - 20.12.2009
Hello,
I change this on a gamemode;
New:
Код:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCrashed])
{
SetPlayerPos(playerid,PlayerInfo[playerid][pCrashX],PlayerInfo[playerid][pCrashY],PlayerInfo[playerid][pCrashZ]);
SetPlayerInterior(playerid,PlayerInfo[playerid][pCrashInt]);
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pCrashW]);
PlayerInfo[playerid][pCrashed] = 0;
GameTextForPlayer(playerid, "~r~Crashed...~n~~g~Returning to previous position.", 7000, 6);
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerLocalMessage(playerid,15.0,"was set back to his previous position.");
}
else
{
PlayerLocalMessage(playerid,15.0,"was set back to her previous position.");
}
return 1;
}
if(AdminDuty[playerid])
{
SetPlayerColor(playerid,COLOR_ADMINDUTY);
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,99999);
}
if(PlayerInfo[playerid][pFaction] != 255)
{
SetPlayerToFactionColor(playerid);
//SetPlayerToFactionSkin(playerid);
}
if(PlayerInfo[playerid][pJailed] == 1)
{
SetPlayerVirtualWorld(playerid,2); //BUILDING ID 2, MAKE SURE PD IS ID 2
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You havn't finished your jail time!");
return 1;
}
if(PlayerInfo[playerid][pHouseSpawn] == 1)
{
if(PlayerInfo[playerid][pEnterHouse] == 1)
{
new Float:houseintx = PlayerInfo[playerid][pHouseIntX];
new Float:houseinty = PlayerInfo[playerid][pHouseIntY];
new Float:houseintz = PlayerInfo[playerid][pHouseIntZ];
new housevw = PlayerInfo[playerid][pHouseVW];
new houseint = PlayerInfo[playerid][pHouseInt];
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid,px,py,pz);
SetPlayerPos(playerid,houseintx,houseinty,houseintz);
SetPlayerVirtualWorld(playerid,housevw);
SetPlayerInterior(playerid,houseint);
}
return 1;
}
if(PlayerInfo[playerid][pFaction] != 255)
{
SetPlayerPos(playerid,DynamicFactions[PlayerInfo[playerid][pFaction]][fX],DynamicFactions[PlayerInfo[playerid][pFaction]][fY],DynamicFactions[PlayerInfo[playerid][pFaction]][fZ]);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}
else
{
//====================[Setting Civilian Position]==========================
SetPlayerPos(playerid,CivilianSpawn[X],CivilianSpawn[Y],CivilianSpawn[Z]);
SetPlayerVirtualWorld(playerid, CivilianSpawn[World]);
SetPlayerInterior(playerid, CivilianSpawn[Interior]);
SetPlayerFacingAngle(playerid,CivilianSpawn[Angle]);
//=========================================================================
return 1;
}
}
return 1;
}
old
Код:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCrashed])
{
SetPlayerPos(playerid,PlayerInfo[playerid][pCrashX],PlayerInfo[playerid][pCrashY],PlayerInfo[playerid][pCrashZ]);
SetPlayerInterior(playerid,PlayerInfo[playerid][pCrashInt]);
SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pCrashW]);
PlayerInfo[playerid][pCrashed] = 0;
GameTextForPlayer(playerid, "~r~Crashed...~n~~g~Returning to previous position.", 7000, 6);
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerLocalMessage(playerid,15.0,"was set back to his previous position.");
}
else
{
PlayerLocalMessage(playerid,15.0,"was set back to her previous position.");
}
return 1;
}
if(AdminDuty[playerid])
{
SetPlayerColor(playerid,COLOR_ADMINDUTY);
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,99999);
}
if(PlayerInfo[playerid][pFaction] != 255)
{
SetPlayerToFactionColor(playerid);
SetPlayerToFactionSkin(playerid);
}
if(PlayerInfo[playerid][pJailed] == 1)
{
SetPlayerVirtualWorld(playerid,2); //BUILDING ID 2, MAKE SURE PD IS ID 2
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You havn't finished your jail time!");
return 1;
}
new house = PlayerInfo[playerid][pHouseKey];
if(house != 255)
{
if(PlayerInfo[playerid][pSpawnPoint])
{
SetPlayerInterior(playerid,Houses[house][ExitInterior]);
SetPlayerPos(playerid, Houses[house][ExitX], Houses[house][ExitY],Houses[house][ExitZ]);
SetPlayerVirtualWorld(playerid,house);
return 1;
}
}
if(PlayerInfo[playerid][pFaction] != 255)
{
if(PlayerInfo[playerid][pSpawnPoint] == 0)
{
SetPlayerPos(playerid,DynamicFactions[PlayerInfo[playerid][pFaction]][fX],DynamicFactions[PlayerInfo[playerid][pFaction]][fY],DynamicFactions[PlayerInfo[playerid][pFaction]][fZ]);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}
}
else
{
//====================[Setting Civilian Position]==========================
SetPlayerPos(playerid,CivilianSpawn[X],CivilianSpawn[Y],CivilianSpawn[Z]);
SetPlayerVirtualWorld(playerid, CivilianSpawn[World]);
SetPlayerInterior(playerid, CivilianSpawn[Interior]);
SetPlayerFacingAngle(playerid,CivilianSpawn[Angle]);
//=========================================================================
return 1;
}
}
return 1;
}
My skin keep changing to skin 0 when I do /kill or when i die its fucking anoying because i cannot find the problem! I have been looking for 2 hours...
My onplayerrequestclass and onplayerrequestspawn is still the same as the orginal gm