sdasdas Opublikowano Luty 15, 2018 o 15:27 Udostępnij Opublikowano Luty 15, 2018 o 15:27 Mam malutki problem, bo nie mam pomysłu jak zatrzymać wybór randomowej klasy dla VIP'a, gdy wybierze swoją klase z MENU To jest ten switch, ogólnie jest więcej kodu ale nie chce mi się wklejać :D int class = GetRandomInt(0, 3); switch(class) { case 0: { SetPlayerArms(client, "models/player/custom_player/zombie/crimsonhead/crimsonhead_arms.mdl"); SetEntityModel(client, "models/player/custom_player/zombie/crimsonhead/crimsonhead.mdl"); SetEntityGravity(client, 1.0); SetEntityHealth(client, 2000); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0); PrintToChat(client, " \x02•BaseBuilder• \x01Twoja Klasa To \x05Zombie!"); CS_SetClientClanTag(client, "Zombie"); } case 1: { SetPlayerArms(client, "models/player/custom_player/zombie/mummy/mummy_arms.mdl"); SetEntityModel(client, "models/player/custom_player/zombie/mummy/mummy.mdl"); SetEntityGravity(client, 0.6); SetEntityHealth(client, 1500); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0); PrintToChat(client, " \x02•BaseBuilder• \x01Twoja Klasa To \x05Jumper!"); CS_SetClientClanTag(client, "Jumper"); } case 2: { SetPlayerArms(client, "models/player/custom_player/zombie/revenant/revenant_arms.mdl"); SetEntityModel(client, "models/player/custom_player/zombie/revenant/revenant_v2.mdl"); SetEntityGravity(client, 1.1); SetEntityHealth(client, 3500); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 0.7); PrintToChat(client, " \x02•BaseBuilder• \x01Twoja Klasa To \x05Undead!"); CS_SetClientClanTag(client, "Undead"); } case 3: { SetPlayerArms(client, "models/player/custom_player/zombie/romeo_zombie/romeo_zombie_arms.mdl"); SetEntityModel(client, "models/player/custom_player/zombie/romeo_zombie/romeo_zombie.mdl"); SetEntityGravity(client, 0.8); SetEntityHealth(client, 1000); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 2.0); PrintToChat(client, " \x02•BaseBuilder• \x01Twoja Klasa To \x05Speeder!"); CS_SetClientClanTag(client, "Speeder"); } } A tu menu wyboru klasy VIP public Action CMD_Class(int client, int args) { #if defined DEBUG_LOG LogMessage("CMD_Class"); #endif if(GetClientTeam(client) == ZOMBIES) { Menu menu = new Menu(MenuHandler_ZombieClass); SetMenuTitle(menu, "Wybierz Klase VIP:"); AddMenuItem(menu, "0", "[VIP] Walker"); menu.Display(client, 10); } return Plugin_Continue; } public int MenuHandler_ZombieClass(Menu menu, MenuAction action, int client, int itemNum) { if ( action == MenuAction_Select && IsValidPlayer(client)) { char info[255]; GetMenuItem(menu, itemNum, info, sizeof(info)); char flags[40] = "p"; int vip = StringToInt(info); if(HasPlayerFlags(client, flags)) { switch(vip) { case 0: { SetPlayerArms(client, "models/player/custom_player/kuristaja/walker/walker_arms.mdl"); SetEntityModel(client, "models/player/custom_player/kuristaja/walker/walkerv2.mdl"); SetEntityGravity(client, 0.7); SetEntityHealth(client, 4000); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.5); PrintToChat(client, " \x02•BaseBuilder• \x01Twoja Klasa To \x05[VIP] Walker!"); CS_SetClientClanTag(client, "[VIP] Walker"); } } if(IsBuildTime() || IsPrepTime()) { CS_RespawnPlayer(client); } } else PrintToChat(client, " \x02•BaseBuilder• \x01Ooops, wyglada na to, ze nie posiadasz \x07VIP'a"); } else if (action == MenuAction_End) { CloseHandle(menu); } } Klasa się zmienia po wybraniu z menu tylko, że po tym automatycznie przydziela mu klasę z tych randomowych :/ A chce, żeby po wybraniu klasy z menu nie dawało już mu randomowych przez całą mape :) Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
sdasdas Opublikowano Luty 15, 2018 o 22:07 Autor Udostępnij Opublikowano Luty 15, 2018 o 22:07 Zaloguj się lub zarejestruj aby zobaczyć zawartość. 1 Podziękuj! Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi
Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto
Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.
Zarejestruj nowe konto
Załóż nowe konto. To bardzo proste!
Zarejestruj sięZaloguj się
Posiadasz już konto? Zaloguj się poniżej.
Zaloguj się