SA-MP Forums Archive
Death[rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Death[rep] (/showthread.php?tid=325091)



Death[rep] - Dan_Barocu - 11.03.2012

i tired to make an thing so if i get killed by an person it says "You've been killed by %s" ..can some tellme..or for rep do it.


Re: Death[rep] - Dan_Barocu - 11.03.2012

anyone?please.


Re: Death[rep] - admantis - 11.03.2012

pawn Код:
public OnPlayerDeath( playerid, killerid, reason ) {
    if ( killerid != INVALID_PLAYER_ID ) {
        new wepName[32];
        new deathStr[82];
        new killerName[24];
        GetPlayerName( killerid, killerName, 24 );
        GetWeaponName( reason, wepName, 32 );
        format( deathStr, 82, "You were killed by %s using a %s.", killerName );
        SendClientMessage( playerid, -1, deathStr );
    }
   
    return 1;
}



Re: Death[rep] - mrskull42 - 11.03.2012

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new string[128],killed[MAX_PLAYER_NAME],killer[MAX_PLAYER_NAME];
    GetPlayerName(playerid,killed,sizeof(killed));
    GetPlayerName(killerid,killer,sizeof(killer));
    format(string,sizeof(string),"%s has been killed by %s",killed,killer);
    SendClientMessage(playerid,0xAA3333AA,string);
    return 1;
}



Re: Death[rep] - Dan_Barocu - 11.03.2012

Quote:
Originally Posted by admantis
Посмотреть сообщение
pawn Код:
public OnPlayerDeath( playerid, killerid, reason ) {
    if ( killerid != INVALID_PLAYER_ID ) {
        new wepName[32];
        new deathStr[82];
        new killerName[24];
        GetPlayerName( killerid, killerName, 24 );
        GetWeaponName( reason, wepName, 32 );
        format( deathStr, 82, "You were killed by %s using a %s.", killerName );
        SendClientMessage( playerid, -1, deathStr );
    }
   
    return 1;
}
do i do this the way i like?

PHP код:
if ( killerid != INVALID_PLAYER_ID ) {
           new 
deathStr[82];
        new 
killerName[24];
        
GetPlayerNamekilleridkillerName24 );
                
formatdeathStr82"You were killed by %s."killerName );
        
SendClientMessageplayerid, -1deathStr );
    }
    
    return 
1;




Re: Death[rep] - mrskull42 - 11.03.2012

Add
Код:
if ( killerid != INVALID_PLAYER_ID ) {
           new deathStr[82];
        new killerName[24];
        GetPlayerName( killerid, killerName, 24 );
                format( deathStr, 82, "You were killed by %s.", killerName );
        SendClientMessage( playerid, -1, deathStr );
Under the start of OnPlayerDeath


Re: Death[rep] - Dan_Barocu - 11.03.2012

Fixed.


Re: Death[rep] - Dan_Barocu - 11.03.2012

i made a thing and this is what it says

PHP код:
format(mess,sizeof(mess),"%s a intrat in server.  [ {278227}Tara: %s | {278227}IP: %s | {278227}Ping: %i |",GetPName(playerid),Country,IP,GetPlayerPing(playerid));
   
Line:(24) > SendAdminMessage(COLOR_ADMINstring); 
Error:
(24): error 017: undefined symbol "SendAdminMessage"
what i do i give rep here.


Re: Death[rep] - Dan_Barocu - 11.03.2012

anyone for this last thing??