Ich lass den Skin bei OnPlayerSpawn auslesen und dann setzten, funktioniert jedoch nicht mehr mit meinen Skin System.
Beim Skin System habe ich jetzt die ganze Zeit den CJ Skin, egal ob ich auf weiterklicke oder nicht, ebenso sobald ich spawne setzt er mich wieder in die Skinauswahl.
Ich frage ja auch ab ob der Spieler den CJ Skin hat, dann kommt er automatisch in die Skin Auswahl aber es funktioniert nicht.
//Dinge die geladen werden
new skin = SpielerInfo[playerid][pSkin];
SetPlayerSkin(playerid,skin);
if(GetPlayerSkin(playerid) == 0)
{
if(SpielerInfo[playerid][pGeschlecht] == 1) //Männlich
{
SetPlayerPos(playerid, 437.3533,-1748.4609,9.1031);
SetPlayerCameraPos(playerid, 438.6240,-1752.1791,8.8109);
SetPlayerCameraLookAt(playerid, 437.3533,-1748.4609,9.1031);
SetPlayerFacingAngle(playerid, 228.3101);
AuswahlMann[playerid] = 1;
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
SendClientMessage(playerid,COLOR_WHITE,"Nun musst du dir noch einen passenden Skin auswählen.");
SendClientMessage(playerid,COLOR_WHITE,"Mit der {00AFFF}SHIFT Taste {FFFFFF}wählst du den nächsten Skin, bestätigen tust du mit der {FFFFFF}Enter Taste.");
SetPlayerSkin(playerid,2);
TogglePlayerControllable(playerid,0);
}
if(SpielerInfo[playerid][pGeschlecht] == 2) //Weiblich
{
SetPlayerPos(playerid, 437.3533,-1748.4609,9.1031);
SetPlayerCameraPos(playerid, 438.6240,-1752.1791,8.8109);
SetPlayerCameraLookAt(playerid, 437.3533,-1748.4609,9.1031);
SetPlayerFacingAngle(playerid, 228.3101);
AuswahlFrau[playerid] = 1;
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
SendClientMessage(playerid,COLOR_WHITE,"Nun musst du dir noch einen passenden Skin auswählen.");
SendClientMessage(playerid,COLOR_WHITE,"Mit der {00AFFF}SHIFT Taste {FFFFFF}wählst du den nächsten Skin, bestätigen tust du mit der {FFFFFF}Enter Taste.");
TogglePlayerControllable(playerid,0);
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_JUMP)
{
if(AuswahlMann[playerid] == 1)
{
if(GetPlayerSkin(playerid) == 2)
{
SetPlayerSkin(playerid,7);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
else if(GetPlayerSkin(playerid) == 7)
{
SetPlayerSkin(playerid, 20);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
else if(GetPlayerSkin(playerid) == 20)
{
SetPlayerSkin(playerid, 21);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
else if(GetPlayerSkin(playerid) == 21)
{
SetPlayerSkin(playerid, 24);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
else if(GetPlayerSkin(playerid) == 24)
{
SetPlayerSkin(playerid, 22);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
else if(GetPlayerSkin(playerid) == 22)
{
SetPlayerSkin(playerid, 23);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
else if(GetPlayerSkin(playerid) == 23)
{
SetPlayerSkin(playerid, 2);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
}
}
}
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(AuswahlMann[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid, COLOR_WHITE, ""); SendClientMessage(playerid, COLOR_WHITE, "");
SendClientMessage(playerid,COLOR_WHITE,"Du hast deinen Skin ausgewählt.");
new skin = GetPlayerSkin(playerid);
SpielerInfo[playerid][pSkin] = skin;
SpawnPlayer(playerid);
AuswahlMann[playerid] = 0;
}
}
return 1;
}
Code Explosion
//edit:Text
//edit:Text