Problem with setting boolean...
This is code from my SuperNade plugin:
Code:
Now when I am in the server by myself and I type /buy in chat my id is returned as "1", I know this because I had many client prints telliing me everything that was happening during testing, but later when I throw it, and pev() gets the owner, my id is returned as "0". so to remedy this problem I did HasSuperNade[id-1] = true; on buy function and it works fine, if I am only person in server. If others are tho, the person with id=1 can buy multiple nades per round, but everyone else cant, it isnt setting false correctly on them, what is the problem? |
Re: Problem with setting boolean...
i.e.: if your id #1, you can buy a nade throw it and buy another, if you have enough money.
but if you are not id #1, you can buy a nade throw it, and it keeps saying that you already have a nade, which means it is not placing it as false on other people. |
Re: Problem with setting boolean...
Code:
Why are you doing this? If pev_owner is returning zero, the perhaps it does not store the "owner" of the grenade in that field. Valid player indexs are 1-32. |
Re: Problem with setting boolean...
Quote:
Quote:
|
Re: Problem with setting boolean...
Probably your problem is here:
PHP Code:
PHP Code:
PHP Code:
since new bool:HasSuperNade[33] (in your plugin thread). An easier way it just to remove all the -1 in HasSuperNade[id-1]. |
Re: Problem with setting boolean...
ok both of you are wrong, sorry but have to say it. Organized is talking about the wrong boolean, the HasSuperNade bool is what I am tlaking about. It IS global. The reason it is not setting right was because my pev_owner, is returning "0", because the nade is already removed it cannot find an owner. So neither of your solutions will work. I have solved this problem already but thanks anyway.
And btw, this: Code:
|
Re: Problem with setting boolean...
Zenith77 had nailed it when he said:
Quote:
|
Re: Problem with setting boolean...
If you misunderstood me, I was pointing out the problem in the HasSuperNadearray.
|
Re: Problem with setting boolean...
I know but it wasnt the error you were thinking of, it was a problem with pev_owner, not the indexed array
|
| All times are GMT -4. The time now is 10:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.