SA-MP Forums Archive
Get the killerid's name[solved, ty all :D] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Get the killerid's name[solved, ty all :D] (/showthread.php?tid=133025)



Get the killerid's name[solved, ty all :D] - Fonsie - 10.03.2010

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);



Re: Get the killerid's name - aircombat - 10.03.2010

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


Re: Get the killerid's name - Fonsie - 10.03.2010

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 ?


Re: Get the killerid's name - Scream[SM] - 10.03.2010

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!


Re: Get the killerid's name - aircombat - 10.03.2010

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


Re: Get the killerid's name - Scream[SM] - 10.03.2010

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.


Re: Get the killerid's name - Luka P. - 10.03.2010

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);



Re: Get the killerid's name - Fonsie - 10.03.2010

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)


Re: Get the killerid's name - Correlli - 10.03.2010

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.


Re: Get the killerid's name - Fonsie - 10.03.2010

So how do i fix it?