Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Ograniczone użycie komend


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
5 odpowiedzi w tym temacie

#1 knopers666

    Życzliwy

  • Użytkownik

Reputacja: 1
Nowy

  • Postów:23
  • Lokalizacja:Polska
Offline

Napisano 20.01.2013 15:36

Mam takie pytanie czy dało by rade ograniczyć komendy, że można użyć tylko np 3 razy na rundę.
Ps.Czemu nie mogę "hookować" round_start ?
/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <colors>
#define PLUGIN_VERSION "v1.0"
public Plugin:myinfo =
{
name = "ZM Kit",
author = "Knopers",
description = "Plugin dla snickersa",
version = "PLUGIN_VERSION",
url = ""
};
public OnPluginStart()
{
CreateConVar("sm_zmkit", PLUGIN_VERSION, "version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
HookEvent("player_spawn", Event_PlayerSpawn);
PrintToServer("[Knopers]Plugin wlanczony");
HookEvent("round_start", Event_RoundStart);
RegConsoleCmd("sm_m4a1", sm_m4a1);
RegConsoleCmd("sm_elite", sm_elite);
RegConsoleCmd("sm_deagle", sm_deagle);
RegConsoleCmd("sm_ak47", sm_ak47);
RegConsoleCmd("sm_m249", sm_m249);
RegConsoleCmd("sm_m3", sm_m3);
RegConsoleCmd("sm_p90", sm_p90);
RegConsoleCmd("sm_ump45", sm_ump45);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_hegrenade");
  GivePlayerItem(client, "weapon_smokegrenade");
}
}
public Action:Event_RoundStart(Handle:event, any:userid, args)
{
for(new client=1; client<=MaxClients; client++)
{
  if(!IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
   continue;
  if(GetClientTeam(client) > 1)
  {
   CPrintToChat(client, "{red}[KIT] {default}Granaty dodane do ekwipunku");
  }
}
}
public Action:sm_p90(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_p90");
    }

}
public Action:sm_ump45(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_ump45");
    }

}
public Action:sm_m249(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_m249");
    }

}
public Action:sm_ak47(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_ak47");
    }

}
public Action:sm_deagle(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_deagle");
    }

}
public Action:sm_elite(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_elite");
    }

}
public Action:sm_m4a1(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_m4a1");
    }

}
public Action:sm_m3(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
  GivePlayerItem(client, "weapon_m3");
    }

}

  • +
  • -
  • 0

#2 knopers666

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:23
  • Lokalizacja:Polska
Offline

Napisano 20.01.2013 16:51

Czy zna ktoś jakiś plugin, który takie coś ma w sobie ?

(nie mogłem edytować postu u góry)
  • +
  • -
  • 0

#3 knopers666

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:23
  • Lokalizacja:Polska
Offline

Napisano 20.01.2013 18:53

Wpadła na łatwiejszy pomysł tylko nie wiem jak go zrealizować.Chodzi o to, że po 30 sekundach od rozpoczęcia rundy nie można korzystać z komend.
  • +
  • -
  • 0

#4 Gość_21977_*

  • Gość

Reputacja: 0

Offline

Napisano 22.01.2013 03:02

Drugim parametrem eventu round_start jest nick gracza, nie jego numer identyfikacyjny.
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <colors>

#define PLUGIN_VERSION "v1.0"

public Plugin:myinfo =
{
name = "ZM Kit",
author = "Knopers",
description = "Plugin dla snickersa",
version = "PLUGIN_VERSION",
url = ""
};
public OnPluginStart()
{
CreateConVar("sm_zmkit", PLUGIN_VERSION, "version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
HookEvent("player_spawn", Event_PlayerSpawn);
PrintToServer("[Knopers]Plugin wlanczony");
HookEvent("round_start", Event_RoundStart);
RegConsoleCmd("sm_m4a1", sm_m4a1);
RegConsoleCmd("sm_elite", sm_elite);
RegConsoleCmd("sm_deagle", sm_deagle);
RegConsoleCmd("sm_ak47", sm_ak47);
RegConsoleCmd("sm_m249", sm_m249);
RegConsoleCmd("sm_m3", sm_m3);
RegConsoleCmd("sm_p90", sm_p90);
RegConsoleCmd("sm_ump45", sm_ump45);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_hegrenade");
GivePlayerItem(client, "weapon_smokegrenade");
}
}
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new client=1; client<=MaxClients; client++)
{
if(!IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
continue;
if(GetClientTeam(client) > 1)
{
CPrintToChat(client, "{red}[KIT] {default}Granaty dodane do ekwipunku");
}
}
}
public Action:sm_p90(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_p90");
}

}
public Action:sm_ump45(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_ump45");
}

}
public Action:sm_m249(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_m249");
}

}
public Action:sm_ak47(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_ak47");
}

}
public Action:sm_deagle(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_deagle");
}

}
public Action:sm_elite(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_elite");
}

}
public Action:sm_m4a1(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_m4a1");
}

}
public Action:sm_m3(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_m3");
}

}


Ograniczenie ma być dla gracza, czy wszystkich?

#5 knopers666

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:23
  • Lokalizacja:Polska
Offline

Napisano 22.01.2013 17:40

Dla wszystkich. *Edit

Użytkownik knopers666 edytował ten post 22.01.2013 17:40

  • +
  • -
  • 0

#6 Gość_21977_*

  • Gość

Reputacja: 0

Offline

Napisano 22.01.2013 21:17

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <colors>

#define PLUGIN_VERSION "v1.0"

new uses=0;

public Plugin:myinfo =
{
name = "ZM Kit",
author = "Knopers",
description = "Plugin dla snickersa",
version = "PLUGIN_VERSION",
url = ""
};
public OnPluginStart()
{
CreateConVar("sm_zmkit", PLUGIN_VERSION, "version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
HookEvent("player_spawn", Event_PlayerSpawn);
PrintToServer("[Knopers]Plugin wlanczony");
HookEvent("round_start", Event_RoundStart);
RegConsoleCmd("sm_m4a1", sm_m4a1);
RegConsoleCmd("sm_elite", sm_elite);
RegConsoleCmd("sm_deagle", sm_deagle);
RegConsoleCmd("sm_ak47", sm_ak47);
RegConsoleCmd("sm_m249", sm_m249);
RegConsoleCmd("sm_m3", sm_m3);
RegConsoleCmd("sm_p90", sm_p90);
RegConsoleCmd("sm_ump45", sm_ump45);
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) )
{
GivePlayerItem(client, "weapon_hegrenade");
GivePlayerItem(client, "weapon_smokegrenade");
}
}
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new client=1; client<=MaxClients; client++)
{
if(!IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
continue;
if(GetClientTeam(client) > 1)
{
CPrintToChat(client, "{red}[KIT] {default}Granaty dodane do ekwipunku");
}
}

uses=0;
}
public Action:sm_p90(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_p90");

++uses;
}

}
public Action:sm_ump45(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_ump45");

++uses;
}

}
public Action:sm_m249(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_m249");

++uses;
}

}
public Action:sm_ak47(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_ak47");

++uses;
}

}
public Action:sm_deagle(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_deagle");

++uses;
}

}
public Action:sm_elite(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_elite");

++uses;
}

}
public Action:sm_m4a1(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_m4a1");

++uses;
}

}
public Action:sm_m3(client, args)
{
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) > 1) && uses<3)
{
GivePlayerItem(client, "weapon_m3");

++uses;
}

}





Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych