New round events + some other things
Im making my first serious plugin and i have my first serious problem.
Thing that plugin should do is finding user id and using in function called every round to add $. Amount of $ will be diffrent for every user. PHP Code:
|
Re: New round events + some other things
It's a global event so you have to use get_players() + for().
Also event has to be registered in plugin_init(). Code:
|
Re: New round events + some other things
If im not stupid, this will work same for every player?
Values will be readen from SQL, sometimes it will be 0... |
Re: New round events + some other things
You could set the money at ResetHUD event, so players can buy before the event roundstart.
Read this -tut- for more informations. |
Re: New round events + some other things
Thx for link.
So, i have modified my own code, and it works.. But, hm, i thought that it will work all the time for each other player, and i see that playa_id is still 6 (i have 6 players on the server)... so is whole idea dead? rawr... help me please! PHP Code:
Problem sloved using spawn detection. |
Re: New round events + some other things
With your code, player_id is always the id of the last player connected to your server (even if this player has left).
Also, return player_id is non sense in client_putinserver function. Either you use round_start event, and then take Arkshine's code that execute command through all alive players, either you use ResetHUD event. Look at this code, i hope you will understand Code:
|
Re: New round events + some other things
You don't understand.
'Round start' event is a global event. It happens after the freeze time. You have to retrieve the players list using get_players(). See my snippet above. But if you want to set money before the players start to buy weapons, you have to use 'new round' or 'reset hud' event. Code:
New Round is happen at the Freeze Time start. EDIT: @connor : Damn you. ;) |
Re: New round events + some other things
connor: "i hope you will understand"
arkshine "You don't understand." lol ;) Thanks for your support. I'm using VEN's code (http://forums.alliedmods.net/showthread.php?t=42159). I will (propably) have some more problems tommorow, cause it's only begginning of much bigger plugin. Listing of plugin (feel free to comment): PHP Code:
|
| All times are GMT -4. The time now is 01:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.