AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] My plugin bug (duel) (https://forums.alliedmods.net/showthread.php?t=188601)

Aooka 06-28-2012 08:28

[ Solved ] My plugin bug (duel)
 
Hello,

I've a problem with my code.
It's this code :

Spoiler


So i've got a lots of bug.

Like this : ( I've a screen )

1) First bug :
http://img77.xooimage.com/files/c/c/3/1-35e2062.jpg
It's not the name of the player but number. Always the same (91 and 65) ... WHy i dont know...


2) Second problem :
And an other problems : ( A screen too )
http://img76.xooimage.com/files/e/b/2/2-35e2069.jpg

So ... :S

Thanks all in advance :D

Ps: If someone say : My code is not optimized. It's not realy a problem now.
After yes but now i just want a code wich works good

<VeCo> 06-28-2012 08:30

Re: [ Request ] My plugin bug (duel)
 
Player names are strings, so you should use %s. %d is for integer numbers(like %i).

Aooka 06-28-2012 08:32

Re: [ Request ] My plugin bug (duel)
 
Oh yes lol.
a problem in less.
Thanks a lots VeCo

Backstabnoob 06-28-2012 08:32

Re: [ Request ] My plugin bug (duel)
 
Because you do not reset the glow anywhere back to normal.

Arkshine 06-28-2012 08:34

Re: [ Request ] My plugin bug (duel)
 
You use %d (decimal) instead of %s (string).

EDIT: Ninja'd.

Aooka 06-28-2012 08:37

Re: [ Request ] My plugin bug (duel)
 
Okay i do that :D

Thanks all i edit it ! :)

Aooka 06-28-2012 10:48

Re: [ Request ] My plugin bug (duel)
 
So summarize I still have to do :

- Check why only knife duel is running. So other duel do not work. Always a knife duel.
Please it's very important :)

And :

- Removing the glow with this function :
Code:
set_user_rendering( id , kRenderFxGlowShell , 0 , 0 , 0 , kRenderNormal , 25 );
I set it in the event new round (HLTV) function, but i want to set it directly when a player win the duel.

Thank you in advance and have a nice day all :D

hornet 06-28-2012 11:07

Re: [ Request ] My plugin bug (duel)
 
Why was it necessary to double post? Your question is not any more important than anyone elses - use the edit button.
HLTV event does not send a player index. It is also called before players spawn, therefore you should hook player spawn and then reset their standard rendering there.

Aooka 06-28-2012 11:18

Re: [ Request ] My plugin bug (duel)
 
No really i don't say "My question is more important than anyone elses".
Sorry for the double post. The next time i'll use edit button. :)

Hum yes i do that now. Thanks a lot.

So now it remains the most complex ! :D

Neeeeeeeeeel.- 06-28-2012 16:58

Re: [ Request ] My plugin bug (duel)
 
PHP Code:

enum _DUEL_TYPE {
     
DUEL_NONE = -,
     
DUEL_KNIFE ,
     
DUEL_DEAGLE ,
     
DUEL_SCOUT ,
     
DUEL_AWP ,
     
DUEL_HEGRENADE ,
     
DUEL_M3 ,
     
DUEL_M4A1 ,
     
DUEL_AK47 ,
     
DUEL_M249 
}; 

Is the same as
PHP Code:

enum _DUEL_TYPE {
     
DUEL_NONE = -,
     
DUEL_KNIFE ,
     
DUEL_DEAGLE ,
     
DUEL_SCOUT ,
     
DUEL_AWP ,
     
DUEL_HEGRENADE ,
     
DUEL_M3 ,
     
DUEL_M4A1 ,
     
DUEL_AK47 ,
     
DUEL_M249
 
}; 

And you can optimize it reading about multidimenciolal array constants & loops.
It's just a comment.


All times are GMT -4. The time now is 06:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.