05.08.2011, 15:22
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new string[128]; if(dialogid == 2 ) { if(!response) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nScout\nGeneral/Commander\nAdmin", "Select", "Cancel"); TogglePlayerControllable(playerid, 0); } if(response) { if(listitem == 0) { SendClientMessage(playerid, COLOR_GREY, "You chose the assault as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = ASSAULT; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 31, 500); GivePlayerWeapon(playerid, 25, 100); SetPlayerSkin(playerid, 287); }else if(gTeam[playerid] == TEAM_GERMANY) { GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 31, 500); GivePlayerWeapon(playerid, 25, 100); SetPlayerSkin(playerid, 285); } else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } } if(listitem == 1) { if( rank[playerid] >= 1 ) { SendClientMessage(playerid, COLOR_GREY, "You chose the demolition as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = DEMOLITION; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { GivePlayerWeapon(playerid, 16, 50); GivePlayerWeapon(playerid, 36, 5); GivePlayerWeapon(playerid, 24, 200); SetPlayerSkin(playerid, 73); }else if(gTeam[playerid] == TEAM_GERMANY) { GivePlayerWeapon(playerid, 16, 50); GivePlayerWeapon(playerid, 36, 5); GivePlayerWeapon(playerid, 24, 200); SetPlayerSkin(playerid, 27); } else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } }else { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nScout\nGeneral/Commander", "Select", "Cancel"); TogglePlayerControllable(playerid, 0); SendClientMessage(playerid, COLOR_RED, "You need to be rank 1 to be able to use Demolition !"); } } if(listitem == 2) { SendClientMessage(playerid, COLOR_GREY, "You chose the sniper as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = SNIPER; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); SetPlayerSkin(playerid, 124); }else if(gTeam[playerid] == TEAM_GERMANY) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); SetPlayerSkin(playerid, 206); }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } } if(listitem == 3) { if(gTeam[playerid] == TEAM_JAPAN || gTeam[playerid] == TEAM_RUSSIA) { SendClientMessage(playerid, COLOR_GREY, "You cant be a pilot on russia or japan!"); TogglePlayerControllable(playerid, 1); return 1; } if(rank[playerid] >= 13) { SendClientMessage(playerid, COLOR_GREY, "You chose the pilot as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = PILOT; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 163); GivePlayerWeapon(playerid, 22, 50); } if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 284); GivePlayerWeapon(playerid, 22, 50); } } else { SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 3 to be a pilot!"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nScout\nGeneral/Commander", "Select", "Cancel"); TogglePlayerControllable(playerid, 0); } } } if(listitem == 4) { SendClientMessage(playerid, COLOR_GREY, "You chose the medic as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = MEDIC; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 275); GivePlayerWeapon(playerid, 23, 200); GivePlayerWeapon(playerid, 1, 1); SetPlayerSkin(playerid, 275); }else if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 70); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 23, 200); SetPlayerSkin(playerid, 70); } else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } } if(listitem == 5) { SendClientMessage(playerid, COLOR_GREY, "You chose the engineer as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = ENGINEER; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 179); GivePlayerWeapon(playerid, 27, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 29, 200); }else if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 50); GivePlayerWeapon(playerid, 27, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 29, 200); } else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } } if( listitem == 6 ) //pyro { if( rank[playerid] >= 4 ) { SendClientMessage(playerid, COLOR_GREY, "You chose the pyroman as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = PYRO; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 279); GivePlayerWeapon(playerid, 16, 20); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 23, 200); GivePlayerWeapon(playerid, 37, 550); }else if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 278); GivePlayerWeapon(playerid, 16, 20); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 23, 200); GivePlayerWeapon(playerid, 37, 250); }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } }else { SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 4 to be a pyroman!"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nScout\nGeneral/Commander", "Select", "Cancel"); TogglePlayerControllable(playerid, 0); } } if( listitem == 7 )//scout { if( rank[playerid] >= 1 ) { SendClientMessage(playerid, COLOR_GREY, "You chose the scout as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = SCOUT; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 128); SetPlayerArmour(playerid, 25); GivePlayerWeapon(playerid, 28, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 22, 200); } if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 202); SetPlayerArmour(playerid, 25); GivePlayerWeapon(playerid, 28, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 22, 200); }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 34, 200); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 24, 200); } }else { SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 1 to be a scout!"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nScout\nGeneral/Commander", "Select", "Cancel"); TogglePlayerControllable(playerid, 0); } } if(listitem == 8) { if(rank[playerid] >= 8) { SendClientMessage(playerid, COLOR_GREY, "You chose general (commander) as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = GENERAL; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 283); SetPlayerArmour(playerid, 95); GivePlayerWeapon(playerid, 31, 200); GivePlayerWeapon(playerid, 27, 200); GivePlayerWeapon(playerid, 28, 200); GeneralClass[playerid][1] = 1; } if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 288); SetPlayerArmour(playerid, 95); GivePlayerWeapon(playerid, 31, 200); GivePlayerWeapon(playerid, 27, 200); GivePlayerWeapon(playerid, 28, 200); GeneralClass[playerid][2] = 1; }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { GivePlayerWeapon(playerid, 31, 200); GivePlayerWeapon(playerid, 27, 200); GivePlayerWeapon(playerid, 28, 200); if(gTeam[playerid] == TEAM_RUSSIA) GeneralClass[playerid][3] = 1; if(gTeam[playerid] == TEAM_JAPAN) GeneralClass[playerid][4] = 1; } }else { SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 8 to be a general (commander)!"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nScout\nGeneral/Commander", "Select", "Cancel"); TogglePlayerControllable(playerid, 0); } } if( listitem == 9 ) // admin NOTE: general is 8 { if( adminlevel[playerid] > 0 ) { SendClientMessage(playerid, COLOR_GREY, "You chose the Admin as your class."); SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again."); gPlayerClass[playerid] = ADMIN; PickedClass[playerid] = 1; SetPlayerVirtualWorld(playerid, 0); TogglePlayerControllable(playerid, 1); SetPlayerColor(playerid, LIGHTGREEN); if(gTeam[playerid] == TEAM_USA) { SetPlayerSkin(playerid, 217); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 20000); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 22, 20000); } if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerSkin(playerid, 217); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 20000); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 22, 20000); }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN ) { SetPlayerSkin(playerid, 217); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 38, 20000); GivePlayerWeapon(playerid, 1, 1); GivePlayerWeapon(playerid, 22, 20000); } }else SendClientMessage(playerid, COLOR_RED, "Bye bye - You aren't admin !"); } }