AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] scoreboard (https://forums.alliedmods.net/showthread.php?t=99983)

One 08-11-2009 08:29

[SOLVED] scoreboard
 
hey,

i searched & searched for a tut how to edit the scoreboard.

i need for first to block death points. ( if player is dead , he become nothing.)
after this i want to add xx points to a player.after the player become xx points, i want to give other players -points. need just a mini part to give the points & blocks. i think i can do other things alone.

ty in adv.

Bugsy 08-11-2009 09:57

Re: scoreboard
 
This should be enough to get you started:
PHP Code:

register_event"ScoreInfo" "fw_EvScoreInfo" "a" );
register_event"DeathMsg" "fw_EvDeathMsg" "a" );

//ScoreInfo: Updates the scoreboard with the given player's Frags and Deaths.
public fw_EvScoreInfo()
{
    static 
idid read_data);
    static 
iFragsiFrags read_data);
    static 
iDeathsiDeaths read_data);
    
    
//if ( iFrags == 10 )
    //    set_user_frags( id , 30 );
}

//DeathMsg: Called when a player dies
public fw_EvDeathMsg()
{
    static 
iKilleriKiller read_data);
    static 
iVictimiVictim read_data);
    
    
//set_user_frags( iVictim , 0 );
    //set_user_deaths( iVictim , 0 );



One 08-11-2009 10:49

Re: scoreboard
 
WTF ???

set_user_deaths needs amxmodx right?

my includes :

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <fakemeta>
#include <cstrike>
#include <chr_engine>
#include <hamsandwich>
#include <screenfade_util>

error :

Error: Undefined symbol "set_user_deaths" on line 1478

ty ill try for test cs_set_user_deaths.



Bugsy 08-11-2009 10:49

Re: scoreboard
 
Sorry, use cs_set_user_deaths..

all you need for above is amxmodx, fun, cstrike

One 08-11-2009 10:55

Re: scoreboard
 
yup but why this not works ?

http://amxmodx.org/funcwiki.php?go=func&id=151

i mean this should be defined by amxmodx or not?

Bugsy 08-11-2009 10:58

Re: scoreboard
 
"This native is DEPRECATED and no longer available for use. "

There are fakemeta equivalents for both frags\deaths. fm_set_user_frags is already defined in fakemeta_util IIRC

One 08-11-2009 11:03

Re: scoreboard
 
Quote:

Originally Posted by Bugsy (Post 896346)
"This native is DEPRECATED and no longer available for use. "

There are fakemeta equivalents for both frags\deaths. fm_set_user_frags is already defined in fakemeta_util IIRC

yay. ty.

this is perfect now. i wanted to :


Code:

    message_begin(MSG_ALL,get_user_msgid("ScoreInfo"))
    write_byte(id)
    write_short(score[id][0]+(score[id-1][3]+3))
    write_short(score[id][2])
    write_short(0)
    write_short(get_user_team(id))
    message_end()

or somthing like this :D SOLVED.

Bugsy 08-11-2009 11:20

Re: [SOLVED] scoreboard
 
Easier to just set users frags\deaths IMO.

This can be a problem if id = 1. 0 is an invalid player id.
PHP Code:

write_short(score[id][0]+(score[id-1][3]+3)) 


One 08-11-2009 11:48

Re: [SOLVED] scoreboard
 
haha i think thats why my code not worked :)) ty again


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

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