Heres my onplayerconnect and onplayerdisconnect feilds, can you help me with that?
pawn Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
playerdata[playerid][allowteleport] = 0;
playerdata[playerid][blockpm] = 0;
playerdata[playerid][seepms] = 0;
playerdata[playerid][playerwired] = 0;
playerdata[playerid][level] = 0;
playerdata[playerid][pWarnings]=0;
playerdata[playerid][PlayerWired]=0;
playerdata[playerid][logged] = 0;
playerdata[playerid][Joins]=0;
playerdata[playerid][Deaths]=0;
playerdata[playerid][Kills]=0;
playerdata[playerid][PlayerFrozen] = 0;
playerdata[playerid][Kicks]=0;
playerdata[playerid][vip]=0;
playerdata[playerid][disabled]=0;
new s[128];
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "/Users/%s.ini", pname);
if(!fexist(file))
{
format(s, sizeof(s),"%s is not registered.\nPlease enter a password below.", pname);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Please Register",s,"Register","Disconnect");
}
if(fexist(file))
{
format(s, sizeof(s), "%s is registered.\nPlease Login.", pname);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Please Login",s,"Login","Disconnect");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
pSpectating[playerid][i]=0;
}
ranka[playerid] = Create3DTextLabel("Trucker",COLOR_YELLOW,30.0,40.0,50.0,40.0,0);
rankb[playerid] = Create3DTextLabel("Dispatch",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
rankc[playerid] = Create3DTextLabel("Recovery",COLOR_RED,30.0,40.0,50.0,40.0,0);
rankd[playerid] = Create3DTextLabel("Police",COLOR_BLUE,30.0,40.0,50.0,40.0,0);
GameTextForPlayer(playerid,"~w~Rokzlive ~r~Transportation Nation",5000,5);
SendClientMessage(playerid, COLOR_GREEN, "Welcome! Choose your spawn! Type /menu to learn how to use our server! Type /rules to see rules!");
TextDrawShowForPlayer(playerid,Name);
TextDrawShowForPlayer(playerid,Web);
M_OnPlayerConnect(playerid);
new string[100];
format(string, sizeof(string),"To start a mission type /work");
TextDrawShowForPlayer ( playerid, mission [ playerid ] );
TextDrawSetString(mission [ playerid ],string);
SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
new 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,"Bank", PlayerInfo[playerid][Bank]);
}
if(fexist(file))
{
PlayerInfo[playerid][Bank] = dini_Int(file,"Bank");
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel(ranka[playerid]);
Delete3DTextLabel(rankb[playerid]);
Delete3DTextLabel(rankc[playerid]);
Delete3DTextLabel(rankd[playerid]);
M_OnPlayerDisconnect(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,"Bank", PlayerInfo[playerid][Bank]);
}
return 1;
}