Add this in a text or something - 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: Add this in a text or something (
/showthread.php?tid=236081)
Add this in a text or something -
Shoko Lacho - 06.03.2011
Hello, for exemple if I have :
Код:
OnPlayerDeath -
Kills[killerid]++;
How to use the number of kills in a text like SendClientMessage or ShowPlayerDialog ?
Re: Add this in a text or something -
Mauzen - 06.03.2011
format is what you are looking for
https://sampwiki.blast.hk/wiki/Format
Re: Add this in a text or something -
Stigg - 06.03.2011
Try this, worked for a user earlier.
pawn Код:
new KillingSpree[MAX_PLAYERS]//at top
Then under OnPlayerDeath(playerid, killerid, reason)...
pawn Код:
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(KillingSpree[killerid] == 5)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid,name,sizeof(name));
new streaktxt[128];
format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
}
else if(KillingSpree[killerid] == 10)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid,name,sizeof(name));
new streaktxt[128];
format(streaktxt,sizeof(streaktxt),"~b~NEWS FLASH:~w~ %s is on a Killing Spree. Kills: %d",name,KillingSpree[killerid]);
TextDrawSetString(YOUR_TEXTDRAW,streaktxt);
}
And so on...
Make a textdraw and play with that, just a general idea.
Re: Add this in a text or something -
Lorrden - 06.03.2011
Edit: Sorry, I didn't read as carefully as I should have.