10.06.2010, 20:08
Hola, estoi buscando un script o algo para que el score se te quede guardado en el juego cuando entras
alguien tiene idea donde lo puedo encontrar??
alguien tiene idea donde lo puedo encontrar??
if(dini_Isset("score.ini",PlayerName(playerid))) SetPlayerScore(playerid,dini_Int("score.ini",PlayerName(playerid)));
dini_IntSet("score.ini",PlayerName(playerid),GetPlayerScore(playerid));
if(!fexist("score.ini")) dini_Create("score.ini");
#include <Dini>
enum PD{
death,
kills,
}
new pInfo[MAX_PLAYERS][PD];
public OnPlayerConnect(playerid){
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){
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;
}
Originally Posted by Rat_
chaoz, donde pongo eso? en onplayerconnect?
|
#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;
}
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;
}