Hey Leute, ich hab ein sehr nerviges Problem. Wenn ich jemanden als Leader einer Fraktion mache, bekommt er ja einen Skin zugewiesen. Nach einem Tod, spawnt diese Person aber mit dem alten Skin wieder, ist aber immer noch Leader der Fraktion. Ich hab schon sehr vieles im SetPlayerSpawn und OnPlayerSpawn probiert, jedoch habe ich echt KEINE EINZIGE IDEE mehr !!
SetPlayerSpawn:
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
new rand;
new house = PlayerInfo[playerid][pPhousekey];
if(PlayerPaintballing[playerid] != 0)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 29, 999); //MP5
GivePlayerWeapon(playerid, 31, 999); //Desert Eagle
GivePlayerWeapon(playerid, 24, 999); //M4
rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
return 1;
}
if(PlayerInfo[playerid][pJailed] == 1)
{
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
SendClientMessage(playerid, COLOR_LIGHTRED, "Unvollständige Gefängnisstrafe, zurück ins Gefängnis!");
return 1;
}
if(PlayerInfo[playerid][pJailed] == 2)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,268.5777,1857.9351,9.8133);
SetPlayerWorldBounds(playerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
return 1;
}
if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
{
new string[256];
new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
GivePlayerMoney(playerid, -cut);
format(string, sizeof(string), "Arzt: Deine Untersuchung kostete €%d. Einen schönen Tag noch!", cut+100);
SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
MedicBill[playerid] = 0;
MedicTime[playerid] = 0;
NeedMedicTime[playerid] = 0;
PlayerInfo[playerid][pDeaths] += 1;
SetPlayerHealth(playerid, 25.0);
/*SetPlayerInterior(playerid, 5);
rand = random(sizeof(gMedicSpawns));
SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, 270.0);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~y~You are recovering from your ~r~wounds~y~...", 35000, 3);
MedicTime[playerid] = 1;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
NeedMedicTime[playerid] = 30;
}
else
{
NeedMedicTime[playerid] = 60;
}
PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
return 1;*/
}
if(house != 255)
{
if(PlayerInfo[playerid][pSpawnchange]==1) //If 1, then you get to your house, else spawn somewhere else
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,HouseInfo[house][hInt]);
SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
PlayerInfo[playerid][pLocal] = house;
PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
return 1;
}
}
if(house == 255 && PlayerInfo[playerid][pMember]==0 && PlayerInfo[playerid][pLeader]==0)
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, 1481.3719,-1766.7643,18.7958);
SetPlayerFacingAngle(playerid, 356.9810);
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 1)//Police Force spawn & FBI/ATF
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, 1530.0753,-1667.2504,6.2188);
SetPlayerFacingAngle(playerid, 272.5623);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//ARMY spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -1346.2050,492.3983,11.2027);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//Fire/Ambulance spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -2656.0393,635.0596,14.4531);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)//LaCosaNostra spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 296.5807,-1157.2946,80.9099);
PlayerInfo[playerid][pInt] = 0;
if(PlayerInfo[playerid][pLeader] == 5)
{
SetPlayerSkin(playerid, 124);
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//Yakuza spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1908.1816,736.5706,10.8198);
SetPlayerFacingAngle(playerid, 219.7473);
PlayerInfo[playerid][pInt] = 0;
if(PlayerInfo[playerid][pLeader] == 6)
{
SetPlayerSkin(playerid, 120);
}
return 1;
}
if(PlayerInfo[playerid][pLeader] == 7)//Mayor spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 356.2998,151.9914,1025.7891);
PlayerInfo[playerid][pInt] = 3;
PlayerInfo[playerid][pLocal] = 241;
return 1;
}
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) //Hitman spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, 1102.7017,-299.0774,73.9922);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) //News spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, 1669.3594,-1703.8938,15.6094);
SetPlayerFacingAngle(playerid, 93.2321);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) //Taxi Cab Company spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, 1282.3746,-1317.6866,13.3800);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(IsAFahrlehrer(playerid)) //Driving/Flying School spawn
{
if(SchoolSpawn[playerid] == 0)
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, -2032.6810,-117.4816,1035.1719);
SetPlayerFacingAngle(playerid, 275.1114);
SetPlayerInterior(playerid,3);
PlayerInfo[playerid][pInt] = 3;
}
else if(SchoolSpawn[playerid] == 1)
{
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid, 414.4144,2531.9580,19.1565);
SetPlayerFacingAngle(playerid, 4.6505);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)//ballas spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1900.5358,-1117.2103,25.6641);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)//ruff ryders spawn
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, -541.3298,-502.9346,25.5234);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(gTeam[playerid] == 1)
{
SetPlayerToTeamColor(playerid);
rand = random(sizeof(gMedPlayerSpawns));
SetPlayerPos(playerid, gMedPlayerSpawns[rand][0], gMedPlayerSpawns[rand][1], gMedPlayerSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
if(PlayerInfo[playerid][pFMember] != 255)
{
new family = PlayerInfo[playerid][pFMember];
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid, FamilyInfo[family][FamilyInterior]);
SetPlayerPos(playerid, FamilyInfo[family][FamilySpawn][0],FamilyInfo[family][FamilySpawn][1],FamilyInfo[family][FamilySpawn][2]);
SetPlayerFacingAngle(playerid, FamilyInfo[family][FamilySpawn][3]);
return 1;
}
else
{
SetPlayerToTeamColor(playerid);
if(PlayerInfo[playerid][pOrigin] == 1)//USA
{
SetPlayerPos(playerid,1481.1487,-1766.9633,18.7958);
SetPlayerFacingAngle(playerid, 46.8583);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
else if(PlayerInfo[playerid][pOrigin] == 2)//Europe
{
SetPlayerPos(playerid,1481.1487,-1766.9633,18.7958);
SetPlayerFacingAngle(playerid, 262.9963);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
else if(PlayerInfo[playerid][pOrigin] == 3)//Asia
{
SetPlayerPos(playerid,1481.1487,-1766.9633,18.7958);
SetPlayerFacingAngle(playerid, 272.3543);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
else
{
rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerInterior(playerid,15);
PlayerInfo[playerid][pInt] = 15;
}
return 1;
}
}
return 1;
}
Bestimmt habe ich ein paar Fehler in den Codes, nur sehe ich keinen einzigen, der das Problem mit dem Skin verursacht. Bin echt am verzweifeln, sitze schon 4 Tage drann !!
Ich hoffe ihr habt eine Lösung, bin nur noch auf diese angewiesen!
Viele Grüße,
Stylerboy