Raised This Month: $ Target: $400
 0% 

[DELETED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadowless
Member
Join Date: May 2018
Old 05-12-2018 , 10:02   [DELETED]
Reply With Quote #1

---

Last edited by Shadowless; 05-19-2019 at 06:39.
Shadowless is offline
Send a message via ICQ to Shadowless
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2018 , 12:53   Re: [HELP] Doping.amxx
Reply With Quote #2

Hizkaldir() is getting 1991 as the id argument and then it is erroring when passed to set_user_maxspeed(), client_print(), and doping[]. You need to add the player id to the task-id when creating the task and then subtract when using it on a player. You also do not need to call remove_task() within the called function on a task that only occurs once.

Also, add debug after your plugin in plugins.ini to get more details about the error.

Code:
set_task(20.0,"HizKaldir",1991) ... public Hizkaldir(id){     set_user_maxspeed(id, dopingsizhiz)     client_print(id,print_chat,"[WLG]: Doping effect.")     remove_task(1991)     doping[id] = false }

to

PHP Code:
set_task20.0 "HizKaldir" 1991 id )

...

public 
Hizkaldir(id)
{
    
id -= 1991

    set_user_maxspeed
(iddopingsizhiz)
    
client_print(id,print_chat,"[WLG]: Doping effect.")
    
//remove_task(1991)
    
doping[id] = false
}

//You should also add this any time you use set task on a player (except maybe when the interval is 0.1).
//Failure to do this will result in an error if a player disconnects between when set_task() is called and the 20 second interval.
public client_disconnectid )
{
    
remove_task(1991 id)

__________________

Last edited by Bugsy; 05-12-2018 at 12:56.
Bugsy is offline
Old 05-12-2018, 13:56
Shadowless
This message has been deleted by Shadowless.
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 05-12-2018 , 17:16   Re: [HELP] Doping.amxx
Reply With Quote #4

PHP Code:
public OyuncuHiz(id){  
    if(
is_user_alive(id) && entity_get_float(idEV_FL_maxspeed) != 1.0) {  
        new 
para cs_get_user_money(id
         
        if (
para >= get_pcvar_num(cvar_doping_fiyat)){ 
            
cs_set_user_money(idpara get_pcvar_num(cvar_doping_fiyat)) 
            
doping[id] = true 
            entity_set_float
(idEV_FL_maxspeeddopinghiz)  
            
emit_sound(idCHAN_AUTOdopingkullan1.0ATTN_NORM0PITCH_NORM
            new 
isim[32
            
get_user_name(idisim,31
            
ColorChat(0,NORMAL,"^4[WLG]:^1 ^3DOPING:^1 ^3%s^1 Is Under DOPING!",isim
            
ColorChat(id,NORMAL,"^4[WLG]:^1 ^3DOPING:^1 You have used Doping and have increased your speed!",isim
            
set_task(20.0"Hizkaldir"1991+id
        } 
        else { 
            
ColorChat(id,NORMAL,"^4[WLG]:^1 ^3DOPING:^1 Not enough money ^4to use^1 Doping. ^4Doping Price:^1 ^3%d^1 USD"get_pcvar_num(cvar_doping_fiyat)) 
            
emit_sound(idCHAN_AUTOupss1.0ATTN_NORM0PITCH_NORM
        } 
    }  


public 
Hizkaldir(id

    
id -= 1991 
     
    set_user_maxspeed
(iddopingsizhiz
    
client_print(id,print_chat,"[WLG]: Doping effect."
    
//remove_task(1991) 
    
doping[id] = false 

I just change
PHP Code:
set_task20.0 "HizKaldir" 1991 id 
=>
PHP Code:
set_task(20.0"Hizkaldir"1991+id
Error reason is unknow
__________________
My plugin:

Last edited by Celena Luna; 05-12-2018 at 17:18.
Celena Luna is offline
Old 05-12-2018, 17:56
Shadowless
This message has been deleted by Shadowless.
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-12-2018 , 20:04   Re: [HELP] Doping.amxx
Reply With Quote #6

Quote:
Originally Posted by Celena Luna View Post
Error reason is unknow
Error reason is the capital K.
__________________
Black Rose is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2018 , 11:10   Re: [HELP] Doping.amxx
Reply With Quote #7

Checking the called function name is actually one of the first things I checked and didn't notice a difference. I guess it's time for some glasses
__________________
Bugsy 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 04:35.


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