#include <a_samp>
#pragma tabsize 0
#define Dialogonclick 700
new score,dinheiro,Float:c_health,Float:c_armour,c_mortes,c_kills;
enum k_m{ Kills, Mortes,}
new c_stat[MAX_PLAYERS][k_m];
new PlayerName[MAX_PLAYER_NAME];
new espaco[150];
new msgbox[150];
public OnFilterScriptInit()
{
//Opcional: SendClientMessageToAll(0xFFFFFFAA,"[INFO] FS Stats in Dialog Box(by CyNiC) carregado.");
print("\n--------------------------------------");
print("---Stats by clicking made by CyNiC----\n");
print("---------------16/01/2010-------------\n");
print("---------------Carregado--------------\n");
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
c_stat[playerid][Mortes]++;
c_stat[killerid][Kills]++;//2є Kills
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
score=GetPlayerScore(clickedplayerid);
GetPlayerHealth(clickedplayerid,c_health);
GetPlayerArmour(clickedplayerid,c_armour);
dinheiro=GetPlayerMoney(clickedplayerid);
c_mortes=c_stat[clickedplayerid][Mortes];
c_kills=c_stat[clickedplayerid][Kills];
GetPlayerName(clickedplayerid,PlayerName,MAX_PLAYER_NAME);
format(PlayerName,sizeof PlayerName,"Stats de %s.",PlayerName);
msgbox="Score: %d\n\nDinheiro: %d\n\nHealth: %.1f\n\nColete: %.1f\n\nMorreu: %d\n\nMatou: %d";
format(espaco,sizeof espaco,msgbox,score,dinheiro,c_health,c_armour,c_mortes,c_kills);
ShowPlayerDialog(playerid,Dialogonclick,0,PlayerName,espaco,"OK","SAIR");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==Dialogonclick){ if(!response){return 0;}/* <= Botгo sair */}
return 1;}
public OnFilterScriptExit()
{
return 1;
}
Eu recomendo sistema de salvamento em Dini.
Simples e efiзiente! https://sampforum.blast.hk/showthread.php?tid=180237 |