You have killed (playername) Distance : __m Weapon :-
#1

Hey guys
I wanted to make such a message after killing every player.
I found something similar to this in forums but they didn't work for me!
Even though it compiles without any error i get errors in game like weapon name not appearing....
I only want 'You have killed' no need of 'you were killed by'.
Te message should be like..' You have killed (name) Distance : __ meteres Weapon : weapon name(including long fall and heli kills )

Thank you
Reply
#2

PHP код:
new Float:LastShotDis[MAX_PLAYERS];
UName(p){
    new 
s[24];
    
GetPlayerName(p,s,24);
    return 
s;
}
WName(wid){
    new 
s[32];
    
GetWeaponName(wid,s,32);
    return 
s;
}
#define scm     SendClientMessage
public OnPlayerDeath(playeridkilleridreason){
    if(
killerid != INVALID_PLAYER_ID){
        new 
s[128];
        
format(s,sizeof(s),"You killed %s from distance %.2f with weapon %s.",UName(playerid),LastShotDis[killerid],WName(reason));
        
scm(killerid,-1,s);
format(s,sizeof(s),"You were killed by %s from distance %.2f with weapon %s.",UName(killerid),LastShotDis[killerid],WName(reason));
        
scm(playerid,-1,s);
    }
    return 
1;
}
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ){
    if(
hittype==BULLET_HIT_TYPE_PLAYER){
        
LastShotDis[playerid]=GetPlayerDistanceFromPoint(playerid,fX,fY,fZ);
    }
    return 
1;

EDITED
EDITED
Reply
#3

I think this won't show me the Weapon name that killed me ! I need that too
Reply
#4

Quote:
Originally Posted by Rohit12
Посмотреть сообщение
I think this won't show me the Weapon name that killed me ! I need that too
EDITED
Reply
#5

oh broo I mentioned that i dont want "you were killed by.."
I only want 'you killed ...."
Also when i tried the above it gave a lot of errors. First i tried in my GM.
Then i tried to make it a FS and it gave me this :-

Quote:

C:\Users\Rohit\Desktop\kill.pwn(19) : warning 217: loose indentation
C:\Users\Rohit\Desktop\kill.pwn(19) : error 017: undefined symbol "format"
C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition
C:\Users\Rohit\Desktop\kill.pwn(20) : warning 217: loose indentation
C:\Users\Rohit\Desktop\kill.pwn(20) : error 017: undefined symbol "SendClientMessage"
C:\Users\Rohit\Desktop\kill.pwn(25) : warning 235: public function lacks forward declaration (symbol "OnPlayerWeaponShot")
C:\Users\Rohit\Desktop\kill.pwn(26) : error 017: undefined symbol "BULLET_HIT_TYPE_PLAYER"
C:\Users\Rohit\Desktop\kill.pwn(27) : error 017: undefined symbol "GetPlayerDistanceFromPoint"
C:\Users\Rohit\Desktop\kill.pwn(27) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Errors.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)