Post: "Sleep" in VM_Notify?
06-02-2016, 12:32 PM #1
matrixmods
Pokemon Trainer
(adsbygoogle = window.adsbygoogle || []).push({}); So with my menu, basically it all runs out of VM_Notify but im having some problems with a couple of my functions as they require a few "sleeps" to run properly. For example spawning bots. I was just wondering if anyone has a simple fix for this or am i just going to have to make the bots function run differently so it will work
(adsbygoogle = window.adsbygoogle || []).push({});
06-02-2016, 12:41 PM #2
Originally posted by matrixmods View Post
So with my menu, basically it all runs out of VM_Notify but im having some problems with a couple of my functions as they require a few "sleeps" to run properly. For example spawning bots. I was just wondering if anyone has a simple fix for this or am i just going to have to make the bots function run differently so it will work


Don't use sleep, use ingame time
06-02-2016, 01:59 PM #3
Originally posted by matrixmods View Post
So with my menu, basically it all runs out of VM_Notify but im having some problems with a couple of my functions as they require a few "sleeps" to run properly. For example spawning bots. I was just wondering if anyone has a simple fix for this or am i just going to have to make the bots function run differently so it will work


In my sprx i have 3 separate functions,
-SpawnBot
-ChooseTeam
-ChooseClass

Using sleep in your sprx is a honest mistake used by alot of ppl. Just like calling a thread when you could Hook the menu and have it run a lot smoother.
Here is an example of how i call my function to Spawn Bots.


void SpawnBots(int amount) {
for(int i = 0; i < 18; i++) botEntitys = SV_AddTestClient(); }

void ChooseTeam(int* botArray, float time) {
time = (int)floor(time * 1000 + 0.5);
for(int i = 0; i < 18; i++) {
if (botArray != 0) {
Cmd_MenuResponse(botArray, 3, "autoassign");
}
}
}


void ChooseClass(int* botArray, float time) {
time = (int)floor(time * 1000 + 0.5);
for(int i = 0; i < 18; i++) {
if (botArray != 0) {
Sprintf(temp, "class%i, G_irand(0, 5));
Cmd_MenuResponse(botArray, 10, temp);
}
}
}

Then Call like this in your functions:
if (scroll == 1)
SpawnBots(3);
else if (scroll == 2)
ChooseTeam(botEntitys, 5);
else if (scroll == 3)
ChooseClass(botEntitys, 5);


Hopefully this helped Smile
06-03-2016, 09:47 AM #4
mrtn
Little One
Originally posted by MindOfAModder View Post

time = (int)floor(time * 1000 + 0.5);


This isn't even used lol

The following user thanked mrtn for this useful post:

John
06-03-2016, 02:50 PM #5
Originally posted by mrtn View Post
This isn't even used lol


Yeah I thought that at first but when I tried to take that out they wouldn't even choose a team or class so idc

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo