Raised This Month: $ Target: $400
 0% 

SCript help, FIX Bug Please!!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-20-2017 , 12:40   SCript help, FIX Bug Please!!
Reply With Quote #1

Hi i have problem in this code of gunxp supply boxes
it spawn in the map and player get it and player it get it and get random xp from 1-500
and it write
[GunXP] you found 200 XP

and some times its write
[GunXP] you found 120 XP
[GunXP] you found 54XP

in same box whitch player found so what i mean
i mean when player found it , some times (not always give 2 casses) its give him 2 casses in same time so i wanna fix it and get always give 1 case mean [GunXP] you found ...XP not troubling in it and thanx .

PHP Code:
public round_end() 

    if(!
total_presents) return 
    
remove_all_presents() 


public 
round_start() 

    if(!
total_presents) return 
    
remove_task(1337
    
set_task(get_pcvar_float(spawn_time), "spawn_random_presents"1337__"b"


public 
spawn_random_presents() 

    new 
num random_num(get_pcvar_num(min_presents),get_pcvar_num(max_presents)) 
    if(
num != 0) for(new ii=0;ii<num;ii++) spawn_present(present_data[random(total_presents)]) 


public 
present_touch(ent,id)
{
    
give_random_present(entid);
    return 
0;
}
        
public 
give_random_present(ent,id
{
    new 
xp 0;
    
xp random_num(1500);
    
set_user_xp(idget_user_xp(id) + xp);
    
ColorChat(id,GREEN,"^x04[^x03GunXP^x04]^x01 You Found^x04 %i^x01 XP!"xp);
    
emit_sound(ent,CHAN_AUTO,"supplyboxes/presents_get.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM);
    
remove_entity(ent

__________________

Last edited by D3XT3R; 03-21-2017 at 05:07.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
 



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 17:50.


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