public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel(PlayerLabel);
SaveAccounts();
OnPlayerDataSave(playerid);
SetPVarInt(playerid, "laser", 0);
RemovePlayerAttachedObject(playerid, 0);
KillTimer(Checkveh[playerid]);
new pname[MAX_PLAYER_NAME], string[560 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Text[playerid]), TextDrawShowForPlayer(playerid, Text1[playerid]), TextDrawShowForPlayer(playerid, Health[playerid]);
TextDrawShowForPlayer(playerid,Txt), TextDrawShowForPlayer(playerid, Clock), TextDrawShowForPlayer(playerid, Date);
PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerScore(playerid, PlayerInfo[playerid][pKills]);
SetPlayerSkillLevel(playerid,0,999);
SetPlayerSkillLevel(playerid,1,999);
SetPlayerSkillLevel(playerid,2,999);
SetPlayerSkillLevel(playerid,3,999);
SetPlayerSkillLevel(playerid,4,999);
SetPlayerSkillLevel(playerid,5,999);
SetPlayerSkillLevel(playerid,6,999);
SetPlayerSkillLevel(playerid,7,999);
SetPlayerSkillLevel(playerid,8,999);
SetPlayerSkillLevel(playerid,9,999);
SetPlayerSkillLevel(playerid,10,999);
SetPlayerToTeamColor(playerid);
SetPlayerSpawn(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
public OnPlayerLogin_(playerid, password[])
{//15060
new string2[256], keystring[256];
format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));
keystring = dini_Get(string2, "Key");
if(strcmp(keystring, password, true) == 0) // I assume that's the password check string1 is equal to string2
{
PlayerInfo[playerid][pAdmin] = dini_Int(string2,"AdminLevel");
PlayerInfo[playerid][aDuty] = dini_Int(string2,"aDuty");
PlayerInfo[playerid][aTog] = dini_Int(string2,"aTog");
PlayerInfo[playerid][pMember] = dini_Int(string2,"pMember");
PlayerInfo[playerid][pRank] = dini_Int(string2,"pRank");
PlayerInfo[playerid][pBanned] = dini_Int(string2,"Banned");
PlayerInfo[playerid][pDonateRank] = dini_Int(string2,"DonateRank");
PlayerInfo[playerid][pWarns] = dini_Int(string2,"Warnings");
PlayerInfo[playerid][pReg] = dini_Int(string2,"Registered");
PlayerInfo[playerid][pCash] = dini_Int(string2,"Cash");
PlayerInfo[playerid][pKills] = dini_Int(string2,"Kills");
PlayerInfo[playerid][pDeaths] = dini_Int(string2,"Deaths");
PlayerInfo[playerid][pMuted] = dini_Int(string2,"Muted");
PlayerInfo[playerid][prMuted] = dini_Int(string2,"ReportMuted");
PlayerInfo[playerid][ptrMuted] = dini_Int(string2,"ReportTimeMuted");
PlayerInfo[playerid][ptMuted] = dini_Int(string2,"TimeMuted");
PlayerInfo[playerid][pvMuted] = dini_Int(string2,"VipMuted");
PlayerInfo[playerid][pvtMuted] = dini_Int(string2,"VipTimeMuted");
PlayerInfo[playerid][pfMuted] = dini_Int(string2,"FactionMuted");
PlayerInfo[playerid][pftMuted] = dini_Int(string2,"FactionTimeMuted");
PlayerInfo[playerid][pSpree] = dini_Int(string2,"KillSpree");
PlayerInfo[playerid][pCWons] = dini_Int(string2,"CWons");
PlayerInfo[playerid][pHide] = dini_Int(string2,"Hide");
PlayerInfo[playerid][pIgnorePM] = dini_Int(string2,"pIgnorePM");
PlayerInfo[playerid][pJailed] = dini_Int(string2,"pJailed");
PlayerInfo[playerid][pArrested] = dini_Int(string2,"pArrested");
PlayerInfo[playerid][pCrimes] = dini_Int(string2,"pCrimes");
PlayerInfo[playerid][pJail] = dini_Int(string2,"pJail");
PlayerInfo[playerid][pJailTime] = dini_Int(string2,"pJailTime");
PlayerInfo[playerid][Level] = dini_Int(string2,"Level");
PlayerInfo[playerid][Exp] = dini_Int(string2,"Exp");
PlayerInfo[playerid][pWantedDeaths] = dini_Int(string2,"pWantedDeaths");
}
else
{
printf("%s has left the server with %d cash", PUT_NAME_DETECTOR_HERE, PlayerInfo[playerid][pCash]); |
public SaveAccounts()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
OnPlayerDataSave(i);
}
}
}
SendClientMessage(playerid,COLOR_YELLOW,"You get $350.");
GivePlayerMoney(playerid, 350);
SetPlayerColor(playerid, TeamInfo[PlayerInfo[playerid][pMember]][TeamColor]);
RemovePlayerFromVehicle(playerid);
DisablePlayerCheckpoint(playerid);
SetTimerEx("SweeperJobAgain", 3600000,false, "d", playerid);
CoalMineJobAllow[playerid] = 1;
coalmine[playerid] = 0;
}//done and LAST
dini_Create(string);
dini_IntSet(string, "cash",[playerid]);
public OnPlayerDataSave(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] && gPlayerSpawned[playerid])
{
new string[256], playersip[64];
format(string, sizeof(string), "%s.ini", PlayerName(playerid));
GetPlayerIp(playerid, playersip, sizeof(playersip));
if(dini_Exists(string))
{
dini_Set(string, "Key", PlayerInfo[playerid][pKey]);
dini_Set(string, "IP", PlayerInfo[playerid][pIP]);
dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
dini_IntSet(string, "aDuty", PlayerInfo[playerid][aDuty]);
dini_IntSet(string, "aTog", PlayerInfo[playerid][aTog]);
dini_IntSet(string, "pMember", PlayerInfo[playerid][pMember]);
dini_IntSet(string, "pRank", PlayerInfo[playerid][pRank]);
dini_IntSet(string, "Banned", PlayerInfo[playerid][pBanned]);
dini_IntSet(string, "DonateRank", PlayerInfo[playerid][pDonateRank]);
dini_IntSet(string, "Registered", PlayerInfo[playerid][pReg]);
dini_IntSet(string, "Warnings", PlayerInfo[playerid][pWarns]);
dini_IntSet(string, "Cash", PlayerInfo[playerid][pCash]);
dini_IntSet(string, "Kills", PlayerInfo[playerid][pKills]);
dini_IntSet(string, "Deaths", PlayerInfo[playerid][pDeaths]);
dini_IntSet(string, "Muted", PlayerInfo[playerid][pMuted]);
dini_IntSet(string, "ReportMuted", PlayerInfo[playerid][prMuted]);
dini_IntSet(string, "ReportTimeMuted", PlayerInfo[playerid][ptrMuted]);
dini_IntSet(string, "TimeMuted", PlayerInfo[playerid][ptMuted]);
dini_IntSet(string, "VipMuted", PlayerInfo[playerid][pvMuted]);
dini_IntSet(string, "VipTimeMuted", PlayerInfo[playerid][pvtMuted]);
dini_IntSet(string, "FactionMuted", PlayerInfo[playerid][pfMuted]);
dini_IntSet(string, "FactionTimeMuted", PlayerInfo[playerid][pftMuted]);
dini_IntSet(string, "KillSpree", PlayerInfo[playerid][pSpree]);
dini_IntSet(string, "CWons", PlayerInfo[playerid][pCWons]);
dini_IntSet(string, "Hide", PlayerInfo[playerid][pHide]);
dini_IntSet(string, "pIgnorePM", PlayerInfo[playerid][pIgnorePM]);
dini_IntSet(string, "pJailed", PlayerInfo[playerid][pJailed]);
dini_IntSet(string, "pArrested", PlayerInfo[playerid][pArrested]);
dini_IntSet(string, "pCrimes", PlayerInfo[playerid][pCrimes]);
dini_IntSet(string, "pJail", PlayerInfo[playerid][pJail]);
dini_IntSet(string, "pJailTime", PlayerInfo[playerid][pJailTime]);
dini_IntSet(string, "Level", PlayerInfo[playerid][Level]);
dini_IntSet(string, "Exp", PlayerInfo[playerid][Exp]);
dini_IntSet(string, "pWantedDeaths", PlayerInfo[playerid][pWantedDeaths]);
}
}
}
return 1;
}
}
if(PlayerInfo[playerid][pReg] == 0)
{
PlayerInfo[playerid][pReg] = 1;
GivePlayerMoney(playerid, 500);
}
gPlayerLogged[playerid] = 1;
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SendClientMessage(playerid, 0x40FF40FF,"SERVER: Успешно влезе в акаунта си.");
format(string2, sizeof(string2), "Добре дошъл {00B700}%s", PlayerName(playerid));
SendClientMessage(playerid, COLOR_WHITE,string2);
GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 21);
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
{
new string[256];
new nxtlevel = PlayerInfo[playerid][Level]+1;
new expamount = nxtlevel*levelexp;
format(string, sizeof(string), "Админ Левел: %d | ВИП Левел: %d | Ниво: %d | XP: %d/%d | Организация: %s", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][Level], PlayerInfo[playerid][Exp], expamount, TeamInfo[PlayerInfo[playerid][pMember]][TeamName]);
SendClientMessage(playerid, COLOR_YELLOW,string);
}
return 1;
}