Raised This Month: $ Target: $400
 0% 

[SOLVED] KillStreak, Deathmsg_event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 03-05-2013 , 08:49   [SOLVED] KillStreak, Deathmsg_event
Reply With Quote #1

I made a killstreak record.
but It won't work, And I don't know why..
can someone help me check my code where I did wrong?
thanks is advance!!

new part:
PHP Code:
new kills[32] = {0,...}
new 
killstreakrecord[32] = {0,...}
new 
currentKS,KSrec
init part:
PHP Code:
register_event("DeathMsg","DeathMsg_event""a")
currentKS 0;
KSrec 0
Deathmsg_event part:
PHP Code:
public DeathMsg_event() {
    new 
killer_name[32], victim_name[32]
    
get_user_name(read_data(1),killer_name,31)
    
get_user_name(read_data(2),victim_name,31)
    new 
killer read_data(1)
    new 
victim read_data(2)

    
kills[killer] += 1;
    
kills[victim] = 0
    
    if (
kills[killer] > killstreakrecord[killer]) 
    {
        
killstreakrecord[killer] = kills[killer]; 
    }
    
currentKS kills[killer];
    
KSrec killstreakrecord[killer];
    
        
//debug
    
client_print(killer,print_chat,"[DEBUG] killstreak: %d killstreak Record: %d",kills[killer],killstreakrecord[killer]);
    
client_print(killer,print_chat,"[DEBUG] killstreak: %d killstreak Record: %d",currentKS,KSrec);
    return 
PLUGIN_CONTINUE;

When I test it even DEBUG msg is not apper.. where did i do wrong? thanks all the pros helping me...

sorry my bad english. ><



SOLVED:
I solved the problem myself.
__________________
Catch me on : @twitter

Last edited by wangbochiang; 03-06-2013 at 13:19. Reason: Solved the problem
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 03-05-2013 , 11:06   Re: KillStreak, Deathmsg_event
Reply With Quote #2

BUMP
really need some Pro help me with this...
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-05-2013 , 11:20   Re: KillStreak, Deathmsg_event
Reply With Quote #3

1. You're only allowed to bump all 14 days.
2. %d -> %i
__________________

Last edited by Kia; 03-05-2013 at 11:21.
Kia is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2013 , 11:46   Re: KillStreak, Deathmsg_event
Reply With Quote #4

Quote:
Originally Posted by Kia View Post
2. %d -> %i
Wrong, %d is perfect.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 03-05-2013 , 11:47   Re: KillStreak, Deathmsg_event
Reply With Quote #5

Quote:
Originally Posted by Kia View Post
1. You're only allowed to bump all 14 days.
2. %d -> %i
Sorry, I didn't notice the rules...
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
wangbochiang
Member
Join Date: Aug 2006
Location: Taiwan - Taichung
Old 03-05-2013 , 11:49   Re: KillStreak, Deathmsg_event
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Wrong, %d is perfect.
I've see all the Plugins about "KillStreak" searching on forum.
but still can't realize where I did wrong..
__________________
Catch me on : @twitter
wangbochiang is offline
Send a message via MSN to wangbochiang Send a message via Yahoo to wangbochiang Send a message via Skype™ to wangbochiang
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 03-05-2013 , 15:48   Re: KillStreak, Deathmsg_event
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Wrong, %d is perfect.
Why? I thought you use %i for integers.
__________________
Kia is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-05-2013 , 16:01   Re: KillStreak, Deathmsg_event
Reply With Quote #8

in Pawn, %d and %i are the same, both are for integer values.
__________________

Last edited by Arkshine; 03-05-2013 at 16:01.
Arkshine is offline
Old 03-05-2013, 17:03
wickedd
This message has been deleted by wickedd. Reason: Arkshine is correct
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-05-2013 , 17:14   Re: KillStreak, Deathmsg_event
Reply With Quote #9

wickedd, that's totally wrong. You can't put directly a string in as index, it doesn't make sense.
Please don't help if you don't know what you're doing, you will only confuse people.
__________________

Last edited by Arkshine; 03-05-2013 at 17:14.
Arkshine is offline
Old 03-05-2013, 17:18
wickedd
This message has been deleted by wickedd. Reason: nvm
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-05-2013 , 17:20   Re: KillStreak, Deathmsg_event
Reply With Quote #10

You advise : kills[killer_name] ; killer_name is a string. You can't do that. His original code is correct.
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:37.


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