26.09.2011, 00:15
Topo
Public OnPlayerConnect
Public OnPlayerDisconnect
Stock SalvarPlayer
Stock SetarPlayer
Problema: Eu crio a pasta Vip nas Scriptfiles, dae quando eu logo digito o comando pra virar vip disconnecto e nao aparece meu nome la!!!
pawn Код:
#include <Dini>
#define Vipado "Vip/%s.ini"
pawn Код:
public OnPlayerConnect(playerid)
{
new String[50];
format(String, sizeof(String), Vipado, Nome);
dini_Create(String);
dini_IntSet(String,"Vip",0);
SetarPlayer(playerid);
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
SalvarPlayer(playerid);
return 1;
}
pawn Код:
SalvarPlayer(playerid)
{
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[50];
format(String, sizeof(String), Vipado, Nome);
dini_IntSet(String,"Vip", Vip[playerid]);
return 1;
}
pawn Код:
SetarPlayer(playerid)
{
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[50];
format(String, sizeof(String), Vipado, Nome);
Vip[playerid] = dini_Int(String, "Vip");
return 1;
}