PlayerName question - 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)
+--- Thread: PlayerName question (
/showthread.php?tid=636519)
PlayerName question -
AlexuTzVs - 29.06.2017
Hello, is there anyway i can make a PlayerName to show in the game even if he's offline. I want to create a Best Killer sistem and i want to show him on /warstats even if he is offline, is there any way that i can make this happen
Re: PlayerName question -
NoahF - 29.06.2017
Basically, add in a "total kills" variable in your player data and make sure it saves on disconnect, then loop through all the registered players in your save files or tables depending on what your filesystem is, and display the top 10 or however many you want. You can use dialogs or SCM's or TD's or however you wanna do it.
Re: PlayerName question -
AlexuTzVs - 29.06.2017
So i am trying to make a playername as a string using dini. this is the code i am trying to make but there is nothing wrote in the .txt file
Code:
new name[128];
new string[128];
GetPlayerName(TopKills1, name, sizeof(name));
format(str, 256,"{63380A}Triads{FFFFFF}-{808000}LSV{FFFFFF}-{008000}Grove{FFFFFF}, Best Killer: [{63380A}%s{FFFFFF}] || Kills: [{63380A}%d{FFFFFF}]",name, PlayerInfo[TopKills1][pWarKills]);
SendClientMessageToAll(COLOR_WHITE,str);
if(dini_Exists("scriptfiles/war/TopKills1.txt"))
{
dini_Set("scriptfiles/war/TopKills1.txt", "%s", name);
}
Re: PlayerName question -
AlexuTzVs - 30.06.2017
Up??
Re: PlayerName question -
JasonRiggs - 30.06.2017
Nothing is wrote in the .txt because maybe you didn't save in it? Do it at OnPlayerGiveDamage, increase the player's kill inside that "TopKills1.txt" and then Load it when the player does the command.