Hallo,
ich wollte eine Skin Auswahl erstellen, die leider nicht funktioniert.
Ich zeige am besten mal den Code vor:
SpielerInfo[playerid][pGeschlecht] = 1;
SavePlayer(playerid);
pSkinAuswahl[playerid] = 1;
SpawnPlayer(playerid);
ForceClassSelection(playerid);
public OnPlayerRequestClass(playerid, classid)
{
if(pSkinAuswahl[playerid] == 1)
{
if(SpielerInfo[playerid][pGeschlecht] == 1)
{
ClearPlayerChat(playerid,20);
SendClientMessage(playerid,COLOR_WHITE,"Wähle nun deinen gewünschten Skin aus.");
SendClientMessage(playerid,COLOR_WHITE,"Mit der {FF6400}Shift Taste {FAFAFA}kommst du zum nächsten Skin. Mit der {FF6400}Enter Taste {FAFAFA}bestätigst du den Skin.");
SetPlayerPos(playerid,154.0020,-1938.8119,3.7734);
SetPlayerFacingAngle(playerid,359.9730);
SetPlayerCameraPos(playerid,153.9503,-1928.0458,3.7696);
SetPlayerCameraLookAt(playerid,154.0020,-1938.8119,3.7734);
TogglePlayerSpectating(playerid, true);
SetPlayerSkin(playerid,2);
}
...
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
if(pSkinAuswahl[playerid] == 1)
{
if(SpielerInfo[playerid][pGeschlecht] == 1)
{
switch(GetPlayerSkin(playerid))
{
case 2:SetPlayerSkin(playerid,6);
case 6:SetPlayerSkin(playerid,7);
case 7:SetPlayerSkin(playerid,18);
case 18:SetPlayerSkin(playerid,19);
case 19:SetPlayerSkin(playerid,20);
case 20:SetPlayerSkin(playerid,21);
case 21:SetPlayerSkin(playerid,22);
case 22:SetPlayerSkin(playerid,23);
case 23:SetPlayerSkin(playerid,24);
case 24:SetPlayerSkin(playerid,25);
case 25:SetPlayerSkin(playerid,26);
case 26:SetPlayerSkin(playerid,29);
case 29:SetPlayerSkin(playerid,45);
case 45:SetPlayerSkin(playerid,59);
case 59:SetPlayerSkin(playerid,60);
case 60:SetPlayerSkin(playerid,66);
case 66:SetPlayerSkin(playerid,101);
case 101:SetPlayerSkin(playerid,134);
case 134:SetPlayerSkin(playerid,137);
case 137:SetPlayerSkin(playerid,142);
case 142:SetPlayerSkin(playerid,217);
case 217:SetPlayerSkin(playerid,222);
case 222:SetPlayerSkin(playerid,230);
case 230:SetPlayerSkin(playerid,242);
case 242:SetPlayerSkin(playerid,262);
case 262:SetPlayerSkin(playerid,289);
case 289:SetPlayerSkin(playerid,2);
}
}
...
Weiß jemand zufällig weiter? Ich sehe nicht mal die Skin Auswahl, da die OnPlayerRequestClass nicht mal aufgerufen wird.