SA-MP Forums Archive
[Ajuda] PPC_Trucking - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] PPC_Trucking (/showthread.php?tid=504759)



PPC_Trucking - comanfiss - 05.04.2014

Gente PF me ajuda quando um Player й morto por outro PLAYER o PLAYER q morreu й BANIDO acho q й um BUG mais qual quer PLAYER q morre й BANIDO alguem pode me ajuda.....+++


Re: PPC_Trucking - P1c4550 - 06.04.2014

posta o conteudo da callback OnPlayerDeath


Re: PPC_Trucking - comanfiss - 06.04.2014

ta aki
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    // Setup local variables
    new VictimName[24], KillerName[24], Msg[128];

    // Clear the missiontext
    TextDrawSetString(APlayerData[playerid][MissionText], " ");
    // Hide the missiontext for this player (when the player is choosing a class, it's not required to show any mission-text)
    TextDrawHideForPlayer(playerid, APlayerData[playerid][MissionText]);

    // Stop any job that may have started
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassTruckDriver: Trucker_EndJob(playerid);
        case ClassBusDriver: BusDriver_EndJob(playerid);
        case ClassPilot: Pilot_EndJob(playerid);
        case ClassPolice: Police_EndJob(playerid);
        case ClassMafia: Mafia_EndJob(playerid);
        case ClassCourier: Courier_EndJob(playerid);
        case ClassAssistance: Assistance_EndJob(playerid);
        case ClassRoadWorker: Roadworker_EndJob(playerid);
    }

    // If the player is part of a convoy, kick him from it
    Convoy_Leave(playerid);

    // If another player kills you, he'll get an extra star of his wanted level
    if (killerid != INVALID_PLAYER_ID)
    {
        // Increase the wanted level of the killer by one star
        SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
        // Get the name of the killed player and the killer
        GetPlayerName(playerid, VictimName, sizeof(VictimName));
        GetPlayerName(killerid, KillerName, sizeof(KillerName));
        // Let the killed know the police are informed about the kill
        format(Msg, 128, "{FF0000}Vocк matou {FFFF00}%s{FF0000}, e agora estб sendo procurado pela polнcia.", VictimName);
        SendClientMessage(killerid, 0xFFFFFFFF, Msg);
        // Inform all police players about the kill
        format(Msg, 128, "{00FF00}O jogador {FFFF00}%s{00FF00} matou {FFFF00}%s{00FF00}. [Objetvo]: Persiga-o e Multe-o.", KillerName, VictimName);
        Police_SendMessage(Msg);
    }

    return 1;
}