Hallo Community,
Seit dem ich das Todes System in mein Script angeschaltet habe (Das man im Krankenhaus landet beim sterben)
scheint unser Kleidung Shop zu buggen.
Anscheinend stirbt man beim Skin Wechsel und man landet ins Krankenhaus, Eigentlich sollte man direkt wieder da spawn wo man stand.
Hoffe ihr könnt mir helfen ich find den Fehler leider nicht.
Kleider Shop Codes:
//Daran wirds denk ich mal nicht Liegen.
if(strcmp(cmd, "/Kleidung", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] >= 1)
{
if(IsAtClothShop(playerid))
{
if(PlayerInfo[playerid][pMember] == 1) { ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
else if(PlayerInfo[playerid][pMember] == 2) { ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
else if(PlayerInfo[playerid][pMember] == 3) { ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
else if(PlayerInfo[playerid][pMember] == 4) { ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
else if(PlayerInfo[playerid][pMember] == 5) { ChosenSkin[playerid] = 117; SetPlayerSkin(playerid, 117); }
//else if(PlayerInfo[playerid][pMember] == 6) { ChosenSkin[playerid] = 111; SetPlayerSkin(playerid, 111); }
else if(PlayerInfo[playerid][pMember] == 8) { ChosenSkin[playerid] = 249; SetPlayerSkin(playerid, 249); }
else if(PlayerInfo[playerid][pMember] == 9) { ChosenSkin[playerid] = 148; SetPlayerSkin(playerid, 148); }
else if(PlayerInfo[playerid][pMember] == 10) { ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
//else if(PlayerInfo[playerid][pMember] == 11) { ChosenSkin[playerid] = 59; SetPlayerSkin(playerid, 59); }
/*else if(PlayerInfo[playerid][pMember] == 14) { ChosenSkin[playerid] = 169; SetPlayerSkin(playerid, 169); }
else if(PlayerInfo[playerid][pMember] == 15) { ChosenSkin[playerid] = 270; SetPlayerSkin(playerid, 270); }*/
else if(PlayerInfo[playerid][pMember] == 16) { ChosenSkin[playerid] = 144; SetPlayerSkin(playerid, 144); }
else { return 1; }
GetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
ChangePos2[playerid][0] = GetPlayerInterior(playerid);
ChangePos2[playerid][1] = 1;
SetPlayerInterior(playerid,0);
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
TogglePlayerControllable(playerid, 0);
SelectChar[playerid] = 255;
SelectCharID[playerid] = PlayerInfo[playerid][pMember];
SelectCharPlace[playerid] = 1;
PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
SendClientMessage(playerid, COLOR_LIGHTRED, "* Tipp: Gebe 'Weiter' ein um weitere Skins anzusehen.");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Falls du ein Skin gefunden hast den du Bentuzten willst, Tipp: 'Fertig'.");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht im New Yorker !");
return 1;
}
}
else
{
if(PlayerInfo[playerid][pLeader] != 0)
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist in einer Fraktion, Deshalb kannst du deine Kleidung nicht ändern! !");
return 1;
}
if(IsAtClothShop(playerid))
{
if(PlayerInfo[playerid][pSex] == 1) { ChosenSkin[playerid] = 2; SetPlayerSkin(playerid, 2); PlayerInfo[playerid][pChar] = 2; }
else if(PlayerInfo[playerid][pSex] == 2) { ChosenSkin[playerid] = 55; SetPlayerSkin(playerid, 55); PlayerInfo[playerid][pChar] = 55; }
else { return 1; }
GetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
ChangePos2[playerid][0] = GetPlayerInterior(playerid);
ChangePos2[playerid][1] = 1;
SetPlayerInterior(playerid,0);
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
TogglePlayerControllable(playerid, 0);
SelectChar[playerid] = 255;
if(PlayerInfo[playerid][pSex] == 1) { SelectCharID[playerid] = 20; }
else if(PlayerInfo[playerid][pSex] == 2) { SelectCharID[playerid] = 30; }
else { return 1; }
SelectCharPlace[playerid] = 1;
PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
SendClientMessage(playerid, COLOR_LIGHTRED, "* Tipp: Gebe 'Weiter' ein um weitere Skins anzusehen.");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Falls du ein Skin gefunden hast den du Verwenden willst gebe 'Fertig' ein.");
}
}
}
return 1;
}
//Hier ran wird es liegen weil wenn man Fertig eingibt wird man ins Krankenhaus gespawnt (weil man irgentwie stirbt) und neugespawnt wird.
else if ((strcmp("Fertig", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("Fertig")))
{
if(ChangePos2[playerid][1] == 1)
{
SetPlayerInterior(playerid, ChangePos2[playerid][0]);
SetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
ChangePos2[playerid][1] = 0;
//return 0;
}
MedicBill[playerid] = 0;
PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel],0.0,0.0,0.0,0,0,0,0,0,0,0);
gTeam[playerid] = PlayerInfo[playerid][pTeam];
SetPlayerToTeamColor(playerid);
MedicBill[playerid] = 0;
SpawnPlayer(playerid);
MedicBill[playerid] = 0;
SelectCharPlace[playerid] = 0;
SelectCharID[playerid] = 0;
SelectChar[playerid] = 0;
SetPlayerVirtualWorld(playerid,0);
SetTimerEx("backtoclothes", 500, false, "i", playerid);
MedicBill[playerid] = 0;
return 0;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* Tipp: 'Weiter', oder 'Fertig'.");
return 0;
}
}
Krankenhaus System:
if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
{
if(FirstSpawn[playerid] != 1)
{
//new string[256];
new cut = deathcost;
SafeGivePlayerMoney(playerid, -cut);
MedicBill[playerid] = 0;
MedicTime[playerid] = 0;
NeedMedicTime[playerid] = 0;
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid,1612.3240,-2330.1670,14.5469);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerHealth(playerid, 50.0);
PlayerInfo[playerid][pDeaths] += 1;
SetPlayerInterior(playerid, 3);
PlayerInfo[playerid][pInt] = 3;
rand = random(sizeof(gMedicSpawns));
SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, 0);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Du musst dich ausruhen ...", 30000, 3);
JustDied[playerid] = 1;
MedicTime[playerid] = 1;
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
if(PlayerInfo[playerid][pDonateRank] > 0)
{
NeedMedicTime[playerid] = 30;
}
else
{
NeedMedicTime[playerid] = 40;
}
PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
return 1;
}
}
if(MedicTime[i] > 0)
{
if(MedicTime[i] == 3)
{
SetPlayerInterior(i, 3);
PlayerInfo[i][pInt] = 3;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X,Y,Z);
SetPlayerCameraPos(i, X - 3, Y, Z);
SetPlayerCameraLookAt(i,X,Y,Z);
}
MedicTime[i] ++;
if(MedicTime[i] >= NeedMedicTime[i])
{
new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
//SafeGivePlayerMoney(i, -cut);
format(string, sizeof(string), "Doktor: Ihre Arzt Rechnung $%d.", cut);
SendClientMessage(i, TEAM_CYAN_COLOR, string);
TogglePlayerControllable(i, 1);
MedicBill[i] = 0;
MedicTime[i] = 0;
NeedMedicTime[i] = 0;
PlayerInfo[i][pDeaths] += 1;
PlayerFixRadio(i);
ClearAnimations(i);
SetPlayerSpawn(i); //Das wurde von mir hingefügt
SetCameraBehindPlayer(i); //das ebendfalls
}
}
Hoffe ihr habt Tipps für mich woran es liegen könnte.
Ich hab schon beim Kleider Shop System geguckt ob man Stirbt etc. aber hab nix ähnliches gefunden.
Gruß
mcbeat
Edit:
Falls mir jmd helfen könnte und nicht weiß wie ers erklären soll, wäre ich auch bereit Teamviewer anzumachen.
Einfach melden über icq 249688741