20.09.2012, 21:01
pawn Код:
forward OnPlayerOfflineLogin(playername[]);
public OnPlayerOfflineLogin(playername[])
{
new string2[64];
format(string2, sizeof(string2), "Users/%s.ini", playername);
new File: UserFile = fopen(string2, io_read);
if(UserFile)
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while (fread(UserFile , Data , sizeof(Data)))
{
key = ini_GetKey(Data);
if(strcmp(key , "AdminLevel" , true) == 0) { val = Ini_Value(Data); AdminLevel = strval(val); }
if(strcmp(key ,"Cash", true) == 0) { val = Ini_Value(Data); Cash = strval(val); }
if(strcmp(key ,"Kills", true) == 0) { val = Ini_Value(Data); Kills = strval(val); }
if(strcmp(key ,"Deaths", true) == 0) { val = Ini_Value(Data); Deaths = strval(val); }
if(strcmp(key ,"Faction", true) == 0) { val = Ini_Value(Data); Faction = strval(val); }
if(strcmp(key ,"FactionRank", true) == 0) { val = Ini_Value(Data); FactionRank = strval(val); }
if(strcmp(key ,"FactionDivision", true) == 0) { val = Ini_Value(Data); FactionDivision = strval(val); }
if(strcmp(key ,"Skin", true) == 0) { val = Ini_Value(Data); Skin = strval(val); }
if(strcmp(key ,"PosX", true) == 0) { val = Ini_Value(Data); PosX = strval(val); }
if(strcmp(key ,"PosY", true) == 0) { val = Ini_Value(Data); PosY = strval(val); }
if(strcmp(key ,"PosZ", true) == 0) { val = Ini_Value(Data); PosZ = strval(val); }
if(strcmp(key ,"Level", true) == 0) { val = Ini_Value(Data); Level = strval(val); }
if(strcmp(key ,"Bank", true) == 0) { val = Ini_Value(Data); Bank = strval(val); }
if(strcmp(key ,"Job", true) == 0) { val = Ini_Value(Data); Job = strval(val); }
if(strcmp(key ,"TruckerSkill", true) == 0) { val = Ini_Value(Data); TruckerSkill = strval(val); }
if(strcmp(key ,"WeaponDealerSkill", true) == 0) { val = Ini_Value(Data); WeaponDealerSkill = strval(val); }
if(strcmp(key ,"Banned", true) == 0) { val = Ini_Value(Data); Banned = strval(val); }
if(strcmp(key ,"PlayingHours", true) == 0) { val = Ini_Value(Data); PlayingHours = strval(val); }
if(strcmp(key ,"Interior", true) == 0) { val = Ini_Value(Data); Interior = strval(val); }
if(strcmp(key ,"VirtualWorld", true) == 0) { val = Ini_Value(Data); VirtualWorld = strval(val); }
//if(strcmp(key , "IP" , true) == 0) { val = Ini_Value(Data); IP, val, 0, strlen(val)-1, 255); }
if(strcmp(key ,"Health", true) == 0) { val = Ini_Value(Data); Health = strval(val); }
if(strcmp(key ,"Armor", true) == 0) { val = Ini_Value(Data); Armor = strval(val); }
if(strcmp(key ,"Gun1", true) == 0) { val = Ini_Value(Data); Gun1 = strval(val); }
if(strcmp(key ,"Gun2", true) == 0) { val = Ini_Value(Data); Gun2 = strval(val); }
if(strcmp(key ,"Gun3", true) == 0) { val = Ini_Value(Data); Gun3 = strval(val); }
if(strcmp(key ,"Gun4", true) == 0) { val = Ini_Value(Data); Gun4 = strval(val); }
if(strcmp(key ,"Gun5", true) == 0) { val = Ini_Value(Data); Gun5 = strval(val); }
if(strcmp(key ,"Gun6", true) == 0) { val = Ini_Value(Data); Gun6 = strval(val); }
if(strcmp(key ,"Gun7", true) == 0) { val = Ini_Value(Data); Gun7 = strval(val); }
if(strcmp(key ,"Gun8", true) == 0) { val = Ini_Value(Data); Gun8 = strval(val); }
if(strcmp(key ,"Gun9", true) == 0) { val = Ini_Value(Data); Gun9 = strval(val); }
if(strcmp(key ,"Gun10", true) == 0) { val = Ini_Value(Data); Gun10 = strval(val); }
if(strcmp(key ,"Gun11", true) == 0) { val = Ini_Value(Data); Gun11 = strval(val); }
if(strcmp(key ,"Gun12", true) == 0) { val = Ini_Value(Data); Gun12 = strval(val); }
if(strcmp(key ,"Materials", true) == 0) { val = Ini_Value(Data); Materials = strval(val); }
if(strcmp(key ,"Wanted", true) == 0) { val = Ini_Value(Data); Wanted = strval(val); }
if(strcmp(key ,"TotalWanted", true) == 0) { val = Ini_Value(Data); TotalWanted = strval(val); }
if(strcmp(key ,"Jail", true) == 0) { val = Ini_Value(Data); Jail = strval(val); }
if(strcmp(key ,"Bail", true) == 0) { val = Ini_Value(Data); Bail = strval(val); }
if(strcmp(key ,"TotalDeliveries", true) == 0) { val = Ini_Value(Data); TotalDeliveries = strval(val); }
if(strcmp(key ,"Helper", true) == 0) { val = Ini_Value(Data); Helper = strval(val); }
}
fclose(UserFile);
}
}
pawn Код:
CMD:ocheck(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 3)
return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
return SendClientMessage(playerid,COLOR_WHITE, "You are not on admin duty, /aduty to go on duty as an admin.");
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ocheck [name]");
if(!doesAccountExist(params)) return SCM(playerid, -1, "Account does not exist.");
OnPlayerOfflineLogin(params);
new jtext[56];
switch(PlayerInfo[MAX_PLAYERS][pJob])
{
case 1: jtext = "Trucker";
case 2: jtext = "Bodyguard";
case 3: jtext = "Weapon Dealer";
default: jtext = "None";
}
SendClientMessage(playerid, COLOR_GREEN,"___________________________________________________________________________________________________");
new coordsstring[128];
format(coordsstring, sizeof(coordsstring),"%s - Level: %d - Playing hours: %d", params, Level, PlayingHours/1000/60);
SendClientMessage(playerid, COLOR_GREEN, coordsstring);
format(coordsstring, sizeof(coordsstring),"Faction: %s - Rank: %d - Division: %s - Job: %s", Faction, FactionRank, FactionDivision, jtext);
SendClientMessage(playerid, COLOR_GREEN, coordsstring);
format(coordsstring, sizeof(coordsstring),"Total wealth: $%d - Cash: $%d - Bank: $%d", Cash+Bank, Cash, Bank);
SendClientMessage(playerid, COLOR_GREEN, coordsstring);
format(coordsstring, sizeof(coordsstring),"Health: %.1f - Armor: %.1f",Health, Armor);
SendClientMessage(playerid, COLOR_GREEN, coordsstring);
format(coordsstring, sizeof(coordsstring),"Wanted Level: %d - Total Wanted: %d - Materials: %d ", Wanted, TotalWanted, Materials);
SendClientMessage(playerid, COLOR_GREEN, coordsstring);
format(coordsstring, sizeof(coordsstring), "Admin Level: %d - Banned: %d", AdminLevel, Banned);
SendClientMessage(playerid, COLOR_GREEN,coordsstring);
format(coordsstring, sizeof(coordsstring), "Interior: %d - Virtual World: %d - Jail: %d secs", Interior, VirtualWorld, Jail);
SendClientMessage(playerid, COLOR_GREEN,coordsstring);
SendClientMessage(playerid, COLOR_GREEN,"___________________________________________________________________________________________________");
return 1;
}