Quote:
Originally Posted by iskenderkebab33
!! no idear if this is correctly and working !! (some better Coder help)
my try:
PHP Code:
#include <sourcemod> #include <sdkhooks>
ConVar g_cvSomething;
public void OnPluginStart() { g_cvSomething= CreateConVar("sm_awpdeagle", "1", "Sets whether my plugin is enabled"); HookEvent("round_start", Event_Start); }
public void Event_Start(int iClient) { if (g_cvSomething.IntValue == 1) { SDKHook(iClient, SDKHook_PostThink, Cbk_OnPostThink); } }
public Action Cbk_OnPostThink(Event hEvent, const char[] sName, bool bDontBroadcast) { ServerCommand("mp_ct_default primary weapon_awp"); ServerCommand("mp_t_default primary weapon_awp"); ServerCommand("mp_ct_default_secondary weapon_deagle"); ServerCommand("mp_t_default_secondary weapon_deagle"); }
|
no, honey no....
let's start from the beginning (what's wrong with this code).
first of all, there's no client indexing, you can't do it in OnPluginStart (unless you loop through all players), neither can you have it in the function "HookEvent", since the arguments doesn't match the definition.
ough... same thing with the sdkhook, also the two first servercommands are incorrect