wait time
hi, i want a plugin which paste a text after 10 seconds.
Example: /test -> client_print(id, print_chat, "Example") after 10 seconds -> client_print(id, print_chat, "Example2") Thxxxx |
Re: wait time
hi
1 - declare a variable so we can increase/decrease it's value when needed. 2 - register your command. 3 - before printing message, increase variable value by 1 (++) (decrease = (--) , then get variable value on client_print. after that set a task and put function in it. 1 - Code:
2 - Code:
Code:
results : Quote:
|
Re: wait time
And if i want to add different messages, like. "The score is X for Red", "The score is X for Blue" etc..(just a plain text not a score system).
Meaning just 3 times, or 4 times. Not infinite. |
Re: wait time
Then you will need to store messages in an array.
1- define array_size before creating array , so compiler will now which value is for which array. 2- declare a variable so we can increase/decrease it's value again. 3- store all messages that you want to print out in an array. 4- register your command 5- on "pre_test" function set g_test_variable value to ARRAY_SIZE and call "test" function once , then we will set our task. 6- on "test" function decrease variable value by 1 (--) then get variable value in client_print. 1- Code:
Code:
Code:
Code:
Code:
Code:
result : Quote:
Code:
if you didn't understand any part , feel free to ask. |
Re: wait time
Working with tasks is the good and only way. Since HLDS runs at a single core, Pawn does not have threads, and functions will execute in order. If Pawn had threads, looping until (gametime - delay) equals 0 would simulate a simple delay.
|
| All times are GMT -4. The time now is 17:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.