CaveJohnson wrote:
idk one idea I had was if we ignored a call to sm_vmenuselect if that player had used the command within the last 0.1 seconds or something.
I've got another menu idea that I'm gonna play around with as I develop the next-gen rp plugin.
why "unpacking" doesnt work
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
The Doggy wrote:
CaveJohnson wrote:
idk one idea I had was if we ignored a call to sm_vmenuselect if that player had used the command within the last 0.1 seconds or something.
I've got another menu idea that I'm gonna play around with as I develop the next-gen rp plugin.
Have an array of booleans, one boolean for each player basically.
If g_bBindFlags[client] == true then return Plugin_Handled and don't do anything else.
On sm_vmenuselect set g_bBindFlags[client] = true then create a 0.2 seconds timer that fires to set that flag back to false in 0.2 seconds.
This way any sm_vmenuselect commands caught before that timer triggers itself in 0.2 seconds will be ignored. Super ez.
Only create the timer if g_bBindFlags[client] is false. Don't do anything at all if it's true. Literally:
if(g_bBindFlags[client]) {
return Plugin_Handled;
}
g_bBindFlags[client] = true;
CreateTimer(0.2, SetBindFlagsFalse, client); //I'm a bit rusty but I think these are the params for CreateTimer
//everything else in the method happens here
And then your timer code:
SetBindFlagsFalse(Handle timer, int client) {
g_bBindFlags[client] = false;
}
My SM is a tad rusty so I might not have perfect code examples, but that is the gist of it. -
well we can talk about pseudo code all day long but i have went ahead and made drugs heal over time