Komanda /kill - DEBUG

Započeo Carera, Jul 22, 2019, 14:07:45 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Recompilao sam sa -d3 kada ubijem sebe na kucnom serveru isti debug bude kao na slici gore https://imgur.com/a/z17F4Rv


Citat: mumitza. poslato Jul 23, 2019, 13:49:05 POSLE PODNE
daj OnPlayerDeath komplet
public OnPlayerDeath(playerid, killerid, reason)
{
	new buff[64], name[24];
	GetPlayerName(playerid, name, 24);

	if (killerid != INVALID_PLAYER_ID) {
		new kname[24];
		GetPlayerName(killerid, kname, 24);
		format(buff, sizeof buff, "%s [ %d ] je ubio %s-a [ %d ]", kname, killerid, name, playerid);
	}
	else format(buff, sizeof buff, "%s se ubio [ %d ]", name, playerid);

	foreach(new i : Player) sendAltChatMessage(i, buff);
	if(killerid != IPI)
	{
		PlayerInfo[killerid][pKills]++;
		Igrac_Spawnovan[playerid] = false;
		//
        if(PlayerInfo[killerid][pLevel] == 1)
        {
   			new m_m[150];
			format(m_m, sizeof(m_m), "{D1345B}DC-AC | "COL_W"%s | ID: %d | Level: %d | Razlog: Ubijanje igraca sa levelom 1.", GetName(killerid), killerid, GetPlayerScore(killerid));
			PAdm(-1, m_m, 1);
		}
		//
		if(GetVehicleModel(killerid) == 465 && DronVozilo[killerid] != -1)
    	{
    	    m_RemovePlayerFromVehicle(killerid);
    	    DestroyCar(DronVozilo[killerid]);
    	    DronVozilo[killerid] = -1;
    	    DestroyDynamic3DTextLabel(DronVoziloLabel[DronVozilo[killerid]]);
    	    //
    	    m_ResetPlayerWeapons(killerid);
		 	m_SetPlayerPos(killerid, 107.2300,1920.6311,18.5208);
			SetPlayerWorldBounds(killerid, 337.5694,101.5826,1940.9759,1798.7453);
    	    PlayerInfo[killerid][pJailTime] = 1800;
			PlayerInfo[killerid][pJailed] = 2;
			ClearCrime(killerid);
			m_SetPlayerWantedLevel(killerid, PlayerInfo[killerid][pWanted]);
			LoadObjects(killerid, 10);
			SetPlayerInterior(killerid, 0);
			SetPlayerSpecialAction(killerid, SPECIAL_ACTION_NONE);
			SetPlayerVirtualWorld(killerid, 7);
			for(new d = 0; d < MAX_PLAYER_ATTACHED_OBJECTS; d++) { if(IsPlayerAttachedObjectSlotUsed(killerid, d)) RemovePlayerAttachedObject(killerid, d); }
			GameTextForPlayer(killerid, "~n~~n~~w~Dobro dosli u~n~~r~najzloglaseniji zatvor :*", 5000, 3);
			//
			new string[150];
			format(string, sizeof(string), ""COL_A"[AUTO-JAIL] "COL_W"'%s' je ubio '%s' Dronom, automatski je prebacen u najzloglaseniji zatvor!", GetName(killerid), GetName(playerid));
			SCMTA(-1, string);
			//
			SS[ssJail]++;
			SacuvajStatistiku(0);
    	}
    	//
    	if(IsPlayerInAnyVehicle(killerid))
    	{
    	    new m_ac[128];
    	    format(m_ac, sizeof(m_ac), ""COL_AC"[DRIVE-BY] '%s'(%d) je izvrsio DriveBy nad '%s'(%d).", GetName(killerid), killerid, GetName(playerid), playerid);
    	    PAdm(-1, m_ac, 1);
    	}
    	//
        if(PlayerInfo[killerid][pJailed] > 0)
        {
            if(PlayerInfo[killerid][pJailTime] > 0)
            {
                PlayerInfo[killerid][pJailTime] += 200;
                SCM(killerid, F_RED, "[ZATVOR] Zatvorska kazna vam je produzena za 200 sekundi zbog ubijanja zatvorenika.");
                SCM(killerid, F_RED, "[ZATVOR] Svaki put kad ubijete nekoga u zatvoru dobijate dodatnih 200 sekundi zatvora.");
                SCM(killerid, F_RED, "[ZATVOR] Ukoliko zelite izaci iz zatvora pomocu zlata - /izvadime.");
            }
        }
		//
        if(UDMZoni[playerid] == true)
		{
        	new csdm[128];
        	if(killerid != IPI && UDMZoni[killerid] == true)
			{
	            PlayerInfo[killerid][pDMZonaUbistva]++;
	            format(csdm, sizeof(csdm), "DeathMatch Zona | '%s' je ubio '%s'.", GetName(killerid), GetName(playerid));
			    DMZonaSCM(-1, csdm);
        	}
        	return 1;
    	}
        //
        for(new w = 1; w < MAX_WARS; w ++)
		{
			if(WARInfo[w][warActive] == true && WARPInfo[playerid][warID] == w && WARPInfo[killerid][warID] == w)
			{
			    new globalstring[144];
				WARPInfo[killerid][warKills]++;
			   	WARPInfo[playerid][warDeaths]++;
				if(WARPInfo[playerid][warTeam][0] == true && WARPInfo[killerid][warTeam][0] == true)
				{
					WARInfo[w][warTeamScore][0] -= 2;
                    format(globalstring, sizeof(globalstring), ""COL_LRED"War Info | "COL_W"%s(Tim 1) je ubio svog saigraca %s(Tim 1) pa je njegov tim izgubio 2 poena.", GetName(killerid), GetName(playerid));
					WARMessage(w, -1, globalstring);
			        SetWarStatsTD(w);
				}
				if(WARPInfo[playerid][warTeam][1] == true && WARPInfo[killerid][warTeam][1] == true)
				{
					WARInfo[w][warTeamScore][1] -= 2;
			        format( globalstring, sizeof( globalstring ), ""COL_LRED"War Info | "COL_W"%s(Tim 2) je ubio svog saigraca %s(Tim 2) pa je njegov tim izgubio 2 poena.", GetName(killerid), GetName(playerid));
			        WARMessage(w, -1, globalstring);
			        SetWarStatsTD(w);
				}
				if(WARPInfo[killerid][warTeam][0] == true && WARPInfo[playerid][warTeam][1] == true)
				{
			        WARInfo[w][warTeamScore][0]++;
		           	format(globalstring, sizeof(globalstring), ""COL_HS"War Info | "COL_W"%s(Tim 1) je ubio protivnika %s.", GetName(killerid), GetName(playerid));
					WARMessage(w, -1, globalstring);
			        SetWarStatsTD(w);
				}
				if(WARPInfo[killerid][warTeam][1] == true && WARPInfo[playerid][warTeam][0] == true)
				{
			        WARInfo[w][warTeamScore][1]++;
                    format(globalstring, sizeof(globalstring), ""COL_HS"War Info | "COL_W"%s(Tim 2) je ubio protivnika %s.", GetName(killerid), GetName(playerid));
					WARMessage(w, -1, globalstring);
			        SetWarStatsTD(w);
				}
			}
		}
	}
	//
	if(killerid == IPI) { PlayerInfo[playerid][pDeaths]++; Igrac_Spawnovan[playerid] = false; }
    //
    if(AC[0][acFakeKill] == 1)
	{
 		new time = gettime();
	    switch(time - LastDeath{playerid})
	    {
	        case 0..3:
	        {
	            DeathSpam{playerid}++;
	            if(DeathSpam{playerid} > 2)
	            {
	                ACBan(playerid, "FakeKill");
	                return true;
	            }
	        }
	        default: DeathSpam{playerid} = 0;
	    }
	    LastDeath{playerid} = time;
	}
    new form[200];
   	new th, tm, ts, ty, tm1, td;
   	gettime(th, tm, ts);
   	getdate(ty, tm1, td);
   	if(killerid == IPI) { format(form, 200, "[%d/%d/%d].[%d:%d:%d] | %s je umro!", td, tm1, ty, th, tm, ts, GetNameEx(playerid)); }
	else { format(form, 200, "[%d/%d/%d].[%d:%d:%d] | %s je umro, ubio ga je %s!", td, tm1, ty, th, tm, ts, GetNameEx(playerid), GetNameEx(killerid)); }
	DeathLog(form);
	if(killerid != IPI) { if(playerid != IPI) { if(damagedply[playerid] != killerid) { return true; } } }
    SetPVarInt(playerid, "NaKameri", 0);
	Crko[playerid] = 1;
    if(PolicajacNaDuznosti[playerid] == 1) { PolicajacNaDuznosti[playerid] = 0; BojaIgraca(playerid); }
	DronCooldown[playerid] = 0;
	SetPVarInt(playerid, "Letis", 0);
	Ranjen[playerid] = 0;
    VuciX[playerid] = 0.0;
	VuciY[playerid] = 0.0;
	VuciZ[playerid] = 0.0;
	UVozilu[playerid] = 0;
	GetPlayerPos(playerid, X_C, Y_C, Z_C);
	ACPosX[playerid] = X_C;
	ACPosY[playerid] = Y_C;
	ACPosZ[playerid] = Z_C;
	StopFly(playerid);
    Tazerica[playerid] = 0;
	Tie[playerid] = 0;
    ASPolaze[playerid] = 0;
    DisablePlayerRaceCheckpoint(playerid);
    Zavezan[playerid] = 0;
    Tazovan[playerid] = 0;
    Tie[playerid] = 0;
	AtmD[playerid] = 9999;
	PogrCP[playerid] = 0;
	PljackaVreme[playerid] = 0;
 	Pljackas[playerid] = 0;
	RudKopa[playerid] = 0;
	illPokosenaTrava[playerid] = 0;
    illKrenuoKosenje[playerid] = false;
	Kamion[playerid] = 0;
	KamRadi[playerid] = 0;
	RibarRadi[playerid] = 0;
	RibarCP[playerid] = 0;
	BusRadi[playerid] = 0;
	PilotRadi[playerid] = 0;
    SvercMafija[playerid] = 0;
	KillTimer(BeziTimer[playerid]);
    if(WARPInfo[playerid][warID] == -1) Bolki[playerid] = 1;
    Umro[playerid] = 1;
 	KillTimer(DragTimer[playerid]);
	DragTimer[playerid] = 0;
 	//
	if(MDC[playerid] == 1)
	{
		for(new mdc_td = 0; mdc_td < 50; mdc_td++) PlayerTextDrawHide(playerid, MDC_TD[playerid][mdc_td]);
		CancelSelectTextDraw(playerid);
		MDC[playerid] = 0;
	}
	//
    if(killerid != IPI)
	{
	    if(WARPInfo[playerid][warID] == -1)
	    {
		    new kllstring[256];
		    format(kllstring, 256, "Death Info | [%d]%s je ubio graÄ'anina [%d]%s!", killerid, GetName(killerid), playerid, GetName(playerid));
		    PAdm(CRVENA, kllstring, 1);
	    }
	}
	//
	if(killerid == IPI)
	{
 		if(WARPInfo[playerid][warID] == -1)
	    {
		    new text[30];
		    if(reason == 51) text = "Explosion";
		    else if(reason == 53) text = "Drowned";
		    else if(reason == 54) text = "Collision";
		    else text = "Death";
		    new kllstring[256];
		    format(kllstring, 256, "Death Info | '%s'(%d) je umro zbog: %s", GetName(playerid), playerid, text);
		    PAdm(CRVENA, kllstring, 1);
	    }
	}
	//
	if(killerid == IPI)
	{
	    if(PlayerInfo[playerid][pWanted] > 0 && WARPInfo[playerid][warID] == -1)
     	{
     	    if(PlayerInfo[playerid][pJailed] == 0)
     	    {
	      		new str[256];
	    		new izgnovac = PlayerInfo[playerid][pWanted]*1500;
				SCMF(playerid, -1, ""COL_A"[SAMOUBISTVO] "COL_W"Izvrsili ste samoubistvo sa '%d' WL i izgubili ste $%d!", PlayerInfo[playerid][pWanted], izgnovac);
				PlayerInfo[playerid][pWanted] = 0;
				m_SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
				m_GivePlayerMoney(playerid, -izgnovac);
				format(str, 256, "[Central Dispatch] Osoba '%s' je izvrsila samoubistvo i izgubila je $%d.", GetName(playerid), izgnovac);
	    		SendFamilyMessage(1, PDPLAVA, str);
	    		SendFamilyMessage(2, PDPLAVA, str);
			   	format(str, 256, "[Central Dispatch](A): Osoba '%s' je izvrsila samoubistvo i izgubila je $%d.", GetName(playerid), izgnovac);
			    ACD(PDPLAVA, str, 1);
			}
		}
	}
	//
	if(killerid != IPI)
	{
		if(!IsACop(killerid) && PlayerInfo[killerid][pAdmin] < 1)
	    {
	        if(WARPInfo[killerid][warID] == -1)
		    {
		        if(PlayerInfo[killerid][pJailed] == 0)
   				{
					PlayerInfo[killerid][pWanted] += 3;
				   	PocinioZlocin(killerid, 255, "Prvostepeno ubistvo");
				   	m_SetPlayerWantedLevel(killerid, PlayerInfo[killerid][pWanted]);
				}
			}
		}
	    if(IsACop(killerid))
	    {
	        if(Arrestk[playerid] == 0)
	        {
	            if(PolicajacNaDuznosti[killerid] == 1)
	            {
				    new str[256];
				    if(PlayerInfo[playerid][pWanted] < 1)
				    {
					    format(str, 256, "[Central Dispatch] Policajac '%s' je ubio graÄ'anina '%s'.", GetName(killerid), GetName(playerid));
					    SendFamilyMessage(1, PDPLAVA, str);
					    SendFamilyMessage(2, PDPLAVA, str);
					    format(str, 256, "[Central Dispatch](A): Policajac '%s' je ubio graÄ'anina '%s'.", GetName(killerid), GetName(playerid));
					    ACD(PDPLAVA, str, 1);
					}
				    else if(PlayerInfo[playerid][pWanted] > 0)
				    {
				        new lova = PlayerInfo[playerid][pWanted]*1000;
						SCMF(playerid, -1, ""COL_A"[UBISTVO] "COL_W"Policajac '%s' vas je ubio sa '%d' WL i izgubili ste $%d.", GetName(killerid), PlayerInfo[playerid][pWanted], lova);
						PlayerInfo[playerid][pWanted] = 0;
						m_SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
						m_GivePlayerMoney(playerid, -lova);
						format(str, 256, "[Central Dispatch] Policajac '%s' je ubio graÄ'anina '%s', koji je zbog smrti izgubio $%d.", GetName(killerid), GetName(playerid), lova);
					    SendFamilyMessage(1, PDPLAVA, str);
					    SendFamilyMessage(2, PDPLAVA, str);
					    format(str, 256, "[Central Dispatch](A): Policajac '%s' je ubio graÄ'anina '%s', koji je zbog smrti izgubio $%d.", GetName(killerid), GetName(playerid), lova);
					    ACD(PDPLAVA, str, 1);
					    SCMF(killerid, -1, ""COL_A"[UBISTVO] "COL_W"Ubili ste kriminalca '%s'.", GetName(playerid));
				    }
				}
			}
	    }
	}
    //
	if(WARPInfo[playerid][warID] == -1 && StreljanaP[playerid] < 1 && !IsACop(playerid) && GetPVarInt(playerid, "UsaoInterior") < 1)
	{
	    if(killerid != IPI)
	    {
	        if(playerid != IPI)
	        {
			    GetPlayerPos(playerid, X_C, Y_C, Z_C);
				if(GetPlayerWeapon(playerid) != 0) DropGun(playerid, GetPlayerWeapon(playerid), GetPlayerAmmo(playerid), X_C, Y_C, Z_C, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
				if(PlayerInfo[playerid][pJailed] < 1)
            	{
			    	if(m_GetPlayerMoney(playerid) > 9999)
			    	{
			    	    if(PlayerInfo[playerid][pLevel] > 4)
			    	    {
							if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pGm] < 1)
							{
				    	        if(PlayerInfo[playerid][pNovcanik] < 1)
				    	        {
					    	    	new novac = m_GetPlayerMoney(playerid)/100;
					    	    	m_GivePlayerMoney(playerid, -novac);
					    	    	DropMoney(playerid, novac, X_C, Y_C, Z_C, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
					    	    	SCMF(playerid, -1, "{F81414}[DEATH] "COL_W"Ispalo vam je $%d zbog smrti!", novac);
								}
								else
								{
									PlayerInfo[playerid][pNovcanik]--;
									SCM(playerid, -1, "{F81414}[DEATH] "COL_W"Izgubio si jedan novcanik umesto da si izgubio novac zbog smrti!");
								}
							}
						}
			    	}
				}
		    	PlayerInfo[playerid][pInvWeapon] = 0;
		    	PlayerInfo[playerid][pInvWeapon1] = 0;
		    	PlayerInfo[playerid][pInvWeapon2] = 0;
		    	PlayerInfo[playerid][pInvAmmo] = 0;
		    	PlayerInfo[playerid][pInvAmmo1] = 0;
		    	PlayerInfo[playerid][pInvAmmo2] = 0;
			}
		}
	}
    //
	if(PlayerInfo[playerid][pGlad] > 84) PlayerInfo[playerid][pGlad] = 85;
	else PlayerInfo[playerid][pGlad] = 0;
    //
	if(PlayerInfo[playerid][pWC] > 84) PlayerInfo[playerid][pWC] = 85;
	else PlayerInfo[playerid][pWC] = 0;
    //
 	if(WARPInfo[playerid][warID] == -1 && UDMZoni[playerid] == false)
 	{
		if(PlayerInfo[playerid][pMentalState] > 84) PlayerInfo[playerid][pMentalState] = 85;
		else PlayerInfo[playerid][pMentalState] = 0;
	}
    //
    if(WARPInfo[killerid][warID] == -1 && UDMZoni[killerid] == false)
    {
  		if(PlayerInfo[killerid][pMentalState] < 100) PlayerInfo[killerid][pMentalState]++;
		else if(PlayerInfo[killerid][pMentalState] > 99) PlayerInfo[killerid][pMentalState] = 100;
		/*if(MentalStateUbistvo[killerid] == 0)
		{
			SetTimerEx("MentalStateUbistvoVAR", 60000, false, "d", killerid);
			MentalStateUbistvo[killerid]++;
		}
		else if(MentalStateUbistvo[killerid] > 0)
		{
		    MentalStateUbistvo[killerid]++;
		    MentalStateUbio[killerid]++;
		    SCM(killerid, -1, ""COL_A"[MENTAL STATE] "COL_W"Pocinili ste ubistvo, psihicko stanje vam se trenutno ne poboljsava.");
		}*/
	}
    //
    m_ResetPlayerWeapons(playerid);
	DisablePlayerCheckpoint(playerid);
	DisablePlayerRaceCheckpoint(playerid);
    //
	killerid = IPI;
	return true;
}

Ako jos uvek nisi fix stavi sve sto ti ne treba u OnPlayerDeath pod komentar i vidi jel radi ako radi polako ubacujes dio po dio..