OnPlayerDeath Glitch (+rep)
#1

Код:
../gamemodes/OnDeath.pwn(133) : warning 209: function "OnPlayerDeath" should return a value
../gamemodes/OnDeath.pwn(134) : error 010: invalid function or declaration
../gamemodes/OnDeath.pwn(138) : error 054: unmatched closing brace ("}")
../gamemodes/OnDeath.pwn(139) : error 010: invalid function or declaration
Код:
//============================================//
//=================[ Death ]==================//
//============================================//
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPVarInt(playerid, "Delay", GetCount()+5000);
    new string[128],sendername[MAX_PLAYER_NAME],Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    DeletePVar(playerid,"CrackTime"), DeletePVar(playerid,"Wound");
    DeletePVar(playerid,"RamHouse"), DeletePVar(playerid,"RamVehicle");
    DeletePVar(playerid,"Bomb");
    if(GetPVarInt(playerid,"HavingBall") != 0) Baller = 999, SetPlayerWorldBounds(playerid, 4507.66, -2989.536, 2989.536, -4274.103), DeletePVar(playerid,"HavingBall"), DeletePVar(playerid,"BallAnim");
    if(GetPVarInt(playerid, "Tut") == 0)
    {
        if(IsPlayerConnected(killerid))
		{
        	format(string, sizeof(string), "KILL: %s has killed %s with a %s in the tutorial area.", PlayerName(killerid), PlayerName(playerid), GunNames[reason]);
	    	SendAdminMessage(0xAA3333AA,string);
	    	KillLog(string);
		}
		return 1;
    }
    if(GetPVarInt(playerid, "Mobile") != 501)
    {
        if(IsPlayerConnected(GetPVarInt(playerid, "Mobile")) && GetPVarInt(GetPVarInt(playerid, "Mobile"), "Mobile") == playerid)
        {
		    SendClientMessage(GetPVarInt(playerid, "Mobile"),COLOR_GREY,"The phone line went dead...");
		    if(GetPlayerSpecialAction(GetPVarInt(playerid, "Mobile")) == SPECIAL_ACTION_USECELLPHONE) SetPlayerSpecialAction(GetPVarInt(playerid, "Mobile"), SPECIAL_ACTION_STOPUSECELLPHONE);
            SetPVarInt(GetPVarInt(playerid, "Mobile"), "Mobile", 501);
		}
        SetPVarInt(playerid, "Mobile", 501);
    }
    SetPVarInt(playerid, "Drag", 501); DeletePVar(playerid,"RamHouse"); DeletePVar(playerid,"RamHouseID");
    if(GetPVarInt(playerid, "AFK") == 1)
    {
        format(string, sizeof(string), "AdmCmd: %s was admin jailed by Admin Project-Bot Reason:[Deathmatch].", PlayerName(killerid));
		SendClientMessageToAll(COLOR_LIGHTRED, string);
		SetPVarInt(killerid, "Jailed", 2);
		SetPVarInt(killerid, "JailTime", 60*60);
		strmid(PlayerInfo[killerid][pJailReason], "Deathmatch", 0, strlen("Deathmatch"), 255);
		SendClientMessage(killerid, COLOR_WHITE, "You are jailed for 60 minutes.");
		SetPlayerPos(killerid,2523.9197,-1673.8944,14.8589);
        TogglePlayerControllableEx(killerid, false);
        SetPlayerInterior(killerid, 0);
        SetPlayerVirtualWorld(killerid, killerid);
        SetPVarInt(killerid, "Jails", GetPVarInt(killerid, "Jails")+1);
        SetPVarInt(killerid, "Mute", 1);
        return 1;
    }
    if(killerid != 501)
	{
		if(IsPlayerConnected(killerid))
		{
        	format(string, sizeof(string), "KILL: %s has killed %s with a %s.", PlayerName(killerid), PlayerName(playerid), GunNames[reason]);
	    	SendAdminMessage(0xAA3333AA,string); //printf(string);
			if(GetPVarInt(killerid, "IntEnter") != 1000 && GetPlayerInterior(killerid) == IntInfo[GetPVarInt(killerid, "IntEnter")][iInt] || GetPVarInt(killerid, "Int") != 90 && GetPVarInt(killerid, "World") != 1)
			{
				switch(IntInfo[GetPVarInt(killerid, "IntEnter")][iType])
				{
					case CHECKPOINT_STORE, CHECKPOINT_BAR, CHECKPOINT_REST, CHECKPOINT_BANK, CHECKPOINT_CLUCK, CHECKPOINT_PIZZA, CHECKPOINT_BURGER:
					{
						if(reason >= 0 && reason <= 34)
						{
							switch(reason)
							{
								case 0 .. 8, 10 .. 15:
								{
								format(string, sizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a assault recorded from a CCTV camera.", PlayerNameEx(killerid));
								SendFactionMessage(7, COLOR_BLUE, string);
								format(string, sizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
							    SendFactionMessage(7, COLOR_BLUE, string);
								}
				               		case 22 .. 34:
               						{
                    				format(string, sizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a shooting recorded from a CCTV camera.", PlayerNameEx(killerid));
                    				SendFactionMessage(7, COLOR_BLUE, string);
   									format(string, sizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
           							SendFactionMessage(7, COLOR_BLUE, string);
				                	}
				            	}
				        	}
				    	}
					}
					if(GetPVarInt(killerid, "BizzEnter") != 1000 && GetPlayerInterior(killerid) == BizzInfo[GetPVarInt(killerid, "BizzEnter")][bInterior] || GetPVarInt(killerid, "Int") != 90 && GetPVarInt(killerid, "World") != 1)
					{
				    	switch(BizzInfo[GetPVarInt(killerid, "BizzEnter")][bType])
				    	{
				        	case CHECKPOINT_STORE, CHECKPOINT_BAR, CHECKPOINT_REST, CHECKPOINT_BANK, CHECKPOINT_CLUCK, CHECKPOINT_PIZZA, CHECKPOINT_BURGER:
				        	{
				            	if(reason >= 0 && reason <= 34)
				            	{
				                	switch(reason)
				                	{
				                    	case 0 .. 8, 10 .. 15:
				                    	{
				                        	format(string, sizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a assault recorded from a CCTV camera.", PlayerNameEx(killerid));
				                        	SendFactionMessage(7, COLOR_BLUE, string);
							            	format(string, sizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
							            	SendFactionMessage(7, COLOR_BLUE, string);
				                    	}
				                    	case 22 .. 34:
				                    	{
				                        	format(string, sizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a shooting recorded from a CCTV camera.", PlayerNameEx(killerid));
				                        	SendFactionMessage(7, COLOR_BLUE, string);
							            	format(string, sizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
							            	SendFactionMessage(7, COLOR_BLUE, string);
				                    	}
				                	}
				            	}
				        	}
				    	}
					}
	    		}
	    	}
	    	if(GetPVarInt(killerid, "Member") == 8 && GetPVarInt(playerid, "Contract") > 0)
	    	{
	    	    format(string, sizeof(string), "HITMAN: %s has fofilled the contract on %s worth $%d.", PlayerName(killerid), PlayerName(playerid), GetPVarInt(playerid, "Contract"));
	    	    SendFactionMessage(8,COLOR_LIGHTBLUE,string);
	    	    SetPVarInt(killerid, "Bank", GetPVarInt(killerid, "Bank")+GetPVarInt(playerid, "Contract"));
	    	    format(string, sizeof(string), "HITMAN: $%d has been wire-transferd to your account.", GetPVarInt(playerid, "Contract"));
	    	    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    	    SetPVarInt(playerid, "Contract", 0);
	    	}
	    	if(strcmp(PlayerInfo[killerid][pTaunt], "None", true) == 0) {}
	    	else
	    	{
	    	    format(sendername, sizeof(sendername), "%s", PlayerNameEx(killerid));
		        GiveNameSpace(sendername);
    	        format(string, sizeof(string), "%s shouts: %s!", sendername, PlayerInfo[killerid][pTaunt]);
    	        ProxDetector(50.0, killerid, string, COLOR_FADE);
	    	}
		}
	}
	if(GetPVarInt(playerid, "Jailed") == 0)
	{
	    SetPVarInt(playerid, "Dead", 1);
    	OnPlayerDataSave(playerid);
    	SetPVarInt(playerid, "Checkpoint", CHECKPOINT_NONE);
    }
	return 1;
}
//============================================//
Reply
#2

Which are the lines from 130 to 140.. Looks like a missing bracket
Reply
#3

Try this o.o
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
SetPVarInt(playerid"Delay"GetCount()+5000);
    new 
string[128],sendername[MAX_PLAYER_NAME],Float:X,Float:Y,Float:Z;
    
GetPlayerPos(playerid,X,Y,Z);
    
DeletePVar(playerid,"CrackTime"), DeletePVar(playerid,"Wound");
    
DeletePVar(playerid,"RamHouse"), DeletePVar(playerid,"RamVehicle");
    
DeletePVar(playerid,"Bomb");
    if(
GetPVarInt(playerid,"HavingBall") != 0Baller 999SetPlayerWorldBounds(playerid4507.66, -2989.5362989.536, -4274.103), DeletePVar(playerid,"HavingBall"), DeletePVar(playerid,"BallAnim");
    if(
GetPVarInt(playerid"Tut") == 0)
    {
        if(
IsPlayerConnected(killerid))
        {
            
format(stringsizeof(string), "KILL: %s has killed %s with a %s in the tutorial area."PlayerName(killerid), PlayerName(playerid), GunNames[reason]);
            
SendAdminMessage(0xAA3333AA,string);
            
KillLog(string);
        }
        return 
1;
    }
    if(
GetPVarInt(playerid"Mobile") != 501)
    {
        if(
IsPlayerConnected(GetPVarInt(playerid"Mobile")) && GetPVarInt(GetPVarInt(playerid"Mobile"), "Mobile") == playerid)
        {
            
SendClientMessage(GetPVarInt(playerid"Mobile"),COLOR_GREY,"The phone line went dead...");
            if(
GetPlayerSpecialAction(GetPVarInt(playerid"Mobile")) == SPECIAL_ACTION_USECELLPHONESetPlayerSpecialAction(GetPVarInt(playerid"Mobile"), SPECIAL_ACTION_STOPUSECELLPHONE);
            
SetPVarInt(GetPVarInt(playerid"Mobile"), "Mobile"501);
        }
        
SetPVarInt(playerid"Mobile"501);
    }
    
SetPVarInt(playerid"Drag"501); DeletePVar(playerid,"RamHouse"); DeletePVar(playerid,"RamHouseID");
    if(
GetPVarInt(playerid"AFK") == 1)
    {
        
format(stringsizeof(string), "AdmCmd: %s was admin jailed by Admin Project-Bot Reason:[Deathmatch]."PlayerName(killerid));
        
SendClientMessageToAll(COLOR_LIGHTREDstring);
        
SetPVarInt(killerid"Jailed"2);
        
SetPVarInt(killerid"JailTime"60*60);
        
strmid(PlayerInfo[killerid][pJailReason], "Deathmatch"0strlen("Deathmatch"), 255);
        
SendClientMessage(killeridCOLOR_WHITE"You are jailed for 60 minutes.");
        
SetPlayerPos(killerid,2523.9197,-1673.8944,14.8589);
        
TogglePlayerControllableEx(killeridfalse);
        
SetPlayerInterior(killerid0);
        
SetPlayerVirtualWorld(killeridkillerid);
        
SetPVarInt(killerid"Jails"GetPVarInt(killerid"Jails")+1);
        
SetPVarInt(killerid"Mute"1);
        return 
1;
    }
    if(
killerid != 501)
    {
        if(
IsPlayerConnected(killerid))
        {
            
format(stringsizeof(string), "KILL: %s has killed %s with a %s."PlayerName(killerid), PlayerName(playerid), GunNames[reason]);
            
SendAdminMessage(0xAA3333AA,string); //printf(string);
            
if(GetPVarInt(killerid"IntEnter") != 1000 && GetPlayerInterior(killerid) == IntInfo[GetPVarInt(killerid"IntEnter")][iInt] || GetPVarInt(killerid"Int") != 90 && GetPVarInt(killerid"World") != 1)
            {
                switch(
IntInfo[GetPVarInt(killerid"IntEnter")][iType])
                {
                    case 
CHECKPOINT_STORECHECKPOINT_BARCHECKPOINT_RESTCHECKPOINT_BANKCHECKPOINT_CLUCKCHECKPOINT_PIZZACHECKPOINT_BURGER:
                    {
                        if(
reason >= && reason <= 34)
                        {
                            switch(
reason)
                            {
                                case 
.. 810 .. 15:
                                {
                                
format(stringsizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a assault recorded from a CCTV camera."PlayerNameEx(killerid));
                                
SendFactionMessage(7COLOR_BLUEstring);
                                
format(stringsizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
                                
SendFactionMessage(7COLOR_BLUEstring);
                                }
                                       case 
22 .. 34:
                                       {
                                    
format(stringsizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a shooting recorded from a CCTV camera."PlayerNameEx(killerid));
                                    
SendFactionMessage(7COLOR_BLUEstring);
                                       
format(stringsizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
                                       
SendFactionMessage(7COLOR_BLUEstring);
                                    }
                                }
                            }
                        }
                    }
                    if(
GetPVarInt(killerid"BizzEnter") != 1000 && GetPlayerInterior(killerid) == BizzInfo[GetPVarInt(killerid"BizzEnter")][bInterior] || GetPVarInt(killerid"Int") != 90 && GetPVarInt(killerid"World") != 1)
                    {
                        switch(
BizzInfo[GetPVarInt(killerid"BizzEnter")][bType])
                        {
                            case 
CHECKPOINT_STORECHECKPOINT_BARCHECKPOINT_RESTCHECKPOINT_BANKCHECKPOINT_CLUCKCHECKPOINT_PIZZACHECKPOINT_BURGER:
                            {
                                if(
reason >= && reason <= 34)
                                {
                                    switch(
reason)
                                    {
                                        case 
.. 810 .. 15:
                                        {
                                            
format(stringsizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a assault recorded from a CCTV camera."PlayerNameEx(killerid));
                                            
SendFactionMessage(7COLOR_BLUEstring);
                                            
format(stringsizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
                                            
SendFactionMessage(7COLOR_BLUEstring);
                                        }
                                        case 
22 .. 34:
                                        {
                                            
format(stringsizeof(string), "HQ: All Units - HQ: (%s Appearance) was involved in a shooting recorded from a CCTV camera."PlayerNameEx(killerid));
                                            
SendFactionMessage(7COLOR_BLUEstring);
                                            
format(stringsizeof(string), "HQ: Location: %s",GetPlayerArea(killerid));
                                            
SendFactionMessage(7COLOR_BLUEstring);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if(
GetPVarInt(killerid"Member") == && GetPVarInt(playerid"Contract") > 0)
            {
                
format(stringsizeof(string), "HITMAN: %s has fofilled the contract on %s worth $%d."PlayerName(killerid), PlayerName(playerid), GetPVarInt(playerid"Contract"));
                
SendFactionMessage(8,COLOR_LIGHTBLUE,string);
                
SetPVarInt(killerid"Bank"GetPVarInt(killerid"Bank")+GetPVarInt(playerid"Contract"));
                
format(stringsizeof(string), "HITMAN: $%d has been wire-transferd to your account."GetPVarInt(playerid"Contract"));
                
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
                
SetPVarInt(playerid"Contract"0);
            }
            if(
strcmp(PlayerInfo[killerid][pTaunt], "None"true) == 0) {}
            else
            {
                
format(sendernamesizeof(sendername), "%s"PlayerNameEx(killerid));
                
GiveNameSpace(sendername);
                
format(stringsizeof(string), "%s shouts: %s!"sendernamePlayerInfo[killerid][pTaunt]);
                
ProxDetector(50.0killeridstringCOLOR_FADE);
            }
        }
    if(
GetPVarInt(playerid"Jailed") == 0)
    {
        
SetPVarInt(playerid"Dead"1);
        
OnPlayerDataSave(playerid);
        
SetPVarInt(playerid"Checkpoint"CHECKPOINT_NONE);
     }
    return 
1;

Reply
#4

Removed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)