Raised This Month: $51 Target: $400
 12% 

array must be indexed ?


Post New Thread Reply   
 
Thread Tools Display Modes
undead52
Senior Member
Join Date: Dec 2016
Old 11-27-2017 , 15:58   Re: array must be indexed ?
Reply With Quote #21

1- first need to read killer
2- 1 plus for every kill for killer
3- if the killer frag is more bigger than buyuk, buyuk = killer frag(trying to find highest frag)
4-want to show player frag/ highest frag
undead52 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 11-27-2017 , 18:24   Re: array must be indexed ?
Reply With Quote #22

Quote:
Originally Posted by TheWhitesmith View Post
Man, I do not understand you. Please say what you need in steps like this:
1- Killer kills Victim
2- 1 XP is added to Killer stats
3- Hud shown to Victim showing Killer XP / Highest Score
4- etc...
I don't think he need anything realated with xp. He want to show in hud for every player his kills and kills of player with highest score.


TO author: show your gKill declarations?!

Last edited by KiLLeR.; 11-27-2017 at 18:26.
KiLLeR. is offline
undead52
Senior Member
Join Date: Dec 2016
Old 11-27-2017 , 23:31   Re: array must be indexed ?
Reply With Quote #23

PHP Code:
new gKill[32];
new 
buyuk 0;
new 
scor 0;


 public 
plugin_init()
 {
    
register_event("DeathMsg","event_death","a")        
 }

public 
hud(id){
 
    if(
scor == 1){
        
set_dhudmessage153204255,    -1.00.101.01.0 );
        
show_dhudmessage(id"[ %d / %d ]"gKill[Killer], buyuk)//
    
}
 
}

public 
event_death(id)
{
    if(
scor == 1){
        
        
        
Killer read_data(1)
        
gKill[Killer]++;

        
        if(
gKill[Killer] > buyuk){
                
            
buyuk gKill[Killer];
                
        }

    }
}  

set_task(0.1,"hud""b"
undead52 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 11-28-2017 , 06:46   Re: array must be indexed ?
Reply With Quote #24

Lolz this code is terrible. It even can't compile.
KiLLeR. is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-28-2017 , 07:29   Re: array must be indexed ?
Reply With Quote #25

Explain what on universe are you trying to do. You'll get some decent variations of script codes from most of active members.
https://forums.alliedmods.net/showthread.php?t=173124
__________________

Last edited by Relaxing; 11-28-2017 at 07:32. Reason: Suggestion.
Relaxing is offline
undead52
Senior Member
Join Date: Dec 2016
Old 11-28-2017 , 08:49   Re: array must be indexed ?
Reply With Quote #26

Quote:
Originally Posted by KiLLeR. View Post
Lolz this code is terrible. It even can't compile.
it compiled, im getting cancer, i shorten the code

Last edited by undead52; 11-28-2017 at 08:50.
undead52 is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-28-2017 , 12:17   Re: array must be indexed ?
Reply With Quote #27

Quote:
Originally Posted by undead52 View Post
it compiled, im getting cancer, i shorten the code
Please provide the full code or the full idea so we can help you with it. From what I understand you want to rank players by their score for each map. So why not using get_user_frags?
__________________
TheWhitesmith is offline
undead52
Senior Member
Join Date: Dec 2016
Old 11-28-2017 , 13:21   Re: array must be indexed ?
Reply With Quote #28

just tell me how to get player score. get_user_frags didnt work
something wrong ?

PHP Code:
public hud(id){
    
    if(
scor == 1){
        
set_dhudmessage153204255,    -1.00.101.01.0 );
    new 
Frag get_user_frags(id);
        
show_dhudmessage(id"[ %d / %d ]"Fragbuyuk)//
    
}
 


Last edited by undead52; 11-28-2017 at 13:47.
undead52 is offline
undead52
Senior Member
Join Date: Dec 2016
Old 11-30-2017 , 01:53   Re: array must be indexed ?
Reply With Quote #29

this work np
PHP Code:
public hud(){
    
    if(
scor == 1){

        
set_dhudmessage153255255, -1.00.101.01.0 );
        for( new 
ii 0ii szNumii++ ){
        
            new 
oyuncu2 players[ii]
            
            
show_dhudmessage(oyuncu2"[ %d / %d ]"gKill[ii][Count], buyuk)
        }
    }
}
    

public 
event_death()
{
    if(
scor == 1){
        
        new 
oyuncu;
        
        
Killer read_data(1)
        
        
get_user_name(Killerisimcharsmax(isim))
        
get_players(playersszNum)
        
        for( 
0szNumi++ ){
        
            
oyuncu players[i]
            
            
get_user_name(oyuncuisim2charsmax(isim2))
            if(
equali(isimisim2)){
            
                
gKill[i][Count]++;
            
            }
            
            
            if(
gKill[i][Count] > buyuk){
            
                
buyuk gKill[i][Count]
            
            }
        
        
        }

    }


Last edited by undead52; 11-30-2017 at 09:13.
undead52 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 11-30-2017 , 05:53   Re: array must be indexed ?
Reply With Quote #30

Your code is f*cking awful and it's not full code because this can't be compiled.

Last edited by KiLLeR.; 11-30-2017 at 05:53.
KiLLeR. is offline
Reply



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 20:05.


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