Abend Breadfish,
Ich habe momentan ein Problem mit OnplayerDeath.
Undzwar, wenn mich ein spieler killd sterbe ich und das totensystem wird aktiviert.
Doch wenn ich mit selbst kill (von i.wo runter springe, /kill oder so mache) wird nicht von den sachen hier ausgeführt ?
new Float:x, Float:y, Float:z,zeugen,string[500]; TextDrawHideForPlayer(playerid,BOMBENdraw); TextDrawHideForPlayer(playerid,C4ROBdraw); ResetWeapons(playerid); SpawnKillCount[playerid] = 0;
StopAudioStreamForPlayer(playerid); KillTimer(deathtimer[playerid]); KillTimer(friedhoftimer[playerid]); KillTimer(SpawnKillTimer[playerid]); KillTimer(persotime[playerid]); KillTimer(SpielerOrtenTimer[playerid]); KillTimer(losthealthtimer[playerid]); KillTimer(BrobTimerLS[playerid]); KillTimer(robc4[playerid]); KillTimer(Spieler[playerid][pSpectateTimer]);
StopLoopingAnim(playerid); DisablePlayerCheckpoint(playerid); RemovePlayerAttachedObject(playerid,MaskedObject[playerid]); RemovePlayerAttachedObject(playerid,Spieler[playerid][pSchildOBJ]); RemovePlayerAttachedObject(playerid,Spieler[playerid][pMotorradHelmObject]); RemovePlayerAttachedObject(playerid,Spieler[playerid][pTazerOnHand]); if(SpawnKillStatus[playerid] == 1 && killerid != INVALID_PLAYER_ID) { SendClientMessage(killerid,ROT,"Du hast soeben Spawnkill begangen."); format(string,sizeof(string),"Anti-Spawnkill-Schutz: %s ist im Spawnkill-Schutz gestorben.",SpielerName(playerid)); SendAdminMessage(0x00489184, string); } if(Spieler[playerid][pCall] != -1 || Spieler[playerid][pCallHim] == 1 && killerid != INVALID_PLAYER_ID) { new pID = Spieler[playerid][pCall]; Spieler[pID][pCallHim] = 0; Spieler[pID][pCall] = -1; SetPlayerSpecialAction(pID,SPECIAL_ACTION_STOPUSECELLPHONE); SendClientMessage(pID,GELB,"Der Gesprächspartner hat aufgelegt."); TextDrawHideForPlayer(pID,HANDYdraw[pID]); PlayerPlaySound(pID, 1077, 0.0, 0.0, 0.0); Spieler[playerid][pCallHim] = 0; Spieler[playerid][pCall] = -1; SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE); SendClientMessage(playerid,GELB,"Der Gesprächspartner hat aufgelegt."); TextDrawHideForPlayer(playerid,HANDYdraw[playerid]); PlayerPlaySound(playerid, 1077, 0.0, 0.0, 0.0); }
if(irobc4[playerid] == 1 && SpawnKillStatus[playerid] == 0 && GetPVarInt(playerid,"TOT") == 0) { irobc4[playerid] = 0; KillTimer(robc4[playerid]); C4Sekunden = 0; TextDrawHideForAll(C4ROBdraw); } if(Spieler[playerid][pTaxiBeifahrerPreis] > 0 && killerid != INVALID_PLAYER_ID) { switch(GetPlayerVehicleSeat(playerid)) { case 1:TextDrawSetString(TAXOdraw[GetVehicleDriver(GetPlayerVehicleID(playerid))][0],"Frei..."); case 2:TextDrawSetString(TAXOdraw[GetVehicleDriver(GetPlayerVehicleID(playerid))][2],"Frei..."); case 3:TextDrawSetString(TAXOdraw[GetVehicleDriver(GetPlayerVehicleID(playerid))][3],"Frei..."); } format(string,sizeof(string),"Frei\nTaxifahrer/in : %s\nKosten : %i$",SpielerName(GetVehicleDriver(GetPlayerVehicleID(playerid))),Spieler[GetVehicleDriver(GetPlayerVehicleID(playerid))][pTaxiPrice]); Update3DTextLabelText(taxipriceinfo[GetPlayerVehicleID(playerid)],ORANGE,string); format(string, sizeof(string), "%s musste %i$ für eine Taxifahrt in deinem Taxi bezahlen ! Dienstpreis : %i$ (Kilometer * Fahrpreis + Fahrzeit) | Fahrzeit : %i$",SpielerName(playerid),Spieler[playerid][pTaxiBeifahrerPreis],Spieler[GetVehicleDriver(GetPlayerVehicleID(playerid))][pTaxiPrice],Spieler[playerid][pTaxiTime]); SendClientMessage(GetVehicleDriver(GetPlayerVehicleID(playerid)),BLAU,string); NeRMoney(GetVehicleDriver(GetPlayerVehicleID(playerid)),Spieler[playerid][pTaxiBeifahrerPreis]); } if(Spieler[playerid][pAdminOnduty] == 0 && Paintball[playerid] == 0 && SpawnKillStatus[playerid] == 0 && GetPlayerScore(playerid) > 2) { if(GetPVarInt(playerid,"TOT") == 0) { SendClientMessage(playerid,ROT,"Du bist gestorben."); new rdeath = random(5); if(!strcmp(Spieler[playerid][pHandy],"Keins",true)) { if(Spieler[playerid][pHandystate] != 0) { if(rdeath == 3) { SendClientMessage(playerid,GRUEN,"Du bist auf den S.O.S Knopf deines Handy's gefallen."); if((x > -992.5172 && x < 4000.0000) && (y < 528.0000 && y > -4000.0000)) //Los Santos { format(string,sizeof string,"%s hat ein Notruf aus Los Santos abgesendet. Mit ´/accept medic´ kannst du diesen annehmen.",SpielerName(playerid)); } if((x > -4000.0000 && x< -992.5172) && (y < 4000.0000 && y > -4000.0000)) //San Fierro { format(string,sizeof string,"%s hat ein Notruf aus San Fierro abgesendet. Mit ´/accept medic´ kannst du diesen annehmen.",SpielerName(playerid)); } if((x > -992.5172 && x< 4000.0000) && (y < 4000.0000 && y > 528.0000)) //Las Venturas { format(string,sizeof string,"%s hat ein Notruf aus Las Venturas abgesendet. Mit ´/accept medic´ kannst du diesen annehmen.",SpielerName(playerid)); } for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(isPlayerInFrakt(i,3))// im Medic { if(Spieler[i][pDuty] == 1) { SendClientMessage(i,HELLBLAU,string); Notrufmedic = playerid; } } } } } } } } GetPlayerPos(playerid,x,y,z); Spieler[playerid][tot_x]= x; Spieler[playerid][tot_y]= y; Spieler[playerid][tot_z]= z; Spieler[playerid][tot_int] = GetPlayerInterior(playerid); KillTimer(deathtimer[playerid]); for(new i_slot=0,gun,ammo;i_slot!=12;i_slot++) { GetPlayerWeaponData(playerid, i_slot, gun, ammo); if(gun != 0 && ammo != 0)CreateDroppedGun(playerid, gun, ammo, x+random(2)-random(2), y+random(2)-random(2), z); } SetPVarInt(playerid,"TOT",1); } if(Paintball[playerid] == 1) { if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) { SetPVarInt(killerid, "PB-kills", GetPVarInt(killerid, "PB-kills")+1); SetPVarInt(playerid, "PB-tode", GetPVarInt(playerid, "PB-tode")+1); GetPlayerPos(playerid,x,y,z); GameTextForPlayer(killerid,"~g~Kill", 1000, 4); GameTextForPlayer(playerid,"~r~Death", 1000, 4); SetTimerEx("PaintBallPickupRefresh",30000, 1,"i",playerid); DestroyPickup(pbdeathpickup[playerid]); Delete3DTextLabel(PBdeathtext[playerid]); pbdeathpickup[playerid] = CreatePickup(1254,1,x,y,z); format(string,sizeof(string),"%s",SpielerName(playerid)); PBdeathtext[playerid] = Create3DTextLabel(string,0xFFADFFFF,x,y,z,10.0,0); switch(GetPVarInt(playerid,"PB-kills")) { case 0: {SetPVarInt(killerid,"PB-rang",0);} case 25: { SetPVarInt(killerid,"PB-rang",1); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<Anfänger>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~Anfänger",1000, 0); } case 50: { SetPVarInt(killerid,"PB-rang",2); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<Fortgeschrittener>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~Fortgeschrittener",1000, 0); } case 100: { SetPVarInt(killerid,"PB-rang",3); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<Skiller>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~Skiller",1000, 0); } case 150: { SetPVarInt(killerid,"PB-rang",4); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<Profi>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~Profi",1000, 0); } case 200: { SetPVarInt(killerid,"PB-rang",5); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<High Skiller>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~High Skiller",1000, 0); } case 250: { SetPVarInt(killerid,"PB-rang",6); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<Elite>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~Elite",1000, 0); } case 500: { SetPVarInt(killerid,"PB-rang",7); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<ProHighSkiller>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~ProHighSkiller",1000, 0); } case 1000: { SetPVarInt(killerid,"PB-rang",8); PlayerPlaySound(killerid, 1183, 0.0, 0.0, 0.0); SetTimerEx("stopmusic",5000, 0, "i", playerid); SendClientMessage(killerid,0x4BB400FF,"Paintball: Du bist nun eine Rang höher gestiegen |<[NeR] Elite>|"); GameTextForPlayer(killerid,"~g~Rank-~w~Up ~r~[NeR] Elite",1000, 0); } } for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(GetPVarInt(i,"Eingeloggt") == 1) { if(Paintball[i] == 1) { format(string,sizeof(string),"** Paintball: %s wurde von %s getötet **",SpielerName(playerid),SpielerName(killerid)); SendClientMessage(i,0xFFADFFFF,string); } } } } } } if(Paintball[playerid] == 0 && Spieler[playerid][pAdminOnduty] == 0 && GetPVarInt(playerid,"TOT") == 0 && GetPVarInt(playerid,"eingejailt") == 0 && SpawnKillStatus[playerid] == 0) { if(Spieler[playerid][pWantedPoints] > 0) { if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) { if(isPlayerInFrakt(killerid,1) || isPlayerInFrakt(killerid,2) || isPlayerInFrakt(killerid,6)) { if(Spieler[killerid][pDuty] == 1) { new wps = Spieler[playerid][pWantedPoints]; new price = wps * 50; if(Spieler[playerid][pWantedPoints] > 50) { Spieler[playerid][pDuty] = 0; SetPVarInt(playerid, "Tode", GetPVarInt(playerid, "Tode")+1); SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1); SetPVarInt(playerid, "eingejailt",2); Spieler[playerid][pWantedPoints] = 0; Spieler[playerid][pKaution] = 2; Spieler[playerid][pJailTime] = 90; SetPVarInt(playerid,"Steroide",0); SetPVarInt(playerid,"HANF",0); SetPVarInt(playerid,"KOKS",0); SetPVarInt(playerid,"C4",0); SetPVarInt(playerid,"MATERIALS",0); Spieler[playerid][MatsPackete] = 0; Spieler[playerid][DrugPackete] = 0; KnastTimer[playerid] = SetTimerEx("Knastende",60000,1, "i", playerid); SetPVarInt(playerid,"TOT",0); format(string,sizeof(string),".::: %s %s hat den gesuchten %s getötet :::.",SpielerFraktionsRangName(killerid),SpielerName(killerid),SpielerName(playerid)); SendClientMessageToAll(0xFF0000FF,string); NeRMoney(playerid, -price); PlayerPlaySound(killerid, 1054, 0.0, 0.0, 0.0); format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~$%d",price); GameTextForPlayer(killerid, string, 3000, 1); NeRMoney(killerid, price); } else if(Spieler[playerid][pWantedPoints] > 40) { Spieler[playerid][pDuty] = 0; SetPVarInt(playerid, "Tode", GetPVarInt(playerid, "Tode")+1); SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1); SetPVarInt(playerid, "eingejailt",2); Spieler[playerid][pWantedPoints] = 0; Spieler[playerid][pKaution] = 2; Spieler[playerid][pJailTime] = wps+20; SetPVarInt(playerid,"Steroide",0); SetPVarInt(playerid,"HANF",0); SetPVarInt(playerid,"KOKS",0); SetPVarInt(playerid,"C4",0); SetPVarInt(playerid,"MATERIALS",0); Spieler[playerid][MatsPackete] = 0; Spieler[playerid][DrugPackete] = 0; KnastTimer[playerid] = SetTimerEx("Knastende",60000,1, "i", playerid); SetPVarInt(playerid,"TOT",0); format(string,sizeof(string),".::: %s %s hat den gesuchten %s getötet :::.",SpielerFraktionsRangName(killerid),SpielerName(killerid),SpielerName(playerid)); SendClientMessageToAll(0xFF0000FF,string); NeRMoney(playerid, -price); PlayerPlaySound(killerid, 1054, 0.0, 0.0, 0.0); format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~$%d",price); GameTextForPlayer(killerid, string, 3000, 1); NeRMoney(killerid, price); } else if(Spieler[playerid][pWantedPoints] > 0) { Spieler[playerid][pDuty] = 0; SetPVarInt(playerid, "Tode", GetPVarInt(playerid, "Tode")+1); SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1); SetPVarInt(playerid, "eingejailt",1); Spieler[playerid][pWantedPoints] = 0; Spieler[playerid][pKaution] = 2; Spieler[playerid][pJailTime] = wps+10; SetPVarInt(playerid,"Steroide",0); SetPVarInt(playerid,"HANF",0); SetPVarInt(playerid,"KOKS",0); SetPVarInt(playerid,"C4",0); SetPVarInt(playerid,"MATERIALS",0); Spieler[playerid][MatsPackete] = 0; Spieler[playerid][DrugPackete] = 0; KnastTimer[playerid] = SetTimerEx("Knastende",60000,1, "i", playerid); SetPVarInt(playerid,"TOT",0); format(string,sizeof(string),".::: %s %s hat den gesuchten %s getötet :::.",SpielerFraktionsRangName(killerid),SpielerName(killerid),SpielerName(playerid)); SendClientMessageToAll(0xFF0000FF,string); NeRMoney(playerid, -price); PlayerPlaySound(killerid, 1054, 0.0, 0.0, 0.0); format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~$%d",price); GameTextForPlayer(killerid, string, 3000, 1); NeRMoney(killerid, price); } } } } } } if(GetPVarInt(playerid,"headmoney") > 0) { if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) { if(isPlayerInFrakt(killerid,9)) { new headprice = GetPVarInt(playerid, "headmoney"); format(string, sizeof(string), "Du wurdest von der Contractlist der Yakuza gelöscht. Grund: Auftrag ausgeführt.",headprice); SendClientMessage(playerid,WEINROT,string); format(string, sizeof(string), "%s du hast den Auftrag %s erfolgreich abgeschlossen. Belohnung: %i$",SpielerName(killerid),SpielerName(playerid),headprice); SendClientMessage(killerid,0x4BB400FF,string); PlayerPlaySound(killerid, 1054, 0.0, 0.0, 0.0); format(string, sizeof(string), "~r~Gesuchten~w~ umgebracht~n~Bonus: %d$",headprice); GameTextForPlayer(killerid, string, 3000, 1); SetPVarInt(playerid, "Tode", GetPVarInt(playerid, "Tode")+1); SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1); NeRMoney(killerid,headprice); SetPVarInt(playerid, "headmoney",0); for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(GetPVarInt(i,"Eingeloggt") == 1) { if(isPlayerInFrakt(i,9)) { format(string, sizeof(string), "==> %s hat den Auftrag %s erfolgreich ausgeführt. Belohnung: %i$",SpielerName(killerid),SpielerName(playerid),headprice); SendClientMessage(i,HELLBLAU, string); } } } } } } } if(Paintball[playerid] == 0 && Spieler[playerid][pAdminOnduty] == 0 && GetPVarInt(playerid,"TOT") == 0 && GetPVarInt(playerid,"eingejailt") == 0 && SpawnKillStatus[playerid] == 0) { if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID) { if(Spieler[playerid][pBL][Spieler[killerid][pFraktion]] == Spieler[killerid][pFraktion] && SpawnKillStatus[playerid] == 0 && GetPVarInt(playerid,"TOT") == 0 && Paintball[playerid] == 0) { if(isPlayerInFrakt(killerid,Spieler[playerid][pBL][Spieler[killerid][pFraktion]])) { format(string, sizeof(string), "Du wurdest von %s von der Blacklist der %s gelöscht. Grund: Mord",SpielerName(killerid),SpielerFraktion(killerid)); SendClientMessage(playerid,0x6E00A3FF,string); SetPVarInt(playerid, "Tode", GetPVarInt(playerid, "Tode")+1); SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1); Spieler[playerid][pBL][Spieler[killerid][pFraktion]] = 0; for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(GetPVarInt(i,"Eingeloggt") == 1) { if(isPlayerInFrakt(i,Spieler[killerid][pFraktion])) { format(string, sizeof(string), "%s hat %s von der Blacklist gelöscht. Grund: Mord",SpielerName(killerid),SpielerName(playerid)); SendClientMessage(i,0x6E00A3FF, string); } } } } } } } } if(Paintball[playerid] == 0 && Spieler[playerid][pAdminOnduty] == 0 && GetPVarInt(playerid,"TOT") == 0 && GetPVarInt(playerid,"eingejailt") == 0 && SpawnKillStatus[playerid] == 0) { if(Spieler[killerid][pDuty] == 0 && killerid != INVALID_PLAYER_ID) { Spieler[killerid][pIssureKiller] = playerid; SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1); SetPVarInt(playerid, "Tode", GetPVarInt(playerid, "Tode")+1); GetPlayerPos(playerid,x,y,z); for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(GetPVarInt(i,"Eingeloggt") == 1) { if(IsPlayerInRangeOfPoint(i,15,x,y,z)) { if(playerid != i) { if(killerid != i) { if(!isPlayerInFrakt(i,Spieler[killerid][pFraktion])) { zeugen ++; } } } } } } } if(zeugen > 0) { format(string,sizeof(string),"Du hast ein Verbrechen begangen: Vorsätzlicher Mord ! Zeuge: %s",SpielerName(i)); SendClientMessage(killerid,0xFF0000FF,string); if((Spieler[killerid][pWantedPoints] + 5) > 60) { SetPlayerWantedLevel(killerid,6); Spieler[killerid][pWantedPoints] = 60; } GivePlayerWPS(killerid,5,"Zivilisten Mord"); } else SendClientMessage(killerid,0xFF0000FF,"Du hast ein Verbrechen begangen: Vorsätzlicher Mord ! Zeuge: Keiner"); } }