Raised This Month: $ Target: $400
 0% 

HELP Command goes moore than one Round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fireflasch7
Junior Member
Join Date: Feb 2015
Old 03-18-2015 , 14:27   HELP Command goes moore than one Round
Reply With Quote #1

Hi,
I am really new at scripting but i have following script
and i want that the command goes only once per round but i dont get it i can do it moore than one Round pls help me
Best Wishes Goof
#pragma semicolon 1

#include <sourcemod>

new bool:g_bCmdUsed[MAXPLAYERS+1];

public
OnPluginStart()
{
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
RegConsoleCmd("sm_wdh", Command_Wdh);
}

public
OnClientConnected(client)
{
if (
g_bCmdUsed[client]) {
g_bCmdUsed[client] = false;
}
}

public
OnClientDisconnect(client)
{
if (
g_bCmdUsed[client]) {
g_bCmdUsed[client] = false;
}
}

public
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new
i = 1; i <= MaxClients; i++) {
if (
g_bCmdUsed[i]) {
g_bCmdUsed[i] = false;
}
}
}

public
Action:Command_Wdh(client, args)
{
if (!
client) {
ReplyToCommand(client, "You cannot run this command through the server console.");
return
Plugin_Handled;
}

if (
GetClientTeam(client) == 2) {
if (
g_bCmdUsed[client]) {
ReplyToCommand(client, "You can run this command once per round only.");
return
Plugin_Handled;
}
if (!
IsPlayerAlive(client)) {
ReplyToCommand(client, "Only alive terrorists can run this command.");
return
Plugin_Handled;
}
PrintToChatAll("%N möchte die Ansagen wiederholt haben", client);
g_bCmdUsed = true;
} else {
ReplyToCommand(client, "Only alive terrorists can run this command.");
}

return
Plugin_Handled;
}
Fireflasch7 is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-18-2015 , 14:42   Re: HELP Command goes moore than one Round
Reply With Quote #2

Okay well for starters you double posted Im thinking one of your variables is invalid or just for some reason is being voided for some reason my computer is only loading half of your post but Ill take a peek later if it isn't resolved
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
Fireflasch7
Junior Member
Join Date: Feb 2015
Old 03-19-2015 , 13:40   Re: HELP Command goes moore than one Round
Reply With Quote #3

Hi,
that would be very nice sorry for the double post
Fireflasch7 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode