06.09.2014, 09:56
Код:
if(dialogid == 5) { if(response == 1) { switch(listitem) { case 0://pilot { gTeam[playerid] = TEAM_CPILOT; SendClientMessage(playerid, COLOR_WHITE, "Welcome to the {1B8AE4}Civilian Pilot {FFFFFF}role. Type /help to view all commands related."); TogglePlayerControllable(playerid, 1); PlayerSpawned[playerid] = 1; UpdatePlayerColour(playerid); PurelySpawned[playerid] = 1; RespawnPlayer(playerid); } case 1://military { if(PInfo[playerid][TotalScore] > 49) { gTeam[playerid] = TEAM_MILITARY; SendClientMessage(playerid, COLOR_WHITE, "Welcome to the {1B8AE4}Military Pilot {FFFFFF}role. Type /help to view all commands related."); TogglePlayerControllable(playerid, 1); PlayerSpawned[playerid] = 1; UpdatePlayerColour(playerid); PurelySpawned[playerid] = 1; RespawnPlayer(playerid); } else { SendClientMessage(playerid, COLOR_ERROR, "You need 50+ score to select this role!"); ShowRole(playerid); return 1; 20411 } 20412 case 2://trucker { gTeam[playerid] = TEAM_TRUCKER; SendClientMessage(playerid, COLOR_WHITE, "Welcome to the {1B8AE4}TRUCKER {FFFFFF}role. Type /help to view all commands related."); TogglePlayerControllable(playerid, 1); PlayerSpawned[playerid] = 1; UpdatePlayerColour(playerid); PurelySpawned[playerid] = 1; RespawnPlayer(playerid); } } } } if(dialogid == 6) // Select statistics { if(response == 1) { switch(listitem) { case 0://Account stats { new title[128], text[512], VIPSTATUS[50], pIP[52], pEMAIL[52]; if(PInfo[LookingAtStats[playerid]][Vip] == 0) { VIPSTATUS = "Not VIP"; } else if(PInfo[LookingAtStats[playerid]][Vip] == 1) { VIPSTATUS = "VIP Member"; } if(LookingAtStats[playerid] == playerid) { format(pIP,sizeof(pIP),"%s",PInfo[playerid][IP]); } else { format(pIP,sizeof(pIP), "- Error -"); } if(LookingAtStats[playerid] == playerid) { format(pEMAIL,sizeof(pEMAIL),"%s",PInfo[playerid][Email]); } else { format(pEMAIL,sizeof(pEMAIL),"- Error -"); } format(title,sizeof(title),"{1B8AE4}Account Statistics(%s(%d))", PlayerName(LookingAtStats[playerid]), LookingAtStats[playerid]); format(text,sizeof(text),"{1B8AE4}[Account]\n{FFFFFF}Username: {1B8AE4}%s\n{FFFFFF}Register Date: {1B8AE4}%s\n{FFFFFF}Online Time: {1B8AE4}%d hours and %d minutes\n{FFFFFF}Last Login: {1B8AE4}%s\n{FFFFFF}IP Address: {1B8AE4}%s\n{FFFFFF}Email Address: {1B8AE4}%s\n{FFFFFF}VIP Status: {1B8AE4}%s", PlayerName(LookingAtStats[playerid]),PInfo[LookingAtStats[playerid]][RegisterDate],PInfo[LookingAtStats[playerid]][HoursPlayed],PInfo[LookingAtStats[playerid]][MinsPlayed],PInfo[LookingAtStats[playerid]][LastLogin],pIP,pEMAIL,VIPSTATUS); ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, title, text, "Done", ""); } case 1://General stats { new title[128], text[512]; format(title,sizeof(title),"{1B8AE4}General Statistics(%s(%d))", PlayerName(LookingAtStats[playerid]), LookingAtStats[playerid]); format(text,sizeof(text),"{1B8AE4}[Statistics]\n{FFFFFF}Callsign: {1B8AE4}%s\n{FFFFFF}Total Money: {1B8AE4}$%d\n{FFFFFF}Flights completed: {1B8AE4}%d\n{FFFFFF}Total earned from working: {1B8AE4}$%d\n{FFFFFF}Total earned for airline: {1B8AE4}$%d\n{FFFFFF}Total flights for airline: {1B8AE4}%d\n{FFFFFF}Total distance flown: {1B8AE4}%d miles", PInfo[LookingAtStats[playerid]][Callsign],PInfo[LookingAtStats[playerid]][Money],PInfo[LookingAtStats[playerid]][TotalJobs],PInfo[LookingAtStats[playerid]][EarntFromWorking],PInfo[LookingAtStats[playerid]][EarntForAirline],PInfo[LookingAtStats[playerid]][AirlineFlights],PInfo[LookingAtStats[playerid]][FlownDistance]); ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, title, text, "Done", ""); } case 2://Vehicle stats { new title[128], text[1024]; format(title,sizeof(title),"{1B8AE4}Vehicle Statistics(%s(%d)) [1/2]", PlayerName(LookingAtStats[playerid]), LookingAtStats[playerid]); format(text,sizeof(text),"{1B8AE4}[Vehicle Statistics]\n{FFFFFF}AT400: {1B8AE4}%d\n{FFFFFF}Andromada: {1B8AE4}%d\n{FFFFFF}Shamal: {1B8AE4}%d\n{FFFFFF}Dodo: {1B8AE4}%d\n{FFFFFF}Beagle: {1B8AE4}%d\n{FFFFFF}Nevada: {1B8AE4}%d\n{FFFFFF}Cropduster: {1B8AE4}%d\n{FFFFFF}Hydra: {1B8AE4}%d\n{FFFFFF}Hunter: {1B8AE4}%d\n{FFFFFF}Cargobob: {1B8AE4}%d", PInfo[LookingAtStats[playerid]][AT400F],PInfo[LookingAtStats[playerid]][ANDROF],PInfo[LookingAtStats[playerid]][SHAMALF],PInfo[LookingAtStats[playerid]][DODOF],PInfo[LookingAtStats[playerid]][BEAGLEF],PInfo[LookingAtStats[playerid]][NEVADAF],PInfo[LookingAtStats[playerid]][CROPDUSTERF], PInfo[LookingAtStats[playerid]][HYDRAF],PInfo[LookingAtStats[playerid]][HUNTERF],PInfo[LookingAtStats[playerid]][CARGOBOBF],PInfo[LookingAtStats[playerid]][SKIMMERF],PInfo[LookingAtStats[playerid]][STUNTF],PInfo[LookingAtStats[playerid]][MAVERICKF],PInfo[LookingAtStats[playerid]][PMAVERICKF],PInfo[LookingAtStats[playerid]][NMAVERICKF],PInfo[LookingAtStats[playerid]][RAINDANCEF]); ShowPlayerDialog(playerid, 9, DIALOG_STYLE_MSGBOX, title, text, "Next Page", "Cancel"); } } } else { return 1; } } if(dialogid == 9)//page 1/2 vehicle stats { if(response == 1) { new title[128], text[512]; format(title,sizeof(title),"{1B8AE4}Vehicle Statistics(%s(%d)) [2/2]", PlayerName(LookingAtStats[playerid]), LookingAtStats[playerid]); format(text,sizeof(text),"{FFFFFF}Skimmer: {1B8AE4}%d\n{FFFFFF}Stuntplane: {1B8AE4}%d\n{FFFFFF}Maverick: {1B8AE4}%d\n{FFFFFF}Police Maverick: {1B8AE4}%d\n{FFFFFF}News Maverick: {1B8AE4}%d\n{FFFFFF}Raindance: {1B8AE4}%d", PInfo[LookingAtStats[playerid]][SKIMMERF],PInfo[LookingAtStats[playerid]][STUNTF],PInfo[LookingAtStats[playerid]][MAVERICKF],PInfo[LookingAtStats[playerid]][PMAVERICKF],PInfo[LookingAtStats[playerid]][NMAVERICKF],PInfo[LookingAtStats[playerid]][RAINDANCEF]); ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, title, text, "Done", ""); } else { } } return 1; } public OnPlayerClickPlayer(playerid,new clickedplayerid, source) { LookingAtStats[playerid] =new clickedplayerid; ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Select statistics to show ..", "{1B8AE4}Account Statistics\n{FFFFFF}General Statistics\n{1B8AE4}Vehicle Statistics", "Choose", "Cancel"); return 1; }