Why does this stop my OnPlayerDeath callback ?
#1

Hello guys I got a weird problem, really don't know what the fuck is wrong with this..

Why does this stop my OnPlayerDeath callback ?

Код:
    
if(VigilantePlayer[killerid]==1)
{
    if(GetPlayerWeapon(killerid)==25)
    {
        VigilanteShotgun[killerid]++;
    }
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(VigilanteCar[playerid]==1)
	{
            VigilanteSmash[killerid]++;
	}
    }
}
I mean, all functions after this aren't called, and this code don't work : /

Same thing with " PlayerData[killerid][Kills]++;" but "PlayerData[playerid][Deaths]++;" is working ...
Reply
#2

Put that at the end of your callback then.
Should work.
Reply
#3

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Put that at the end of your callback then.
Should work.
Nah, already tried.
Reply
#4

Show the whole callback ?
Reply
#5

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Show the whole callback ?
I tried to put this in a white GM, and same thing, don't work + 'stop' the callback, so it's not from the rest of my script.
Reply
#6

Post the whole OnPlayerDeath callback.

If your just copying it to another gm to test, the prob will still be there.
Reply
#7

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Post the whole OnPlayerDeath callback.

If your just copying it to another gm to test, the prob will still be there.
Not in a white GM. I don't think something can help here

Код:
	PlayerData[killerid][Kills]++;
	PlayerData[playerid][Deaths]++;

        GivePlayerMoney(killerid, 500);

	if(GetPlayerWeapon(killerid)==16 || GetPlayerWeapon(killerid)==35 || GetPlayerWeapon(killerid)==36 || GetPlayerWeapon(killerid)==39 || GetPlayerWeapon(killerid)==51)
        {
            PlayerData[killerid][BombSquad]++;
            BombSkill[killerid]++;
	    if(BombSkill[killerid]==25)
	    {
                SendClientMessage(killerid, LIGHTGREEN, ">> "COL_WHITE"BombSquad skill upgraded, you can now defuse claymores "COL_LIGHTORANGE"/defuse");
            }
	    if(BombSkill[killerid]==150)
	    {
                SendClientMessage(killerid, LIGHTGREEN, ">> "COL_WHITE"BombSquad skill upgraded, claymores will not explode anymore as you pass");
            }
	}

    
        if(VigilantePlayer[playerid]==1)
	{
	    VigilanteDeath[playerid]++;
	    if(VigilanteDeath[playerid]>=3)
	    {
		VigilantePlayer[playerid]=0;
		InMission[playerid]=0;
	        SendClientMessage(playerid, RED, "<!> "COL_WHITE"Vigilante mission fail, you died 3 times");
	    }
	}
	
        if(VigilantePlayer[killerid]==1)
	{
	    if(GetPlayerWeapon(killerid)==25)
	    {
	        VigilanteShotgun[killerid]++;
	    }
            if(IsPlayerInAnyVehicle(playerid))
            {
		if(VigilanteCar[playerid]==1)
		{
                    VigilanteSmash[killerid]++;
	        }
            }
	}
	return 1;
}
Reply
#8

Have you tried
Код:
else if
Reply
#9

I just tried to add
Код:
	if(IsPlayerConnected(killerid))
    {
before all times I used "killerid" and it works, anyway dunno why.. but it's good now ^^

Thank's for help.
Reply
#10

Quote:
Originally Posted by Shoko Lacho
Посмотреть сообщение
I just tried to add
Код:
	if(IsPlayerConnected(killerid))
    {
before all times I used "killerid" and it works, anyway dunno why.. but it's good now ^^

Thank's for help.
No prob's, you got yourself there in the end
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)