Hallo,
ich habe mir eine "eigene" Skinauswahl gebaut (Spawnbutton selber gemacht).
Leider klappt das System nicht, wie ich es mir vorstelle. Die Kamera bleibt am Nullpunkt, obwohl diese eigentlich woanders hingehört.
Hier mein Code:
public OnPlayerClickTextDraw(playerid,Text:clickedid)
{
if(clickedid == Skinselect1)
{
if(GetPlayerSkin(playerid) == 1){
SetPlayerSkin(playerid,299);
} else {
SetPlayerSkin(playerid,GetPlayerSkin(playerid)-1);
}
}
else if(clickedid == Skinselect2)
{
if(GetPlayerSkin(playerid) == 299){
SetPlayerSkin(playerid,1);
} else {
SetPlayerSkin(playerid,GetPlayerSkin(playerid)+1);
}
}
else if(clickedid == Skinselect3)
{
CancelSelectTextDraw(playerid);
spawned[playerid] = 1; SkinSel[playerid] = 0;
SetPlayerPos(playerid,-1496.1930,1196.9891,7.2551);
SetPlayerVirtualWorld(playerid,0); TogglePlayerSpectating(playerid,false); TogglePlayerControllable(playerid,true);
TextDrawHideForPlayer(playerid, Skinselect0);
TextDrawHideForPlayer(playerid, Skinselect1);
TextDrawHideForPlayer(playerid, Skinselect2);
TextDrawHideForPlayer(playerid, Skinselect3);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(spawned[playerid] == 0 && ingame[playerid] == 0 && SkinSel[playerid] == 1)
{
TextDrawShowForPlayer(playerid,Skinselect0);
TextDrawShowForPlayer(playerid,Skinselect1);
TextDrawShowForPlayer(playerid,Skinselect2);
TextDrawShowForPlayer(playerid,Skinselect3);
SelectTextDraw(playerid,COLOR_SLTD);
SetPlayerPos(playerid, -1501.3486, 1196.7833, 7.2551);
SetPlayerCameraPos(playerid, -1495.1930, 1196.9891, 8.5551);
SetPlayerCameraLookAt(playerid, -1501.3486, 1196.7833, 7.2551);
TogglePlayerSpectating(playerid,true);
TogglePlayerControllable(playerid,false);
SetPlayerVirtualWorld(playerid,playerid);
}
ResetPlayerWeapons(playerid);
return 1;
}
Warum geht das nicht?
lg
Deagle