20.10.2010, 02:08
Ver se isso funciona... LoL
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
enum pInfo
{
Matou,
Morreu,
Level,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new Text:Higor;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Sistema By : ArthuR"~> Post by BurnouT/ArthuR);
print("--------------------------------------\n");
SetTimer("tt",20000,1);
SetTimer("Levell",1200000,1);
Higor = TextDrawCreate(500.000000, 110.000000, "__");
TextDrawBackgroundColor(Higor, 255);
TextDrawFont(Higor, 1);
TextDrawLetterSize(Higor, 0.300000, 1.000000);
TextDrawColor(Higor, -1);
TextDrawSetOutline(Higor, 1);
TextDrawSetProportional(Higor, 1);
TextDrawUseBox(Higor, 0);
TextDrawBoxColor(Higor, 255);
TextDrawTextSize(Higor, 620.000000, 0.000000);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
Checar(playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Salvar(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Text:Higor);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[playerid][Morreu]++;
GivePlayerMoney(killerid,2000);
PlayerInfo[killerid][Matou]++;
tt(playerid);
tt(killerid);
return 1;
}
forward tt(playerid);
public tt(playerid)
{
new str[128];
format(str, 128, "~w~Info Char : ~n~~g~Matou: ~w~%d ~n~~w~~y~Morreu: ~w~%d~n~~w~~p~Level: ~w~%d",PlayerInfo[playerid][Matou],PlayerInfo[playerid][Morreu],PlayerInfo[playerid][Level]);
return TextDrawSetString(Text:Higor, str);
}
stock Salvar(playerid)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"%s.ini",name);
if(fexist(file))
{
dini_IntSet(file,"Matou", PlayerInfo[playerid][Matou]);
dini_IntSet(file,"Morreu", PlayerInfo[playerid][Morreu]);
dini_IntSet(file,"Level", PlayerInfo[playerid][Level]);
}
}
stock Checar(playerid)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Leveis/%s.ini",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,"Matou", PlayerInfo[playerid][Matou]);
dini_IntSet(file,"Morreu", PlayerInfo[playerid][Morreu]);
dini_IntSet(file,"Level", PlayerInfo[playerid][Level]);
}
if(fexist(file))
{
PlayerInfo[playerid][Matou] = dini_Int(file,"Matou");
PlayerInfo[playerid][Morreu] = dini_Int(file,"Matou");
PlayerInfo[playerid][Level] = dini_Int(file,"Level");
}
}
forward Levell(playerid);
public Levell(playerid)
{
PlayerInfo[playerid][Level]++;
GameTextForPlayer(playerid, "~w~Level Adicionado", 5000, 1);
tt(playerid);
}