AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Speed Problem (https://forums.alliedmods.net/showthread.php?t=320917)

NooTy 01-15-2020 09:35

Speed Problem
 
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!"

HamletEagle 01-16-2020 04:19

Re: Speed Problem
 
So enable debug(add "debug" after the name of the plugin in plugins.ini).

NooTy 01-16-2020 05:08

Re: Speed Problem
 
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)

^SmileY 01-16-2020 07:00

Re: Speed Problem
 
Post wm_play.inc here, the problem is in this file.

NooTy 01-16-2020 07:14

Re: Speed Problem
 
#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 01-16-2020 07:16

Re: Speed Problem
 
L 01/16/2020 - 14:15:22: [AMXX] [0] ****.sma::rmvSpeed (line 1035)

^SmileY 01-16-2020 11:18

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

NooTy 01-16-2020 15:20

Re: Speed Problem
 
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 01-16-2020 15:21

Re: Speed Problem
 
I Discovered that the problem is not from the include file

^SmileY 01-17-2020 06:41

Re: Speed Problem
 
If you want to fix it, post required files to see what is the real problem.


All times are GMT -4. The time now is 08:28.

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