Death message bugged
#1

Hello!
In my script when a player killed another player then it will show a message before (Death message)
But now i removed it due to some reason.
But it is bugged now.When i kill someone there will be a space in the chat
for eg
Quote:

Player1: message1
SPACE
Player1: Message2

That space is instead of death message.
How to fix this?

OnDeathMessage Callback

pawn Код:
public OnPlayerDeath(playerid, killerid, reason){
    PlayerEnterTime[playerid]-=221;
    new pname[MAX_PLAYER_NAME];
    new string[128];
    GameTextForPlayer(playerid,"~r~~h~OWNED",10000,3);
    new pstring[128]; //player message
    new killer[MAX_PLAYER_NAME];
    GetPlayerName(killerid, killer, sizeof(killer));
    if(InDM[playerid]==1) InDM[playerid]=0;
    SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
//--------------------------------Gang Zone-------------------------------------
    new Gang:killergang = Player_GetGang( killerid ),
    Gang:playergang = Player_GetGang( playerid ),
    Zone:killerzone = Player_GetZone( killerid ),
    Zone:playerzone = Player_GetZone( playerid );
    if( playergang != killergang ){
        if( killerzone == playerzone ){
            if( Zone_GetOwner( playerzone ) == playergang ){
                GangScores[ killergang ][ killerzone ]++;
                if( GangScores[ killergang ][ killerzone ] >= GANGWAR_WIN_SCORE ){
                    if( Zone_GetAttacker( killerzone ) == killergang )
                        CallLocalFunction( "OnGangCaptureZone", "iii", _:killergang, _:killerzone, _:playergang );
                    else
                        CallLocalFunction( "OnGangAttackZone", "iii", _:killergang, _:killerzone, _:playergang );}}
            else if( Zone_GetOwner( killerzone ) == killergang ){
                if( Zone_GetAttacker( playerzone ) == playergang && GangScores[ killergang ][ killerzone ]+1 >= GANGWAR_WIN_SCORE ){
                    GangScores[ killergang ][ killerzone ]++;
                    CallLocalFunction( "OnGangDefendZone", "iii", _:killergang, _:killerzone, _:playergang );}
                else if( Zone_GetAttacker( playerzone ) != playergang && GangScores[ killergang ][ killerzone ]-1 >= 0 )
                    GangScores[ playergang ][ killerzone ]--;}}}
//---------------------------------LuxAdmin---------------------------------------
    #if defined USE_STATS
    PlayerInfo[playerid][Deaths]++;
    #endif
    InDuel[playerid] = 0;
    if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID){
        #if defined USE_STATS
        PlayerInfo[killerid][Kills]++;
        #endif
        if(InDuel[playerid] == 1 && InDuel[killerid] == 1){
            GameTextForPlayer(playerid,"Loser !",3000,3);
            GameTextForPlayer(killerid,"Winner !",3000,3);
            InDuel[killerid] = 0;
            SetPlayerPos(killerid, 0.0, 0.0, 0.0);
            SpawnPlayer(killerid);}
        else if(InDuel[playerid] == 1 && InDuel[killerid] == 0){
            GameTextForPlayer(playerid,"Loser !",3000,3);}}
    #if defined ENABLE_SPEC
    for(new x=0; x<MAX_PLAYERS; x++)
        if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid)
           AdvanceSpectate(x);
    #endif
//-------------------------------------Normal-----------------------------------
    new kstring[128]; //killer message
    GetPlayerName(playerid, pname, sizeof(pname));
    format(kstring, sizeof(kstring), "~b~Haha Ya 0wned %s",pname);
    GameTextForPlayer(killerid, kstring, 4000, 3);
    new kname[MAX_PLAYER_NAME];   //killername
    GetPlayerName(killerid, kname, sizeof(kname));
    format(pstring, sizeof(pstring), "~r~ you got Murdered by %s",kname);
    GameTextForPlayer(playerid, pstring, 4000, 3);
//  new kscore=GetPlayerScore(killerid);
//  SetPlayerScore(killerid,kscore++);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    SetPlayerWantedLevel( killerid, GetPlayerWantedLevel( killerid )+1 );
    PlayerInfo[playerid][Deaths]++;
    PlayerInfo[killerid][Kills]++;
    new moneytemp;
    moneytemp = GetPlayerMoney(playerid)/8;
    GivePlayerMoney(killerid,moneytemp);
    GivePlayerMoney(playerid,-moneytemp);
    SendClientMessageToAll(COLOR_RED, string);
    DropWeapons(playerid);
    IsSpawned[playerid] = 0;
    cuffed[playerid] = 0;
    Tazed[playerid] = 0;
    hastazer[playerid] = 0;
    LawEnforcementRadio[playerid] = 0;
    HasLawEnforcementRadio[playerid] = 0;
    ReqBk[playerid] = 0;
    ReqBkRecent[playerid] = 0;
    ReportedRecent[playerid] = 0;
    VisitReq[playerid] = 0;
    EscapedConvict[playerid] = 0;
    VisitReqExpires[playerid] = 0;
    StoleCopCarRecent[playerid] = 0;
    triedtoescaperecent[playerid] = 0;
    JailTime[playerid] = 0;
    JailTimeServed[playerid] = 0;
    copshavevc[playerid] = 0;
    commitedcrimerecently[playerid] = 0;
    wantsheal[playerid] = 0;
    wantscure[playerid] = 0;
    InfectedPlyRecent[playerid] = 0;
    wantsweed[playerid] = 0;
    playeronweed[playerid] = 0;
    playertookweed[playerid] = 0;
    HasWeedBag[playerid] = 0;
    CuffedTime[playerid] = 0;
    cannotescapejail[playerid] = 0;
    RobbedPlyRecent[playerid] = 0;
    beenrobbedrecently[playerid] = 0;
    HasWallet[playerid] = 0;
    OldCash[playerid] = 0;
    Chlamydia[playerid] = 0;
    instunt[playerid] = 0;
//===============================================================================
 //------------------------ Was there a bounty on players head -------------------
    new bounty[MAX_PLAYERS];
    new killedplayer[ MAX_PLAYER_NAME ];
    if (bounty[ playerid ] > 0){
    GetPlayerName( playerid, killedplayer, sizeof( killedplayer ) );
    format(string, sizeof(string), "* Bounty reward: %d for killing %s.", bounty[playerid], killedplayer);
    SendClientMessage( killerid, COLOR_YELLOW, string );
    GivePlayerMoney( killerid, bounty[ playerid ] );
    bounty[ playerid ] = 0;}
//------------------------ Did player had a wanted level -----------------------
    if (GetPlayerWantedLevel( playerid ) > 0){
    switch( GetPlayerWantedLevel( playerid ) ) {
        case 1:{
            SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $5000." );
            GivePlayerMoney( killerid, 5000 );
            SetPlayerWantedLevel( playerid, 0 );}
        case 2:{
            SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $10000." );
            GivePlayerMoney( killerid, 10000);
            SetPlayerWantedLevel( playerid, 0 );}
        case 3:{
            SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $15000." );
            GivePlayerMoney( killerid, 15000 );
            SetPlayerWantedLevel( playerid, 0 );}
        case 4:{
            SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $20000." );
            GivePlayerMoney( killerid, 20000 );
            SetPlayerWantedLevel( playerid, 0 );}
        case 5:{
            SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $25000." );
            GivePlayerMoney( killerid, 25000 );
            SetPlayerWantedLevel( playerid, 0 );}
        case 6..200:{
            SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $30000." );
            GivePlayerMoney( killerid, 30000 );
            SetPlayerWantedLevel( playerid, 0 );}}}
    return 1;}
Reply
#2

There's a null client message being sent. You're talking about the space in chat or DeathMessages?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)