Hallo,
Ich habe das Problem, dass der gespeicherte Skin gespeichert und geladen wird, doch wenn ich nun mit Befehlen wie /setskin oder /makeleader, den Skin ändere und dann sterbe, dann habe ich wieder den Skin, der beim Login geladen wurde.
Folglich muss das Problem zwischen OnPlayerDeath und OnPlayerSpawn liegen, richtig?
Code
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid,"Fraktion")==0)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
SetPlayerSkin(playerid,dini_Int(Spielerdatei,"Skin"));
return 1;
}
switch(GetPVarInt(playerid,"Fraktion"))
{
case 0:{}
case 1:{SetPlayerPos(playerid,lspdspawn);SetPlayerColor(playerid,BLAU);SetPlayerFacingAngle(playerid,178.8396);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);GivePlayerWeapon(playerid,3,1);}
case 2:{SetPlayerPos(playerid,aztecasspawn);SetPlayerFacingAngle(playerid,271.2784);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);}
case 3:{SetPlayerPos(playerid,grovespawn);SetPlayerFacingAngle(playerid,78.2568);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);}
case 4:{SetPlayerPos(playerid,ballasspawn);SetPlayerFacingAngle(playerid,176.7103);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);}
case 5:{SetPlayerPos(playerid,vagosspawn);SetPlayerFacingAngle(playerid,2.9046);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);}
case 6:{SetPlayerPos(playerid,lcnspawn);SetPlayerFacingAngle(playerid,287.7142);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);}
case 7:{SetPlayerPos(playerid,hellsangelsspawn);SetPlayerFacingAngle(playerid,265.6278);SetCameraBehindPlayer(playerid);GivePlayerWeapon(playerid,24,30);}
case 8:{SetPlayerPos(playerid,medicspawn);SetPlayerFacingAngle(playerid,269.4066);SetCameraBehindPlayer(playerid);SetPlayerColor(playerid,ROT);}
case 9:{SetPlayerPos(playerid,staatspawn);SetPlayerFacingAngle(playerid,358.1442);SetCameraBehindPlayer(playerid);SetPlayerColor(playerid,GRAU);}
case 10:{SetPlayerPos(playerid,blackspawn);SetPlayerFacingAngle(playerid,179.0876);SetCameraBehindPlayer(playerid);}
case 11:{SetPlayerPos(playerid,racespawn);SetPlayerFacingAngle(playerid,91.1683);SetCameraBehindPlayer(playerid);}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
dini_IntSet(Spielerdatei,"Skin",GetPlayerSkin(playerid));
return 1;
}
Alles anzeigen
mfG [CGR]BlackJack