Raised This Month: $32 Target: $400
 8% 

Speed Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NooTy
Member
Join Date: Sep 2019
Old 01-15-2020 , 09:35   Speed Problem
Reply With Quote #1

HI
I Have Problem IN This Code
Code:
public fw_CmdStart(id) {
if ((is_user_alive( id ) && get_user_weapon( id ) == CSW_KNIFE) && (pev(id, pev_button) & IN_ATTACK)) {
	    set_user_maxspeed(id, 900.0)
	    client_cmd(id, "+forward")
	    set_task(0.3,"rmvSpeed")
	    
}
    return PLUGIN_HANDLED
}
public rmvSpeed(id) {
    client_cmd(id, "-forward")
    set_user_maxspeed(id,320.0)
}
The Problem When I Attack then it stop the speed stills (900.0) And It Says in Console
"(native "set_user_maxspeed") - debug not enabled!"

Last edited by NooTy; 01-15-2020 at 09:35.
NooTy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-16-2020 , 04:19   Re: Speed Problem
Reply With Quote #2

So enable debug(add "debug" after the name of the plugin in plugins.ini).
__________________

Last edited by HamletEagle; 01-16-2020 at 04:19.
HamletEagle is offline
NooTy
Member
Join Date: Sep 2019
Old 01-16-2020 , 05:08   Re: Speed Problem
Reply With Quote #3

it shows

Quote:
L 01/16/2020 - 12:08:57: [AMXX] Run time error 10: native error (native "set_user_maxspeed")
L 01/16/2020 - 12:08:57: [AMXX] [0] wm_play.inc::rmvSpeed (line 929)

Last edited by NooTy; 01-16-2020 at 05:09.
NooTy is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-16-2020 , 07:00   Re: Speed Problem
Reply With Quote #4

Post wm_play.inc here, the problem is in this file.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
NooTy
Member
Join Date: Sep 2019
Old 01-16-2020 , 07:14   Re: Speed Problem
Reply With Quote #5

#if defined _wm_play_included
#endinput
#endif
#define _wm_play_included

// Author
#define AUTHOR "CrAzY MaN"

// Plugins Tag
#define wmPrefix "XP_System"

// Max players defined
#define MAX_PLAYERS 32

// Menu Line
#define xLineMenu "------------------------------------"

// Menu Create
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|M ENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|ME NU_KEY_9|MENU_KEY_0

/*------------------------------------------------------------------------------------------
OFFESETS
--------------------------------------------------------------------------------------------*/
#define OFFSET_CS_TEAMS 114
#define OFFSET_LINUX 5

enum
{
FM_CS_TEAM_UNASSIGNED = 0,
FM_CS_TEAM_T,
FM_CS_TEAM_CT,
FM_CS_TEAM_SPECTATOR
}

/*------------------------------------------------------------------------------------------
CHAT COLOR
--------------------------------------------------------------------------------------------*/
stock client_print_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "!t2", "^0")

if (id) players[0] = id; else get_players(players, count, "ch")

for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}

/*------------------------------------------------------------------------------------------
Register commands for Say, for Time and Say normal
--------------------------------------------------------------------------------------------*/
stock register_say(szSay[], szFunction[])
{
new szTemp[64]
formatex(szTemp, 63 , "say /%s", szSay)
register_clcmd(szTemp, szFunction)

formatex(szTemp, 63 , "say .%s", szSay)
register_clcmd(szTemp, szFunction)

formatex( szTemp, 63 , "say_team /%s", szSay)
register_clcmd(szTemp, szFunction )

formatex( szTemp, 63 , "say_team .%s", szSay)
register_clcmd(szTemp, szFunction)
}

/*------------------------------------------------------------------------------------------
Precache models automatically
--------------------------------------------------------------------------------------------*/
stock precache_player_model(const modelname[])
{
static longname[128]
formatex(longname, charsmax(longname), "models/player/%s/%s.mdl", modelname, modelname)
precache_model(longname)

copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl")
if (file_exists(longname)) precache_model(longname)
}

/*------------------------------------------------------------------------------------------
GET USER TEAM (FIX)
--------------------------------------------------------------------------------------------*/
stock fm_cs_get_user_team(id)
return get_pdata_int(id, OFFSET_CS_TEAMS, OFFSET_LINUX)
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
NooTy is offline
NooTy
Member
Join Date: Sep 2019
Old 01-16-2020 , 07:16   Re: Speed Problem
Reply With Quote #6

L 01/16/2020 - 14:15:22: [AMXX] [0] ****.sma::rmvSpeed (line 1035)
NooTy is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-16-2020 , 11:18   Re: Speed Problem
Reply With Quote #7

This is not original included provided by error log line. Post full include & sma code in a code tag.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
NooTy
Member
Join Date: Sep 2019
Old 01-16-2020 , 15:20   Re: Speed Problem
Reply With Quote #8

public fw_CmdStart(id) {
if ((skmode[id] && is_user_alive( id ) && get_user_weapon( id ) == CSW_KNIFE) && (pev(id, pev_button) & IN_ATTACK)) {
set_user_maxspeed(id, 900.0)
client_cmd(id, "+forward")
set_task(0.3,"rmvSpeed")

}
return PLUGIN_CONTINUE
}
public rmvSpeed(id) {

client_cmd(id, "-forward")
set_user_maxspeed(id,320.0)

return PLUGIN_CONTINUE
}
NooTy is offline
NooTy
Member
Join Date: Sep 2019
Old 01-16-2020 , 15:21   Re: Speed Problem
Reply With Quote #9

I Discovered that the problem is not from the include file
NooTy is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-17-2020 , 06:41   Re: Speed Problem
Reply With Quote #10

If you want to fix it, post required files to see what is the real problem.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Reply


Thread Tools
Display Modes

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 03:38.


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