death
#1

all code in onplayerdeath not works.who can help me?

Код:
public OnPlayerDeath(playerid,killerid,reason){
	new dname[MAX_PLAYER_NAME],kname[MAX_PLAYER_NAME],str[128];
	SendDeathMessage(killerid,playerid,reason);
	GetPlayerName(playerid,dname,MAX_PLAYER_NAME);
	GetPlayerName(killerid,kname,MAX_PLAYER_NAME);
    GetPlayerPos(playerid,Bodyx[playerid],Bodyy[playerid],Bodyz[playerid]);
    SetTimerEx("RemoveBodyPos",4000,false,"i",playerid);
    hshield[playerid]=false;
	lshield[playerid]=false;
	SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
	PlayerInfo[killerid][pScore]++;
	PlayerInfo[killerid][pKill]++;
	PlayerInfo[killerid][pKillSpree]++;
	PlayerInfo[killerid][pRatio]=PlayerInfo[killerid][pKill]/PlayerInfo[killerid][pDeath];
	format(str,sizeof(str),"~g~Kills:~w~%d-~r~Deaths:~w~%d",PlayerInfo[killerid][pKill],PlayerInfo[killerid][pDeath]);
	TextDrawSetString(info2[playerid],str);
	SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
	PlayerInfo[playerid][pScore]++;
	PlayerInfo[playerid][pDeath]++;
	PlayerInfo[playerid][pRatio]=PlayerInfo[playerid][pKill]/PlayerInfo[playerid][pDeath];
	format(str,sizeof(str),"You have been killed by %s(%d).",kname,killerid);
	SendClientMessage(playerid,COLOR_RED,str);
	SendClientMessage(playerid,COLOR_RED,"You lost 1000$ for dying.");
	GivePlayerMoney(playerid,-1000);
	PlayerInfo[playerid][pMoney]-=1000;
	format(str,sizeof(str),"~g~Kills:~w~%d-~r~Deaths:~w~%d",PlayerInfo[playerid][pKill],PlayerInfo[playerid][pDeath]);
	TextDrawSetString(info2[playerid],str);
	SendSpreeMassage(playerid,kname);
	format(str,sizeof(str),"%s(%d) has ended %s(%d)'s kill spree of %i",kname,killerid,dname,playerid,PlayerInfo[playerid][pKillSpree]);
	if(PlayerInfo[playerid][pKillSpree]>0)SendClientMessageToAll(COLOR_ORANGE,str);
	PlayerInfo[playerid][pKillSpree]=0;
	new kurl[120];
		switch(random(8)){
		    case 0: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-beautiful-01.mp3";
		    case 1: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-sloppy-01.mp3";
		    case 2: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-goodnight-01.mp3";
		    case 3: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-hesdown-01.mp3";
		    case 4: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-neutralized-01.mp3";
		    case 5: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-noisy-01.mp3";
		    case 6: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-perfect-01.mp3";
		    case 7: kurl="http://vip.opload.ir/vipdl/94/11/arefkhan/so-hid-ghil-tango-down-01.mp3";}
		PlayAudioStreamForPlayer(killerid,kurl,0.0,0.0,0.0,0.0,0);
    new durl[120];
		switch(random(2)){
		    case 0: durl="http://vip.opload.ir/vipdl/94/11/arefkhan/deadms1.mp3";
		    case 1: durl="http://vip.opload.ir/vipdl/94/11/arefkhan/deadms2.mp3";}
		PlayAudioStreamForPlayer(playerid,durl,0.0,0.0,0.0,0.0,0);
    if(IsBeingSpeced[playerid]==true){
	    foreach(Player,i){
	    	if(Spectatorid[i]==playerid){
				TogglePlayerSpectating(i,false);}}}
	return 1;}
Reply


Messages In This Thread
death - by GeneralAref - 06.02.2016, 15:17
Re: death - by Vince - 06.02.2016, 16:16
Re: death - by GeneralAref - 07.02.2016, 17:23
Re: death - by Klimaxer - 08.02.2016, 04:13
Re: death - by itsCody - 08.02.2016, 04:20
Re: death - by GeneralAref - 08.02.2016, 17:53
Re: death - by Sascha - 08.02.2016, 18:01
Re: death - by GeneralAref - 08.02.2016, 18:24
Re: death - by amirm3hdi - 08.02.2016, 19:24
Re: death - by ikey07 - 08.02.2016, 19:29

Forum Jump:


Users browsing this thread: 1 Guest(s)