Raised This Month: $ Target: $400
 0% 

[DELETED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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.
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