AlliedModders

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

Shadowless 05-12-2018 10:02

[DELETED]
 
---

Bugsy 05-12-2018 12:53

Re: [HELP] Doping.amxx
 
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)



Celena Luna 05-12-2018 17:16

Re: [HELP] Doping.amxx
 
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

Black Rose 05-12-2018 20:04

Re: [HELP] Doping.amxx
 
Quote:

Originally Posted by Celena Luna (Post 2591918)
Error reason is unknow

Error reason is the capital K.

Bugsy 05-13-2018 11:10

Re: [HELP] Doping.amxx
 
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 :shock:


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

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