Get the killerid's name[solved, ty all :D]
#1

Oke now i have the killerid's name
Код:
	kName = GetPlayerName(killerid);
	dName = GetPlayerName(playerid);
But how do i get the killerid's name inside a GameText?

Код:
	new warning[256];
	format(warning, sizeof(warning), "kName Killed Dname with a ...");
	GameTextForAll(warning, 5000, 1);
Reply
#2

i dont think its possible in gametext cause gametext can't use strings ,
only in SendClientMessage
Reply
#3

Quote:
Originally Posted by [AC
Etch ]
i dont think its possible in gametext cause gametext can't use strings ,
only in SendClientMessage
How do i put it inside a SendClientMessage ?
Reply
#4

Here you are, lil padawan

Код:
	new string[128], kName[24], dName[24];
GetPlayerName(playerid, dName, 24);
GetPlayerName(killerid, kName, 24);
format(string, 128, "%s Killed %s with a ....", kName, dName);
GameTextForAll(string, 5000, 1);
non-tested!
Reply
#5

just a lil update :

Код:
new string[128], kName[MAX_PLAYER_NAME], dName[MAX_PLAYER_NAME];
kName = GetPlayerName(killerid, kName, MAX_PLAYER_NAME);
dName = GetPlayerName(playerid, dName, MAX_PLAYER_NAME);
format(string, 128, "%s Killed %s with %d", kName, dName, reason);
GameTextForAll(string, 5000, 1);
that will give a reason too
Reply
#6

Quote:
Originally Posted by [AC
Etch ]
just a lil update :

Код:
new string[128], kName[MAX_PLAYER_NAME], dName[MAX_PLAYER_NAME];
kName = GetPlayerName(killerid, kName, MAX_PLAYER_NAME);
dName = GetPlayerName(playerid, dName, MAX_PLAYER_NAME);
format(string, 128, "%s Killed %s with %d", kName, dName, reason);
GameTextForAll(string, 5000, 1);
that will give a reason too
This is not good! defective... use my version.
Reply
#7

You have to format a string before using GameText.Here's an example
pawn Код:
new kName,dName;
GetPlayerName(killerid,kName,MAX_PLAYER_NAME);
GetPlayerName(playerid,dName,MAX_PLAYER_NAME);
new string[128];
format(string,sizeof(string),"%s has killed %s",kName,dName);
GameTextForAll(string,2000,4);
Reply
#8

Quote:
Originally Posted by Luka™
You have to format a string before using GameText.Here's an example
pawn Код:
new kName,dName;
GetPlayerName(killerid,kName,MAX_PLAYER_NAME);
GetPlayerName(playerid,dName,MAX_PLAYER_NAME);
new string[128];
format(string,sizeof(string),"%s has killed %s",kName,dName);
GameTextForAll(string,2000,4);
Iget the error:
(437) : error 035: argument type mismatch (argument 2)
(43 : error 035: argument type mismatch (argument 2)
Reply
#9

Quote:
Originally Posted by Fonsie
Iget the error:
(437) : error 035: argument type mismatch (argument 2)
(43 : error 035: argument type mismatch (argument 2)
Because kName and dName are supposed to be arrays, not variables.
Reply
#10

So how do i fix it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)