Pomoc kada umrem

Započeo Hadžaga, Novembar 17, 2018, 16:04:51 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Kada umrem,iskoristim komandu kill ili me neko ubije ovako stoji .. Freez se igrac hp treperi i nece da se respawnuje i kada iskoristim slap komandu onda se respawnuje
Dio skripte:
Ne znam sta da posaljem

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
[debug] Run time error 4: "Array index out of bounds"
[16:00:48] [debug]  Attempted to read/write array element at index 65535 in array of size 1000
[16:00:48] [debug] AMX backtrace:
[16:00:48] [debug] #0 00027390 in ?? (0, 65535, 54) from mod.amx
[16:00:48] [debug] #1 000062c4 in public OnPlayerDeath (0, 65535, 54) from mod.amx

Slika/video ingame problema(obavezno ako je ingame problem): https://postimg.cc/QKbnsJyL


YCMD:akill(playerid,params[],help)
{
	new targetid,str[82],str2[128],razlog[82];
	if(PlayerInfo[playerid][pAdmin] < 1 ) return SCM(playerid,-1,""col_larp"[E:DM]"col_tzuta"Nemas ovlascenje da koristis ovu komandu");
	if(!IsPlayerAdmin(playerid)) return SCM(playerid,-1,""col_larp"[Greska]:"col_crvena"Moras Biti Rcon Ulogovan da bi koritio komandu!");
	if(sscanf(params,"us[82]",targetid,razlog)) return SCM(playerid,-1,""col_larp"[E:DM]"col_tzuta"Koristi : /akill [ID] [Razlog]");
	if(duelinfo[targetid][induel] == 1 ) return SCM(playerid,-1,""col_tzuta"[E:DM]"col_bijela"Ne mozes koristiti komandu ako si u duelu!");
	if(!IsPlayerConnected(targetid)) return SCM(playerid,-1,""col_larp"[E:DM]"col_tzuta"Igrac nije ulogovan!");
	format(str,sizeof(str),"Ubili ste igraca %s",GetName(targetid));
 	SCM(targetid,-1,""col_larp"[E:DM]"col_tzuta"Ubijen si od strane admina!");
 	SCM(playerid,-1,str);
	SetPlayerHealth(targetid,0);
	format(str2,sizeof(str2),"Admin %s je ubio igraca %s.Razlog: %s",GetName(playerid),GetName(targetid),razlog);
	Adminima3(-1,str2);
	return 1;
}


Ali nije bitna komanda i kad me neko drugi ubije ili bacim se pa umrem isto bude ...


Posalji sta ti je pod onplayerdeath


I LOVE VODKA AND SLAV COUNTRY'S

public OnPlayerDeath(playerid, killerid, reason)
{
	GetPlayerSkin(playerid);	SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
	new level;
	SendDeathMessage(killerid, playerid, reason);
	PlayerInfo[killerid][pKills] ++;	PlayerInfo[playerid][pDeaths] ++;
	trenutnokills[killerid] ++;			trenutnodeaths[playerid] ++;
	SetPlayerScore(killerid, GetPlayerScore(killerid)+1);	level = GetPlayerScore(killerid);	PlayerInfo[killerid][pLevel] = level;
	PlayerInfo[playerid][pCash] -= 100;     PlayerInfo[killerid][pCash] += 100;
	GivePlayerMoney(playerid, -100);        GivePlayerMoney(killerid, 100);
	Streak[playerid] = 0;	Streak[killerid]++;
	switch(Streak[killerid])
		{
		    case 1: SCMF(killerid,-1,""col_larp"[E:DM]"col_tzuta"Ubili ste igraca %s",GetName(playerid));
		    case 2: SCMF(killerid,-1,""col_larp"[E:DM]"col_tzuta"Ubili ste igraca %s - Double Kill !!",GetName(playerid));
		    case 3: SCMF(killerid,-1,""col_larp"[E:DM]"col_tzuta"Ubili ste igraca %s - Triple Kill !!",GetName(playerid));
		   	case 4: SCMF(killerid,-1,""col_larp"[E:DM]"col_tzuta"Ubili ste igraca %s - Quadra Kill !!",GetName(playerid));
		    case 5: SCMF(killerid,-1,""col_larp"[E:DM]"col_tzuta"Ubili ste igraca %s - PentaKill  !!",GetName(playerid));
		    case 10: SCMF(killerid,-1,""col_larp"[E:DM]"col_tzuta"Ubili ste igraca %s - Odmori malo tebro 10Killstreak .. !!",GetName(playerid));
  		}
	if(duelinfo[killerid][induel] == 1)
        {
            duelinfo[killerid][induel] = 0;
            duelinfo[playerid][induel] = 0;
            new string[128];
            format(string, sizeof(string), ""RED"[DUEL] "WHITE"%s je pobijedio igraca %s u duelu", GetName(killerid), GetName(playerid));
            SendClientMessageToAll(-1, string);
            SetPlayerScore(killerid, GetPlayerScore(killerid) + 2);
            duelinfo[killerid][dKills] ++;
  		    duelinfo[playerid][dDeaths] ++;
            SpawnIgraca( killerid, 1728.4497,-1668.5601,22.6094,38.7926,0,0);
            SpawnIgraca( playerid, 1728.4497,-1668.5601,22.6094,38.7926,0,0);
            invite[playerid] = 0;
            invite[killerid] = 0;
		}
 	return 1;
}



I recimo ovo dole u OnPlayerDeath ako je igrac u Duelu sve radi kako treba,kada igrac umre spawnuje ga u Lobbyu i nema nikakvih problema ..

Vidim dosta gresaka, al evo da probam da ti obj... killerid je igrac koji je ubio playerida
Ako ga niko nije ubio, sto znaci da je umro od komande, pada, nzm ni ja sta drugo, onda ne mozes killeridu da dajes wl, dodajes killove itd..
if(killerid != INVALID_PLAYER_ID), time proveravas da li je killerid igrac.
A kolko ja ovde vidim, nigde nemas tu proveru, i debugove ti izbacuje bas zbog toga.

Ne mogu da vjerujem
if(killerid != INVALID_PLAYER_ID)
{
  .....
...
return 1;
}
mi pravilo problem XD XD Hvala ti puno brate puno puno <3 <3