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

ProKreedz 2.31


Post New Thread Reply   
 
Thread Tools Display Modes
Aykay
Senior Member
Join Date: Jul 2009
Location: Australia
Old 05-16-2011 , 03:42   Re: ProKreedz 2.27
Reply With Quote #471

nucLeaR, could you add a Weapon 15 time? /wpn15
I scripted it on the kz-arg mod but it's a bit tricky on yours.

Just a top15 based on weapons times, ranked by time only, not weapon speed.

Or finish the /finish scripting?
__________________

Aykay is offline
Send a message via MSN to Aykay
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-17-2011 , 10:31   Re: ProKreedz 2.27
Reply With Quote #472

Finish was planned to be implemented in the new version, but as I mentioned before I stopped temporarily working on this plugin

About Wpn15, shouldn't be hard...

Header:
PHP Code:
new Float:Wpn_Tiempos[24]
new 
Wpn_AuthIDS[24][32]
new 
Wpn_Names[24][32]
new 
Wpn_Date[24][32]
new 
Wpn_CheckPoints[24]
new 
Wpn_GoChecks[24]
new 
Wpn_Weapons[24
PHP Code:
    register_clcmd("say /wpn15","WpnTop_show"
PHP Code:
public finish_climb(id)
{
    if (!
is_user_alive (id))
    {
        return;
    }
    
    if ( (
get_pcvar_num(kz_top15_authid) > 1) || (get_pcvar_num(kz_top15_authid) < 0) )
    {
        
ColorChat(id GREEN"[XJ]^x01 Top 15 is disabled.")
        return ;
    }

    new 
Floattimeauthid[32], weapon
    get_user_authid
(idauthid31)
    
time get_gametime() - timer_time[id]
    
show_finish_message(idtime)
    
timer_started[id] = false
    weapon
get_user_weapon(id);
    
    if (
gochecknumbers[id] == &&  !user_has_weapon(id,CSW_SCOUT) )
        
ProTop_update(idtime)
    else if (
gochecknumbers[id] > || user_has_weapon(id,CSW_SCOUT) )
        
NoobTop_update(idtimechecknumbers[id], gochecknumbers[id])
    else 
WpnTop_Update(idtimechecknumbers[id], gochecknumbers[id], weapon)


PHP Code:
public NoobTop_update(idFloat:timecheckpointsgochecksweapon
{
    new 
authid[32], name[32], thetime[32];
    
get_user_name(idname31);
    
get_user_authid(idauthid31);
    
get_time(" %d/%m/%Y "thetime31);
    new 
bool:Is_in_Wpn15
    Is_in_Wpn15 
false
    
    
for(new 015i++)
    {
        if( (
equali(Wpn_Names[i], name) && (get_pcvar_num(kz_top15_authid) == 0)) || (equali(Wpn_AuthIDS[i], authid) && (get_pcvar_num(kz_top15_authid) == 1)) )
        {
            
Is_in_Wpn15 true
        
}
    }
    
    for (new 
015i++)
    {
        new 
Float:slower time Wpn_Tiempos[i];
        new 
Float:faster Wpn_Tiempos[i] - time;
        new 
Float:noobtiempo Wpn_Tiempos[i]
        
        if( 
time Wpn_Tiempos[i])
        {
            new 
pos i
            
            
if ( get_pcvar_num(kz_top15_authid) == )
                while( !
equal(Wpn_Names[pos], name) && pos 15 )
                {
                    
pos++;
                }
            else if ( 
get_pcvar_num(kz_top15_authid) == 1)
                while( !
equal(Wpn_AuthIDS[pos], authid) && pos 15 )
                {
                    
pos++;
                }
            
            for (new 
posij--)
            {
                
formatex(Wpn_AuthIDS[j], 31Wpn_AuthIDS[j-1]);
                
formatex(Wpn_Names[j], 31Wpn_Names[j-1]);
                
formatex(Wpn_Date[j], 31Wpn_Date[j-1]);
                
Wpn_Tiempos[j] = Wpn_Tiempos[j-1]
                
Wpn_CheckPoints[j] = Wpn_CheckPoints[j-1]
                
Wpn_GoChecks[j] = Wpn_GoChecks[j-1]
                
Wpn_Weapon[j] = Wpn_Weapon[j-1]
            }
            
            
formatex(Wpn_AuthIDS[i], 31authid);
            
formatex(Wpn_Names[i], 31name);
            
formatex(Wpn_Date[i], 31thetime)
            
Wpn_Tiempos[i] = time
            Wpn_CheckPoints
[i] = checkpoints
            Wpn_GoChecks
[i] = gochecks
            Wpn_Weapons
[id] = weapon
            
            save_Wpn15
()
            
            if( 
Is_in_Wpn15 )
            {

                if( 
time noobtiempo )
                {    
                    new 
minFloat:sec;
                    
min floatround(fasterfloatround_floor)/60;
                    
sec faster - (60*min);
                    
ColorChat(idGREEN"[XJ]^x01 You improved your time by ^x03%02d:%s%.2f^x01"minsec 10 "0" ""sec);
                    if( (
1) == 1)
                    {
                        
client_cmd(0"spk woop")
                        
ColorChat(0GREEN"[XJ]^x01^x03 %s^x01 is now^x03 Leet^x01 in ^x04Weapons Top 15^x01" name);
                    }
                    else
                    {
                        
client_cmd(0"spk buttons/bell1")
                        
ColorChat(0GREEN"[XJ]^x01^x03 %s^x01 is now on place^x03 %d^x01 in ^x04Weapons Top 15^x01" name , (i+1));
                    }
                }    
            }
            else
            {
                if( (
1) == 1)
                {
                    
client_cmd(0"spk woop");
                    
ColorChat(0GREEN"[XJ]^x01^x03 %s^x01 is now^x03 Leet^x01 in ^x04Weapons Top 15^x01" name);
                }
                else
                {
                    
client_cmd(0"spk buttons/bell1");
                    
ColorChat(0GREEN"[XJ]^x01^x03 %s^x01 is now on place^x03 %d^x01 in ^x04Weapons Top 15^x01" name , (i+1));
                }
            }
            
            return;
        }

        if( (
equali(Wpn_Names[i], name) && (get_pcvar_num(kz_top15_authid) == 0)) || (equali(Wpn_AuthIDS[i], authid) && (get_pcvar_num(kz_top15_authid) == 1)) )
        {
            if( 
time noobtiempo )
            {
                
                new 
minFloat:sec;
                
min floatround(slowerfloatround_floor)/60;
                
sec slower - (60*min);
                
ColorChat(idGREEN"[XJ]^x01 You failed your time by ^x03%02d:%s%.2f^x01"minsec 10 "0" ""sec);
                return;
            }
        }
        
    }
}

public 
save_Wpn15()
{
    new 
mapname[33], profile[128]
    
get_mapname(mapname32)
    
formatex(profile127"%s/Wpn_%s.cfg"KZ_TOP15_DIRmapname)
    
    if( 
file_exists(profile) )
    {
        
delete_file(profile)
    }
   
    new 
Data[256];
    new 
fopen(profile"at")
    
    for(new 
015i++)
    {
        
formatex(Data255"^"%.2f^"   ^"%s^"   ^"%s^"   ^"%i^"   ^"%i^"   ^"%s^" ^n"Wpn_Tiempos[i], Wpn_AuthIDS[i], Wpn_Names[i],Wpn_CheckPoints[i], Wpn_GoChecks[i],Wpn_Date[i])
        
fputs(fData)
    }
    
fclose(f);
}

public 
read_Wpn15()
{
    new 
mapname[33], profile[128], prodata[256]
    
get_mapname(mapname32)
    
formatex(profile127"%s/Wpn_%s.cfg"KZ_TOP15_DIRmapname)
    
    new 
fopen(profile"rt" )
    new 
0
    
while( !feof(f) && 16)
    {
        
fgets(fprodata255)
        new 
totime[25], checks[5], gochecks[5]
        
parse(prodatatotime24Wpn_AuthIDS[i], 31Wpn_Names[i], 31,  checks4gochecks4Wpn_Date[i], 31weapon31// if you can't compile use Wpn_Weapons[i] instead of weapon and deletete the line where I said 'NOT SURE', but it will show CSW_ In front of the weapons and also big characters (CSW_AWP, CSW_KNIFE, CSW_DEAGLE)
        
Wpn_Tiempos[i] = str_to_float(totime)
        
Wpn_CheckPoints[i] = str_to_num(checks)
        
Wpn_GoChecks[i] = str_to_num(gochecks)
        
strtolower (strncpy (weaponWpn_Weapons[i], 4)) // NOT SURE
        
i++;
    }
    
fclose(f)
}

public 
WeaponTop_show(id)
{
    new 
buffer[2048], name[32], len

    len 
formatex(buffer2047"<body bgcolor=#3399FF><table width=100%% cellpadding=2 cellspacing=0 border=0>")
    
len += formatex(buffer[len], 2047-len"<tr  align=center bgcolor=#0052FF><th width=5%%> # <th width=35%% align=center> Player <th  width=20%%> Time  <th width=10%%> CP's <th width=10%%> GC's <th width=20%%> Weapon")
        
    for (new 
010i++) 
    {        
        if( 
Noob_Tiempos[i] > 9999999.0 
        {
            
len += formatex(buffer[len], 2047-len"<tr align=center%s><td> %d <td align=center> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? " bgcolor=#5DA5FF" " bgcolor=#3399FF", (i+1), """""""""")
        }

        else 
        {
            
name Noob_Names[i]
            new 
minutosFloat:segundos
            minutos 
floatround(Noob_Tiempos[i], floatround_floor)/60
            segundos 
Noob_Tiempos[i] - (60*minutos)
            
            
len += formatex(buffer[len], 2047-len"<tr align=center%s><td> %d <td align=center> %s <td> <b>%02d:%s%.2f <td> %d <td> %d <td> %s", ((i%2)==0) ? " bgcolor=#5DA5FF" " bgcolor=#3399FF", (i+1), Noob_Names[i], minutossegundos 10 "0" ""segundosNoob_CheckPoints[i], Noob_GoChecks[i], Noob_Date[i])
        }
    }
    
    
len += formatex(buffer[len], 2047-len"</table></body>")
    
len += formatex(buffer[len], 2047-len"<tr><Center><b><BR>Plugin created by p4ddY & nucLeaR")
        
    
show_motd(idbuffer"Weapon 10 Top")

    return 
PLUGIN_HANDLED


PS: Might be slight mistakes since I used replace.
PSS: Read the // I wrote at the last part
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.

Last edited by NucL3ra; 05-17-2011 at 10:49.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
Aykay
Senior Member
Join Date: Jul 2009
Location: Australia
Old 05-18-2011 , 01:59   Re: ProKreedz 2.27
Reply With Quote #473

Awesome, thanks - I'll try add it / fix it tonight.
__________________

Aykay is offline
Send a message via MSN to Aykay
Aykay
Senior Member
Join Date: Jul 2009
Location: Australia
Old 05-18-2011 , 02:01   Re: ProKreedz 2.27
Reply With Quote #474

Quote:
Originally Posted by NucL3ra View Post
Finish was planned to be implemented in the new version, but as I mentioned before I stopped temporarily working on this plugin.
Also, I scripted a /finish but I accidentally deleted the .sma. It was basically the same as /start but was trigged the first time the end timer was used.

Edit: Just tested the plugin, it can only be done using kz_strip_other_weapons 0, but then it saves it as a Noob15, because you have a scout. A function has to be made where you only keep your current weapon when starting the timer.
__________________


Last edited by Aykay; 05-18-2011 at 08:54.
Aykay is offline
Send a message via MSN to Aykay
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-18-2011 , 12:52   Re: ProKreedz 2.27
Reply With Quote #475

PHP Code:
public finish_climb(id)
{
    if (!
is_user_alive (id))
    {
        return;
    }
    
    if ( (
get_pcvar_num(kz_top15_authid) > 1) || (get_pcvar_num(kz_top15_authid) < 0) )
    {
        
ColorChat(id GREEN"[XJ]^x01 Top 15 is disabled.")
        return ;
    }

    new 
Floattimeauthid[32], weapon
    get_user_authid
(idauthid31)
    
time get_gametime() - timer_time[id]
    
show_finish_message(idtime)
    
timer_started[id] = false
    weapon
get_user_weapon(id);
    
    if (
gochecknumbers[id] == &&  !user_has_weapon(id,CSW_SCOUT) )
        
ProTop_update(idtime)
    else if ( (
gochecknumbers[id] > && user_has_weapon(id,CSW_SCOUT)) || (gochecknumbers[id] > && (user_has_weapon (id,CSW_KNIFE) || user_has_weapon(id,CSW_USP)) || (gochecknumbers[id] == && user_has_weapon (idCSW_SCOUT)) )
        
NoobTop_update(idtimechecknumbers[id], gochecknumbers[id])
    else 
        
WpnTop_Update(idtimechecknumbers[id], gochecknumbers[id], weapon)

But you need to make more things.

1) If you have other weapon, not strip the weapons and give usp+knife, but make a menu where you have 2 options.
1. Give Usp & Knife 2. Start the run with the current weapon.
If 1 , it makes what it does now
If 2, it uses the kz-arg codes to strip other waepons and give you only the current one.


2) Disable /usp command if you pressed 2. You can do this by giving the player a bool when he stars like weapontop[id]. So if (weapontop[id]) {ColorChat(id,GREEN, "You cannot get an usp in this run"; return PLUGIN_HANDLED;}

3) Disable /scout command if you pressed 2. Same as above

So you can clear the if command for top save above and it could be like:

PHP Code:
 if (gochecknumbers[id] == &&  !user_has_weapon(id,CSW_SCOUT) && !weapontop[id] )
        
ProTop_update(idtime)
    else if (
gochecknumbers[id] > || user_has_weapon(id,CSW_SCOUT) && !weapontop[id] )
        
NoobTop_update(idtimechecknumbers[id], gochecknumbers[id])
    else if (
weapontop[id])
         
WpnTop_Update(idtimechecknumbers[id], gochecknumbers[id], weapon
Shouldn't be hard, just work a little and you'll have your weapons top, but I won't add it, it's not quite required. I'll maybe add just the Menu and save the players' times in Noob 15, but not a special top.
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
FOUTA
Senior Member
Join Date: Nov 2010
Location: Lebanon
Old 05-19-2011 , 14:04   Re: ProKreedz 2.27
Reply With Quote #476

Can u post the default value of each one of them..?
Quote:
Originally Posted by Nucl3ra
CVars:
- kz_checkpoints <0/1> - Allows Checkpoints creation
- kz_cheatdetect <0/1> - Detects usage of noclip,hook and so to reset time
- kz_spawn_mainmenu <0/1> - Brings up Main Menu when player spawns
- kz_show_timer <0/1> - Shows timer on HUD (mm:ss)
- kz_chatorhud <0/1/2> - For CP, GC messages. 2 for HUD, 1for chat, 0 for none
- kz_hud_color <r g b> - red , green , blue with values <0-255>
- kz_other_weapons <0/1> - Allow /weapon command to spawn all the weapons
- kz_hook_prize <0/1> - Gives hook to each player that finishs the map
- kz_hook_sound <0/1> - Enables or disables the hook sound
- kz_hook_speed <speed> - Sets the hook speed. Default: 300.0
- kz_drop_weapons <0/1> - Allows players to drop weapons
- kz_remove_drops <0/1> - Remove dropped items (to avoid abusing/cheating)
- kz_use_radio <0/1> - Allows players to use radio
- kz_nvg <0/1> - Allows players to use Night Vision
- kz_nvg_colors <r g b> - red , green , blue - For Night Vision color
- kz_pause <0/1> - Allows players to use pauses during a climb
- kz_vip <0/1> - Either show or not VIP tag for admins in showscores
- kz_showkeys <0/1> - Enable or not the possibility you can see your keys and/or the players' you are spectating
- kz_semiclip <0/1> - Enable or not the semiclip (not only transparency)
- kz_respawn_ct <0/1> - Respawns CTs if they die
- kz_strip_other_weapons <0/1> - Strips or not different than USP and Knife when starting the time
- kz_spec_saves <0/1> - Saves the location where the player goes spec (and moves to it when you go CT again) and pauses your time (if it's started)
- kz_save_autostart <0/1> - Saves the last location when a player started his time and teleports him to that exact spot when he's typing /start
- kz_top15_authid <0/1> - 0 for Top sort by names (used mostly for non-steam servers), 1 for sorting by authid (aka steam id)

Last edited by FOUTA; 05-19-2011 at 15:59.
FOUTA is offline
renato127
Member
Join Date: Jan 2009
Location: Brazil, Rio de Janeiro
Old 05-19-2011 , 19:17   Re: ProKreedz 2.27
Reply With Quote #477

its on sma, or in kreedz.cfg
renato127 is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-20-2011 , 15:14   Re: ProKreedz 2.27
Reply With Quote #478

Indeed.
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 05-20-2011 , 17:34   Re: ProKreedz 2.27
Reply With Quote #479

Quote:

L 05/20/2011 - 23:28:49: Function "goFinish" was not found
L 05/20/2011 - 23:28:49: [AMXX] Displaying debug trace (plugin "prokreedz.amxx")
L 05/20/2011 - 23:28:49: [AMXX] Run time error 19: function not found
L 05/20/2011 - 23:28:49: [AMXX] [0] prokreedz.sma::plugin_init (line
L 05/20/2011 - 23:28:55: HudSyncObject -1 is invalid
L 05/20/2011 - 23:28:55: [AMXX] Displaying debug trace (plugin "prokreedz.amxx")
L 05/20/2011 - 23:28:55: [AMXX] Run time error 10: native error (native "ShowSyncHudMsg")
L 05/20/2011 - 23:28:55: [AMXX] [0] prokreedz.sma::kz_hud_message (line 1425)
L 05/20/2011 - 23:28:55: [AMXX] [1] prokreedz.sma::CheckPoint (line 1073)
[247cs-A]plowed : /cp
L 05/20/2011 - 23:28:56: HudSyncObject -1 is invalid
L 05/20/2011 - 23:28:56: [AMXX] Displaying debug trace (plugin "prokreedz.amxx")
L 05/20/2011 - 23:28:56: [AMXX] Run time error 10: native error (native "ShowSyncHudMsg")
L 05/20/2011 - 23:28:56: [AMXX] [0] prokreedz.sma::kz_hud_message (line 1425)
L 05/20/2011 - 23:28:56: [AMXX] [1] prokreedz.sma::GoCheck
with prokreedz.amxx ?
Tryd the sql one too and isnt working for me.
plowed is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-20-2011 , 18:52   Re: ProKreedz 2.27
Reply With Quote #480

Try now...
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
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 07:10.


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