OnPlayerPickupPickupPickup
#1

When Player died it spawn a tombstone and if somebody pickup the tombstone it disconnect player who is currently online, and the server restarts. What could be the problem?


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[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;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(tombstonePickups[playerid] != -1)
    {
        DestroyPickup(tombstonePickups[playerid]);
    }
   
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    #if defined USE_OBJECT
    new Float:pA;
    GetPlayerFacingAngle(playerid, pA);
   
    tombstonePickups[playerid] = CreatePickup(2896,23,pX,pY,pZ+0.3,GetPlayerVirtualWorld(playerid));
    #else
    tombstonePickups[playerid] = CreatePickup(2896,23,pX,pY,pZ,GetPlayerVirtualWorld(playerid));
    #endif
    return 1;
}
Reply
#2

I think you mean OnPlayerPickupPickupPickupPickup no ?
I think its from the GameText
Reply
#3

Quote:
Originally Posted by Vukilore
Посмотреть сообщение
I think you mean OnPlayerPickupPickupPickupPickup no ?
I think its from the GameText
No its OnPlayerPickupPickupPickupPickupPickup XD Sorry about that didn't notice I put up many pickups.
Well GameText is a cool part of the coffin and I guess I need to remove that. I'm not sure but i'm thinking if it is because of looping players.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)