Headshot help
#1

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new 
string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
        
format(stringsizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!"namename2);
        
SendClientMessageToAll(0xF8F8F8FFFstring);
        
SetPlayerHealth(playerid0.0);
        new 
string1[128]; new name3[MAX_PLAYER_NAME];
        
GetPlayerName(issueridname3sizeof(name3));
        
format(string1sizeof(string1), "~P~ Got Pawned :[ By %s."name3);
        
GameTextForPlayer(playeridstring30006);
    }
    return 
1;

i know this code is wrong, im just asking how to make string for issuerid and for playerid, i know for playerid like this
name[MAX_PLAYER_NAME];
what about issuerid? Help hope that u have understand what i meant to ask
Reply
#2

its exactly the same ... both are just playerids
Reply
#3

i know,
so u r saying this is correct?:

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new 
string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
                
GetPlayerName(playeridnamesizeof(name));
                
GetPlayerName(issueridname2sizeof(name2));
        
format(stringsizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!"namename2);
        
SendClientMessageToAll(0xF8F8F8FFFstring);
        
SetPlayerHealth(playerid0.0);
        return 
1;

new name[MAX_PLAYER_NAME]; and new name2[MAX_PLAYER_NAME]; would work?
Reply
#4

It would if you used GetPlayerName

EDIT: Okay, you added those two lines.
Reply
#5

if it's ok, so why i am getting this?
Код:
C:\Users\Admin\Desktop\HeadShot.pwn(5) : error 025: function heading differs from prototype
Reply
#6

Error line
Edit:
Код:
format(string, sizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d{FFFFFF}And Wins {F12F12}$2000$!", name, name2);
Reply
#7

"bodypart" parameter was added later so you have outdated includes. Update.
Reply
#8

Code:
PHP код:
Line 5>>> public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new 
string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
                
GetPlayerName(playeridnamesizeof(name));
                
GetPlayerName(issueridname2sizeof(name2));
        
format(stringsizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!"namename2);
        
SendClientMessageToAll(0xF8F8F8FFFstring);
        
SetPlayerHealth(playerid0.0);
        return 
1;

Error:
Код:
C:\Users\Admin\Desktop\HeadShot.pwn(5) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Quote:
Originally Posted by RyderX
Посмотреть сообщение
Code:
PHP код:
Line 5>>> public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new 
string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
                
GetPlayerName(playeridnamesizeof(name));
                
GetPlayerName(issueridname2sizeof(name2));
        
format(stringsizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!"namename2);
        
SendClientMessageToAll(0xF8F8F8FFFstring);
        
SetPlayerHealth(playerid0.0);
        return 
1;

Error:
Код:
C:\Users\Admin\Desktop\HeadShot.pwn(5) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Update your a_samp.inc.

EDIT: I didn't notice Konstantinos' post.
Reply
#10

EDIT: Late
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)