Junior Member
|
10-05-2017
, 01:40
Simon menu compling failed - help me
|
#2
|
Quote:
Hello , I tried to add a menu to this simon plugin bit i have error :
|
Quote:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
bool istheresimon = false;
bool issimon[MAXPLAYERS + 1] = false;
new Handle:g_cVar_mnotes = INVALID_HANDLE;
new Handle:g_fward_onBecome = INVALID_HANDLE;
new Handle:g_fward_onRemove = INVALID_HANDLE;
new Handle:g_fward_onGive = INVALID_HANDLE;
public Plugin myinfo = {
name = "Simon",
author = "Rinka",
description = "Simon Plugin",
version = "1.0",
url = "www.dust2.ro"
};
public void OnPluginStart()
{
RegConsoleCmd("sm_simon", Command_capitan, "Devii Simon.");
RegConsoleCmd("sm_leavesimon", Command_LeaveSimon, "Renunti la simon.");
RegAdminCmd("sm_box", Command_box, CS_TEAM_CT, "BOX")
RegAdminCmd("sm_stopbox", Command_stopbox, ADMFLAG_BAN, "STOPBOX")
HookEvent("round_start", round_start);
HookEvent("player_death", playerDeath);
RegAdminCmd("sm_givesimon", Command_GiveSimon, ADMFLAG_BAN);
g_fward_onGive = CreateGlobalForward("warden_OnWardenGived", ET_Ignore, Param_Cell);
}
public OnAvailableLR(Announced)
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_godjb1337 @ct 0");
ServerCommand("sm_mortal1337 @ct");
}
public Action:Round_End(Handle:event, const String:name[], bool:dB)
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_godjb1337 @ct 0");
ServerCommand("sm_mortal1337 @ct");
}
public Action round_start(Handle event , const String:name[] , bool dontBroadcast)
{
for (int i = 1; i<=MaxClients; i++)
{
if(issimon[i] && istheresimon)
{
issimon[i] = false;
istheresimon = false;
CS_SetClientClanTag(i, "");
}
}
}
public Action Command_capitan(client,args)
{
if(istheresimon && !issimon[client])
{
ReplyToCommand(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Exista deja un simon!");
return Plugin_Handled;
}
if(issimon[client])
{
ReplyToCommand(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Esti deja simon !");
return Plugin_Handled;
}
else
{
if(!issimon[client] && !istheresimon && GetClientTeam(client) == 3 && IsPlayerAlive(client))
{
PrecacheModel("models/player/custom_player/kuristaja/hitler/hitler.mdl");
SetEntityModel(client, "models/player/custom_player/kuristaja/hitler/hitler.mdl");
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x04%N \x01este noul simon!", client);
CS_SetClientClanTag(client, "★ Simon ★");
issimon[client] = true;
istheresimon = true;
}
}
return Plugin_Handled;
}
public Action Command_LeaveSimon(client, args)
{
if(issimon[client]) // The client is actually the current warden so lets proceed
{
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x01Simonul \x02%N \x01a demisionat!", client);
PrintCenterTextAll(" ★ Simonul %N a demisionat! ★", client);
PrintHintTextToAll(" ★ Simonul %N a demisionat! ★", client);
CS_SetClientClanTag(client, "");
issimon[client] = false; // Open for a new warden
istheresimon = false;
PrecacheModel("models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl");
SetEntityModel(client, "models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl"); // Lets remove the awesome color
}
else // Fake dude!
{
PrintToChat(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Nu esti simon ca sa renunti la el.");
}
}
public Action:Command_box(client, args)
{
if(issimon[client] && IsPlayerAlive(client) && GetClientTeam(client) == 3)
{
{
PrintToChatAll(" \x04★ BOX ★", client);
PrintCenterTextAll(" ★★★ BOX ★★★", client);
PrintHintTextToAll(" ★★★ BOX ★★★", client);
ServerCommand("mp_teammates_are_enemies 1");
ServerCommand("sm_godjb1337 @ct 1");
}
}
else
{
ReplyToCommand(client ," \x04★ \x01[\x04Jailbreak\x01] Nu esti simon, sau viu !");
}
return Plugin_Handled;
}
public Action:Command_stopbox(client, args)
{
if(issimon[client] && IsPlayerAlive(client) && GetClientTeam(client) == 3)
{
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_godjb1337 @ct 0");
ServerCommand("sm_mortal1337 @ct");
}
}
else
{
ReplyToCommand(client ," \x04★ \x01[\x04Jailbreak\x01] Nu esti simon, sau viu !");
}
return Plugin_Handled;
}
public Action:playerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid")); // Get the dead clients id
if(issimon[client]) // Aww damn , he is the warden
{
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x01Simonul \x02%N \x01a murit.", client);
PrintCenterTextAll(" ★ Simonul %N a murit ★", client);
PrintHintTextToAll(" ★ Simonul %N a murit ★", client);
CS_SetClientClanTag(client, "");
PrecacheModel("models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl");
SetEntityModel(client, "models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl"); // Lets give him the standard color back
issimon[client] = false; // Lets open for a new warden
istheresimon = false;
}
if(IsClientInGame(client) && GetClientTeam(client) == CS_TEAM_T) // Sets the T Team model
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_god @ct 0");
ServerCommand("sm_mortal @ct");
}
}
public Action Command_GiveSimon(client, args)
{
if(args != 1)
{
ReplyToCommand(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Usage: \x07sm_givesimon \x02<target>");
return Plugin_Handled;
}
char arg1[64];
GetCmdArg(1, arg1, sizeof(arg1));
int target = FindTarget(client, arg1, true, false); //Find the target(no bots, no immunity check)
if(GetClientTeam(target) == 3 && IsPlayerAlive(target))
{
istheresimon = false
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x02%N i-a dat simon lui \x02%N!", client, target);
PrintCenterTextAll("★ %N i-a dat simon lui %N! ★", client, target);
PrintHintTextToAll(" ★ %N i-a dat simon lui %N! ★", client, target);
PrecacheModel("models/player/custom_player/kuristaja/hitler/hitler.mdl");
SetEntityModel(target, "models/player/custom_player/kuristaja/hitler/hitler.mdl");
CS_SetClientClanTag(target, "★ Simon ★");
issimon[target] = true;
istheresimon = true;
Forward_OnWardenGived(target);
}
return Plugin_Handled;
}
public Forward_OnWardenGived(client)
{
Call_StartForward(g_fward_onGive);
Call_PushCell(client);
Call_Finish();
}
|
AND I DiD THAT
Quote:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
bool istheresimon = false;
bool issimon[MAXPLAYERS + 1] = false;
new Handle:g_cVar_mnotes = INVALID_HANDLE;
new Handle:g_fward_onBecome = INVALID_HANDLE;
new Handle:g_fward_onRemove = INVALID_HANDLE;
new Handle:g_fward_onGive = INVALID_HANDLE;
public Plugin myinfo = {
name = "Simon",
author = "Rinka",
description = "Simon Plugin",
version = "1.0",
url = "www.dust2.ro"
};
public void OnPluginStart()
{
RegConsoleCmd("sm_simon", Command_capitan, "Devii Simon.");
RegConsoleCmd("sm_leavesimon", Command_LeaveSimon, "Renunti la simon.");
RegConsoleCmd("sm_simonmenu", Command_SimonMenu, "Simon Menu");
RegConsoleCmd("sm_menu", Command_SimonMenu, "Simon Menu");
RegAdminCmd("sm_box", Command_box, CS_TEAM_CT, "BOX")
RegAdminCmd("sm_stopbox", Command_stopbox, ADMFLAG_BAN, "STOPBOX")
HookEvent("round_start", round_start);
HookEvent("player_death", playerDeath);
RegAdminCmd("sm_givesimon", Command_GiveSimon, ADMFLAG_BAN);
g_fward_onGive = CreateGlobalForward("warden_OnWardenGived", ET_Ignore, Param_Cell);
}
public OnMapStart()
{
Rounds = 0;
}
public Action:Round_End(Handle:event, const String:name[], bool:dB)
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_godjb1337 @ct 0");
ServerCommand("sm_mortal1337 @ct");
}
public Action round_start(Handle event , const String:name[] , bool dontBroadcast)
{
for (int i = 1; i<=MaxClients; i++)
{
if(issimon[i] && istheresimon)
{
issimon[i] = false;
istheresimon = false;
CS_SetClientClanTag(i, "");
}
}
{
if (++Rounds <= 3)
{
g_bCommandUsedDay[i] = false;
Rounds = 0;
}
}
}
public Action:Command_SimonMenu(client, args)
{
if(issimon[client])
{
Handle menu = CreateMenu(simonmenu, MENU_ACTIONS_ALL);
SetMenuTitle(menu, "Simon Menu");
AddMenuItem(menu, "opencell", "Open / Close Cell Doors");
if ((g_bCommandUsedDay[client]))
{
AddMenuItem(menu, "daysmenu", "Days Menu", ITEMDRAW_DISABLED);
PrintToChat(client, "Test");
}
else
{
g_bCommandUsedDay[client] = true;
AddMenuItem(menu, "daysmenu", "Days Menu");
}
AddMenuItem(menu, "reviveplayer", "Revive a player");
AddMenuItem(menu, "deliversimon", "Deliver Simon");
AddMenuItem(menu, "fdplayer", "Freeday a player");
AddMenuItem(menu, "ding", "Ding");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
else
{
PrintToChat(client, "★ \x04[Jailbreak] Nu esti simon pentru simon menu !");
}
}
public int simonmenu(Menu menu, MenuAction action, int param1, int param2)
{
switch (action)
{
case MenuAction_Select:
{
//param1 is client, param2 is item
new String:item[64];
GetMenuItem(menu, param2, item, sizeof(item));
if (!issimon[param1] && !istheresimon && GetClientTeam(param1) == 2 && GetClientTeam(param1) == 1)
{
CloseHandle(menu);
}
else
{
if (StrEqual(item, "opencell"))
{
SJD_ToggleDoors();
}
if (StrEqual(item, "daysmenu"))
{
DaysMenu(param1);
}
if (StrEqual(item, "deliversimon"))
{
DeliverSimon(param1);
}
else if (StrEqual(item, "reviveplayer"))
{
RevivePlayer(param1);
}
else if (StrEqual(item, "fdplayer"))
{
FDOne(param1);
}
else if (StrEqual(item, "ding"))
{
EmitSoundToAllAny("misc/ding.mp3");
}
}
}
//}
case MenuAction_End:
{
//param1 is MenuEnd reason, if canceled param2 is MenuCancel reason
CloseHandle(menu);
}
case MenuAction_DisplayItem:
{
//param1 is client, param2 is item
new String:item[64];
GetMenuItem(menu, param2, item, sizeof(item));
//if (StrEqual(item, "namecolor"))
//{
// new String:translation[128];
// Format(translation, sizeof(translation), "%T", "namecolor", param1);
// return RedrawMenuItem(translation);
//}
}
}
return 0;
}
public Action Command_capitan(client,args)
{
if(istheresimon && !issimon[client])
{
ReplyToCommand(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Exista deja un simon!");
return Plugin_Handled;
}
if(issimon[client])
{
ReplyToCommand(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Esti deja simon !");
return Plugin_Handled;
}
else
{
if(!issimon[client] && !istheresimon && GetClientTeam(client) == 3 && IsPlayerAlive(client))
{
PrecacheModel("models/player/custom_player/kuristaja/hitler/hitler.mdl");
SetEntityModel(client, "models/player/custom_player/kuristaja/hitler/hitler.mdl");
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x04%N \x01este noul simon!", client);
CS_SetClientClanTag(client, "★ Simon ★");
issimon[client] = true;
istheresimon = true;
}
}
return Plugin_Handled;
}
public Action Command_LeaveSimon(client, args)
{
if(issimon[client]) // The client is actually the current warden so lets proceed
{
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x01Simonul \x02%N \x01a demisionat!", client);
PrintCenterTextAll(" ★ Simonul %N a demisionat! ★", client);
PrintHintTextToAll(" ★ Simonul %N a demisionat! ★", client);
CS_SetClientClanTag(client, "");
issimon[client] = false; // Open for a new warden
istheresimon = false;
PrecacheModel("models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl");
SetEntityModel(client, "models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl"); // Lets remove the awesome color
}
else // Fake dude!
{
PrintToChat(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Nu esti simon ca sa renunti la el.");
}
}
public Action:Command_box(client, args)
{
if(issimon[client] && IsPlayerAlive(client) && GetClientTeam(client) == 3)
{
{
PrintToChatAll(" \x04★ BOX ★", client);
PrintCenterTextAll(" ★★★ BOX ★★★", client);
PrintHintTextToAll(" ★★★ BOX ★★★", client);
ServerCommand("mp_teammates_are_enemies 1");
ServerCommand("sm_godjb1337 @ct 1");
}
}
else
{
ReplyToCommand(client ," \x04★ \x01[\x04Jailbreak\x01] Nu esti simon, sau viu !");
}
return Plugin_Handled;
}
public Action:Command_stopbox(client, args)
{
if(issimon[client] && IsPlayerAlive(client) && GetClientTeam(client) == 3)
{
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_godjb1337 @ct 0");
ServerCommand("sm_mortal1337 @ct");
}
}
else
{
ReplyToCommand(client ," \x04★ \x01[\x04Jailbreak\x01] Nu esti simon, sau viu !");
}
return Plugin_Handled;
}
public Action:playerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid")); // Get the dead clients id
if(issimon[client]) // Aww damn , he is the warden
{
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x01Simonul \x02%N \x01a murit.", client);
PrintCenterTextAll(" ★ Simonul %N a murit ★", client);
PrintHintTextToAll(" ★ Simonul %N a murit ★", client);
CS_SetClientClanTag(client, "");
PrecacheModel("models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl");
SetEntityModel(client, "models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl"); // Lets give him the standard color back
issimon[client] = false; // Lets open for a new warden
istheresimon = false;
}
if(IsClientInGame(client) && GetClientTeam(client) == CS_TEAM_T) // Sets the T Team model
{
ServerCommand("mp_teammates_are_enemies 0");
ServerCommand("sm_god @ct 0");
ServerCommand("sm_mortal @ct");
}
}
public Action Command_GiveSimon(client, args)
{
if(args != 1)
{
ReplyToCommand(client, " \x04★ \x01[\x04Jailbreak\x01] \x01Usage: \x07sm_givesimon \x02<target>");
return Plugin_Handled;
}
char arg1[64];
GetCmdArg(1, arg1, sizeof(arg1));
int target = FindTarget(client, arg1, true, false); //Find the target(no bots, no immunity check)
if(GetClientTeam(target) == 3 && IsPlayerAlive(target))
{
istheresimon = false
PrintToChatAll(" \x04★ \x01[\x04Jailbreak\x01] \x02%N i-a dat simon lui \x02%N!", client, target);
PrintCenterTextAll("★ %N i-a dat simon lui %N! ★", client, target);
PrintHintTextToAll(" ★ %N i-a dat simon lui %N! ★", client, target);
PrecacheModel("models/player/custom_player/kuristaja/hitler/hitler.mdl");
SetEntityModel(target, "models/player/custom_player/kuristaja/hitler/hitler.mdl");
CS_SetClientClanTag(target, "★ Simon ★");
issimon[target] = true;
istheresimon = true;
Forward_OnWardenGived(target);
}
return Plugin_Handled;
}
public Forward_OnWardenGived(client)
{
Call_StartForward(g_fward_onGive);
Call_PushCell(client);
Call_Finish();
}
|
Last edited by PramPro; 10-05-2017 at 02:27.
|
|