Big Problem help PLS
#1

Hi

Can anyone help me.
My full OnPlayerDeath Callback not working, what to do?

Thank You.
Reply
#2

if there are scripts that use OnPlayerDeath and there is return 0; somewhere in the callback change it to return 1;

if not or you still got the same issue show the code
Reply
#3

Show the callback.
Reply
#4

These are the Callback codes:
PHP код:
CALLBACK:OnPlayerDeath(playeridkilleridreason)
{
            
AccInfo[playerid][Spawned] = 0// Set Spawned to 0
            
SendDeathMessage(killeridplayeridreason);
            
GivePlayerMoney(killerid,100);

            new 
msg[128], KillerPlayerName[MAX_PLAYER_NAME], reasonMsg[64], KilledPlayerName[MAX_PLAYER_NAME];
            
GetPlayerName(killeridKillerPlayerNamesizeof(KillerPlayerName));
            
GetPlayerName(playeridKilledPlayerNamesizeof(KilledPlayerName));
          
            
#if WeaponDrop == true
            
DropPlayerWeapons(playerid);
            
#endif
        
if(AccInfo[playerid][Deathmessages] == 1)
            {
            if (
killerid != INVALID_PLAYER_ID)
            {
            switch (
reason)
            {
            case 
0reasonMsg "Hands"/*"Unarmed"*/;
            case 
1reasonMsg "Brass Knuckles";
            case 
2reasonMsg "Golf Club";
            case 
3reasonMsg "Night Stick";
            case 
4reasonMsg "Knife";
            case 
5reasonMsg "Baseball Bat";
            case 
6reasonMsg "Shovel";
            case 
7reasonMsg "Pool Cue";
            case 
8reasonMsg "Katana";
            case 
9reasonMsg "Chainsaw";
            case 
10reasonMsg "Dildo";
            case 
11reasonMsg "Dildo";
            case 
12reasonMsg "Vibrator";
            case 
13reasonMsg "Vibrator";
            case 
14reasonMsg "Flowers";
            case 
15reasonMsg "Cane";
            case 
22reasonMsg "Pistol";
            case 
23reasonMsg "Silenced Pistol";
            case 
24reasonMsg "Desert Eagle";
            case 
25reasonMsg "Shotgun";
            case 
26reasonMsg "Sawn-off Shotgun";
            case 
27reasonMsg "Combat Shotgun";
            case 
28reasonMsg "MAC-10";
            case 
29reasonMsg "MP5";
            case 
30reasonMsg "AK-47";
            case 
31reasonMsg "M4";
            case 
32reasonMsg "TEC-9";
            case 
33reasonMsg "Country Rifle";
            case 
34reasonMsg "Sniper Rifle";
            case 
37reasonMsg "Fire";
            case 
38reasonMsg "Minigun";
            case 
41reasonMsg "Spray Can";
            case 
42reasonMsg "Fire Extinguisher";
            }
            
format(msg,sizeof(msg),"%s (%d) used %s to kill %s (%d) from %.0f metres."KillerPlayerNamekilleridreasonMsgKilledPlayerNameplayeridDistanceBetweenPlayers);
            
SendClientMessageToAll(brownmsg);
            }
        }

    
#if USE_STATS == true
    
AccInfo[playerid][Deaths]++;
    
#endif
    
InDuel[playerid] = 0;

    if(
AccInfo[playerid][pCaged] == 1)
    {
       
cage[playerid]     = DestroyObject(cage[playerid]);
    
cage2[playerid] = DestroyObject(cage2[playerid]);
    
cage3[playerid] = DestroyObject(cage3[playerid]);
    
cage4[playerid] = DestroyObject(cage4[playerid]);
    }

    
/*----------------------FOR ASSIST IN KILLING-----------------------------*/
    
for(new 0MAX_PLAYERSi++)
    {
       if(
!= INVALID_PLAYER_ID && killerid != INVALID_PLAYER_ID)
       {
          
             if(
assistkill[i] != playerid && assist[i] >= 70)
             {
             new 
string[300];
             
format(stringsizeof(string), ">>"COL_YELLOW"[ASSIST]"COL_ORANGE" You have assisted %s (%d) in killing %s (%d)."COL_YELLOW"Damage Taken: %.2f"PlayerName2(killerid), killeridPlayerName2(playerid), playeridassist[i]);
                
SendClientMessage(assistkill[i], -1string);
             
assistkill[i] = INVALID_PLAYER_ID;
               
assist[i] = 0;
              if(
assistkill[i] != playerid && assist[i] >= 80)
             {
                
SendClientMessage(assistkill[i], -1""COL_ORANGE"• You have recieved $100.");
             }
             
AccInfo[playerid][TotalAssists]++;
             
          }
       }
    }
    
/*------------------------------------------------------------------------*/
    
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
    {
        
#if USE_STATS == true
        
AccInfo[killerid][Kills]++;
        
#endif
//==============================================================================
// In Duel
//==============================================================================
        
if(InDuel[playerid] == && InDuel[killerid] == 1)
        {
        
GameTextForPlayer(playerid,"Loser!",3000,3);
        
GameTextForPlayer(killerid,"Winner!",3000,3);
        
InDuel[killerid] = 0;
        
SetPlayerPos(killerid0.00.00.0);
        
SpawnPlayer(killerid);
        }
        else if(
InDuel[playerid] == && InDuel[killerid] == 0)
        {
        
GameTextForPlayer(playerid,"Loser !",3000,3);
        }
    }
//==============================================================================
// Spectate
//==============================================================================
    
for(new x=0x<MAX_PLAYERSx++)
    if(
GetPlayerState(x) == PLAYER_STATE_SPECTATING && AccInfo[x][SpecID] == playerid)
    
AdvanceSpectate(x);
    return 
1;

Reply
#5

anyone help pls. :/
Reply
#6

Show,
PHP код:
 #define CALLBACK: ... 
and use public OnPlayerDeath and see if it fixes.
Reply
#7

Quote:
Originally Posted by Lokii
Посмотреть сообщение
if there are scripts that use OnPlayerDeath and there is return 0; somewhere in the callback change it to return 1;

if not or you still got the same issue show the code
If there are filterscripts that return 0, then gamemodes OnPlayerDeath is likely to not be called.


Seriously OP, every couple of days you're posting up a new 'help' thread, and in the end being very limited on the response you give on the forums here.


Especially in those threads where you get help... You don't tell anyone what you did, and what it did when you did that.


But really though, check those filterscripts, as if any of them are returning 0, then it's not being handed on. This is also mentioned on the wiki.
Reply
#8

What are you trying to say b/w these lines - Seriously OP........ when you did that.
Reply
#9

Answer GTLS, and pay attention to the first line of what I said...


The rest of it, is a rant about the fact that you don't answer nor keep up on topics as you should... Respond to people, even when it's fixed, so we can tell if it's fixed or needs work.

Use PROPER topics... This would've been better as 'OnPlayerDeath not working" and you'd get better responses, but simply throwing up 'HELP I'VE BROKEN THIS" isn't anything to anybody, it's just saying that you're panicking.

And KEEP UP WITH WHAT IS REQUESTED....


Like, damn, GTLS asked for something, and you skipped that, and I even said advice on the first line of what I said, and you've also skipped that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)