Random Player event
So i am trying to make an improved version of DoD Ninja for a server that i play on but the feature that they wanted the most i cant seem to get to work, i am trying to get it so that a ninja is chosen every like 35 seconds but i cant seem to get it to work, when i enable the random niinja mode at first it gives me an error: ninjamod.sma::random_event (line 245)
PHP Code:
thanx for any help i receive |
Re: Random Player event
Did you notice that function is a infinite loop?
Anything that happens you call "random_event()" over and over again And can you give the full error? |
Re: Random Player event
i want it to be an infinite loop, i want it to pick a new ninja every 30 seconds then start over again but im not really sure where i went wrong in this section, the rest of my plugin works as i wanted it to, but this part i just dont get, i think it has something to do with the way i am using set_task()
|
Re: Random Player event
You want a new ninja every 30 seconds, do something like in plugin_init:
//Call findnewninja() funtion every 30 seconds set_task(30.0,"findnewninja",5132,"",0,"b") the way you did for infinite loop is too unstable... |
Re: Random Player event
what does the 5132 stand for, isnt that usually where the target for the function goes
|
Re: Random Player event
just put random numbers, it is the ID of the task
|
Re: Random Player event
so i did what you said but now i dont get ninja at all, but there are also no errors so this is probably a step forward
here are the parts of code that you will probably need PHP Code:
PHP Code:
PHP Code:
|
Re: Random Player event
Code:
Also you might want to add a variable to remember who the current ninja is, so you can remove their ninja powers once a new one has been selected? And what's the point in checking what team the person is on if you do the same thing either way?... |
Re: Random Player event
Thank you to both of you +karma
One comment for you pRED, you cant use random as a variable, so i just took out the o that worked like a charm, hopefully Hell Pheonix will allow me to Rerelease it with my new game modes that i made for a server i play on |
| All times are GMT -4. The time now is 06:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.