After Pickup [HELP]
#4

Quote:
Originally Posted by lelemaster
Посмотреть сообщение
I just want to give a little precision to your codes that could fix you bugs ( It seems you changed the last I gave you xD)


pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(pickupid == tombstonePickups[i]) // Here, you can place back the codes I gave you on the last topic
                {
                new tombstring[MAX_PLAYER_NAME+20];
                GetPlayerName(i,tombstring,MAX_PLAYER_NAME);
                strins(tombstring, "~g~+$400 ~n~~r~Coffin of:~n~~w~", 0);
                GameTextForPlayer(playerid,tombstring,3000,3);
                DestroyPickup(tombstonePickups[i]); //Since you want to remove the coffin of the player that is dead, you'll have to place 'i' and not 'playerid'
                tombstonePickups[i] = -1; // Same for here
                GivePlayerMoney(playerid, 400);
                break;
                }
        }
        return 1;
}
Don't forget to delete the coffin in OnPlayerDisconnect because the id of the player will no longer exist.

Sorry for posting if you didn't want the help I'm giving above.
No no! @"Sorry for posting if you didn't want the help I'm giving above." I though the first code you've given me was bugged. And realized that it was because of this Coffin doesn't destroyed after someone pick it up (except me). Now its possible to add that code you've posted now to this.

Thanks man!!!!!!!!!!!

(Here is your last code )
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(pickupid == tombstonePickups[i] && i != playerid)
                {
                new tombstring[MAX_PLAYER_NAME+20];
                GetPlayerName(i,tombstring,MAX_PLAYER_NAME);
                strins(tombstring, "~g~+$400 ~n~~r~Coffin of:~n~~w~", 0);
                GameTextForPlayer(playerid,tombstring,3000,3);
                DestroyPickup(tombstonePickups[playerid]);
                tombstonePickups[playerid] = -1;
                GivePlayerMoney(playerid, 400);
                break;
                }
        }
        return 1;
}
And OnplayerDisconnect... is this correct?
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(tombstonePickups[playerid] != -1)
        {
            DestroyPickup(tombstonePickups[i]);
            tombstonePickups[i] = -1;
        }
    }
There is something wrong right?
Reply


Messages In This Thread
After Pickup [HELP] - by kbalor - 08.09.2012, 11:39
Re: After Pickup [HELP] - by JaKe Elite - 08.09.2012, 11:43
Re : After Pickup [HELP] - by lelemaster - 08.09.2012, 12:23
Re: Re : After Pickup [HELP] - by kbalor - 08.09.2012, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)