Posts: 570
Threads: 55
Joined: Oct 2016
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
new string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
format(string, sizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!", name, name2);
SendClientMessageToAll(0xF8F8F8FFF, string);
SetPlayerHealth(playerid, 0.0);
new string1[128]; new name3[MAX_PLAYER_NAME];
GetPlayerName(issuerid, name3, sizeof(name3));
format(string1, sizeof(string1), "~P~ Got Pawned :[ By %s.", name3);
GameTextForPlayer(playerid, string, 3000, 6);
}
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
Posts: 1,219
Threads: 51
Joined: Jul 2012
its exactly the same ... both are just playerids
Posts: 570
Threads: 55
Joined: Oct 2016
i know,
so u r saying this is correct?:
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
new string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(issuerid, name2, sizeof(name2));
format(string, sizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!", name, name2);
SendClientMessageToAll(0xF8F8F8FFF, string);
SetPlayerHealth(playerid, 0.0);
return 1;
}
new name[MAX_PLAYER_NAME]; and new name2[MAX_PLAYER_NAME]; would work?
Posts: 570
Threads: 55
Joined: Oct 2016
if it's ok, so why i am getting this?
Код:
C:\Users\Admin\Desktop\HeadShot.pwn(5) : error 025: function heading differs from prototype
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
"bodypart" parameter was added later so you have outdated includes. Update.
Posts: 570
Threads: 55
Joined: Oct 2016
Code:
PHP код:
Line 5>>> public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
new string[128],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(issuerid, name2, sizeof(name2));
format(string, sizeof(string), "[RBOT]:{FFFFFF} {FF0FF0}%s {FFFFFF}Has Headshotted {F00F00}%d {FFFFFF}And Wins {F12F12}$2000$!", name, name2);
SendClientMessageToAll(0xF8F8F8FFF, string);
SetPlayerHealth(playerid, 0.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.
Posts: 570
Threads: 55
Joined: Oct 2016