Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <cstrike>
- new bool:UseMenu[32] = false;
- new bool:Respawn[32] = false;
- new bool:Respawn2[32] = false;
- public Plugin myinfo =
- {
- name = "Vip DeathRun",
- author = "LukMcCall",
- description = "Vip DeathRun",
- version = "1.0",
- url = "http://www.cswild.pl/"
- };
- public void OnPluginStart()
- {
- RegConsoleCmd("vipmenu", Vip, "Otworz menu vipa");
- HookEvent("player_death", Event_PlayerDeath);
- HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
- }
- public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if((IsVip(client) && Respawn2[client] == true)){
- Respawn[client] = true;
- Respawn2[client] = false;
- CreateTimer(0.2, Resawn, client, 0);
- PrintToChat(client, "\x01 \x04[Vip] \x02Masz drugą szansę!");
- }
- }
- public Action:Resawn(Handle:timer, any:client)
- {
- CS_RespawnPlayer(client);
- }
- public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
- {
- PrintToServer("StartRundy");
- for(new i = 1; i<=31; i++){
- UseMenu[i] = false;
- Respawn[i] = false;
- Respawn2[i] = false;
- if(IsValidClient(i) && (IsVip(i))){
- SetEntPropFloat( i, Prop_Data, "m_flGravity", 1.0);
- SetEntPropFloat( i, Prop_Data, "m_flLaggedMovementValue", 1.0);
- if(GetClientTeam(i) == 3){
- Vip(i,0);
- }
- }
- }
- }
- public Action Vip(int client, int args)
- {
- if(IsVip(client))
- {
- if(UseMenu[client] == false){
- new Handle:h_menu = CreateMenu(VipMenu);
- SetMenuTitle(h_menu, "Vip Menu");
- AddMenuItem(h_menu, "gravity", "-30% Grawitacja");
- AddMenuItem(h_menu, "speed", "+50% Speeda");
- AddMenuItem(h_menu, "hp", "+50 Hp");
- AddMenuItem(h_menu, "armor", "+100 Armora");
- DisplayMenu(h_menu, client, 250);
- }
- else{
- PrintToChat(client, "\x01 \x04[Vip] \x02Użyłeś już menu!");
- }
- }
- else{
- PrintToChat(client, "\x01 \x04[Vip] \x02Nie masz dostępu do tej komendy!");
- }
- }
- public VipMenu(Handle:h_menu, MenuAction:action, Client, Position){
- if(action == MenuAction_Select){
- decl String:Item[20];
- GetMenuItem(h_menu, Position, Item, sizeof(Item));
- if(StrEqual(Item, "gravity")){
- SetEntPropFloat( Client, Prop_Data, "m_flGravity", 0.7);
- PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś -30%% Grawitacja");
- UseMenu[Client] = true;
- }
- else if(StrEqual(Item, "speed")){
- SetEntPropFloat( Client, Prop_Data, "m_flLaggedMovementValue", 1.5);
- PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś +50%% Speeda");
- UseMenu[Client] = true;
- }
- else if(StrEqual(Item, "hp")){
- SetEntProp(Client, Prop_Send, "m_iHealth", 150);
- PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś +50 Hp");
- UseMenu[Client] = true;
- }
- else if(StrEqual(Item, "armor")){
- SetEntProp(Client, Prop_Send, "m_ArmorValue", 100);
- PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś +100 Armora");
- UseMenu[Client] = true;
- }
- else if(StrEqual(Item, "life")){
- PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś 2x życie");
- Respawn2[Client] = true;
- UseMenu[Client] = true;
- }
- }else if(action == MenuAction_End){
- CloseHandle(h_menu);
- }
- }
- public bool:IsValidClient(client)
- {
- if (client <= 0 || client > MaxClients || !IsClientConnected(client) || IsFakeClient(client))
- {
- return false;
- }
- return IsClientInGame(client);
- }
- public bool:IsVip(client)
- {
- if(GetUserFlagBits(client) & ADMFLAG_CUSTOM6 ) return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement