11.06.2010, 19:03
Quote:
Originally Posted by Rat_
chaoz, donde pongo eso? en onplayerconnect?
|
pawn Код:
#include <Dini>
enum PD{
death,
kills,
}
new pInfo[MAX_PLAYERS][PD];
public OnPlayerConnect(playerid) // <<==================== XD
{
new File:file[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.ini", name);
if(!fexist(file){
dini_Create(file);
dini_IntSet(file, "kills", 0);
dini_IntSet(file, "death", 0);
pInfo[playerid][deaht] = 0;
pInfo[playerid][kills] = 0;
}
else{
pInfo[playerid][deaht] = dini_Int(file, "death");
pInfo[playerid][kills] = dini_Int(file, "kills");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason) // <<==================== XD
{
new File:file[256], PIP[16], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.ini", name);
if(!fexist(file){
dini_Create(file);
dini_IntSet(file, "kills", pInfo[playerid][kills]);
dini_IntSet(file, "death", pInfo[playerid][deaht]);
}
return 1;
}