AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sentry need to add validation! (https://forums.alliedmods.net/showthread.php?t=241520)

Xaleer 06-04-2014 17:28

Sentry need to add validation!
 
1 Attachment(s)
Server shutting down with errors, friend was told me: adding validation can fix it!

is_user_connected(id)

or

is_valid_ent(pEnt) // engine
pev_valid(pEnt) // fakemeta


help me to add it to source or prompt another solution please!




[18:41:13] L 06/04/2014 - 19:46:57: [FUN] Player out of range (0)
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] Displaying debug trace (plugin "sentry.amxx")
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] Run time error 10: native error (native "set_user_frags")
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] [0] sentry.sma::sentry_damagetoplayer (line 1165)
[18:41:13] L 06/04/2014 - 19:46:57: [AMXX] [1] sentry.sma::sentry_think (line 1055)
[18:41:14] L 06/04/2014 - 19:46:57: [FUN] Player out of range (0)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Displaying debug trace (plugin "sentry.amxx")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Run time error 10: native error (native "set_user_frags")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [0] sentry.sma::sentry_damagetoplayer (line 1165)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [1] sentry.sma::sentry_think (line 1055)
[18:41:14] L 06/04/2014 - 19:46:57: [FUN] Player out of range (0)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Displaying debug trace (plugin "sentry.amxx")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] Run time error 10: native error (native "set_user_frags")
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [0] sentry.sma::sentry_damagetoplayer (line 1165)
[18:41:14] L 06/04/2014 - 19:46:57: [AMXX] [1] sentry.sma::sentry_think (line 1055)
[18:41:14] L 06/04/2014 - 19:46:58: "allexan<454><STEAM_0:0:433405097><>" entered the game
[18:41:15] L 06/04/2014 - 19:46:59: "allexan<454><STEAM_0:0:433405097><>" joined team "TERRORIST"
[18:41:15] L 06/04/2014 - 19:46:59: "Gamer_Call_Of_Duty V 3.0<450><STEAM_0:0:1312103449><TERRORIST>" attacked "CS2=EVILZCS=RO [30]<452><STEAM_0:0:591780245><CT>" with "m4a1" (damage "20") (damage_armor "5") (health "80") (armor "95")
[18:41:16] L 06/04/2014 - 19:46:59: "Gamer_Call_Of_Duty V 3.0<450><STEAM_0:0:1312103449><TERRORIST>" attacked "CS2=EVILZCS=RO [30]<452><STEAM_0:0:591780245><CT>" with "m4a1" (damage "20") (damage_armor "4") (health "60") (armor "91")
[18:41:16] Host_Error: WriteDest_Parm: not a client
[18:41:16] L 06/04/2014 - 19:47:00: Podbot mm - Experience Data not saved - number of waypoints 0.
[18:41:16] L 06/04/2014 - 19:47:00: Podbot mm - Visibility Table not saved - number of Waypoints - 0.
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Begin re-reading plugins list: /home/panel/clients/8714/cstrike/addons/metamod/plugins.ini
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: NoSeeVar
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: AMX Mod X
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: POD-Bot mm
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: dproto_EF
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Read plugin config for: VoiceTranscoder
[18:41:16] L 06/04/2014 - 19:47:00: [META] ini: Finished reading plugins list: /home/panel/clients/8714/cstrike/addons/metamod/plugins.ini; Found 5 plugins
[18:41:16] L 06/04/2014 - 19:47:00: [META] dll: Updating plugins...
[18:41:16] L 06/04/2014 - 19:47:00: [META] dll: Finished updating 14 plugins; kept 5, loaded 0, unloaded 0, reloaded 0, delayed 0
[18:41:16] L 06/04/2014 - 19:47:00: "[KRC] XALEER<-1><><SPECTATOR>" disconnected
[18:41:16] Dropped [KRC] XALEER from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "HECHOCHbIu --> [21_UA]<-1><><CT>" disconnected
[18:41:16] Dropped HECHOCHbIu --> [21_UA] from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "Gamer_Call_Of_Duty V 3.0<-1><><TERRORIST>" disconnected
[18:41:16] Dropped Gamer_Call_Of_Duty V 3.0 from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "kazax<-1><><CT>" disconnected
[18:41:16] Dropped kazax from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "sasha shakyrin$$$<-1><><TERRORIST>" disconnected
[18:41:16] Dropped sasha shakyrin$$$ from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "::BT,FY::-Neks<-1><><TERRORIST>" disconnected
[18:41:16] Dropped ::BT,FY::-Neks from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "Piston<-1><><CT>" disconnected
[18:41:16] Dropped Piston from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "CILLER<-1><><CT>" disconnected
[18:41:16] Dropped CILLER from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "anton18russ<-1><><TERRORIST>" disconnected
[18:41:16] Dropped anton18russ from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "CS2=EVILZCS=RO [30]<-1><><CT>" disconnected
[18:41:16] Dropped CS2=EVILZCS=RO [30] from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "Neymar JR<-1><><TERRORIST>" disconnected
[18:41:16] Dropped Neymar JR from server
[18:41:16] Reason: Server shutting down
[18:41:16] L 06/04/2014 - 19:47:00: "allexan<-1><><TERRORIST>" disconnected
[18:41:16] Dropped allexan from server
[18:41:16] Reason: Server shutting down
[18:41:17] configstore.cpp (1256) : Assertion Failed: Saving local config store failed during shutdown
[18:41:17] Assert( Assertion Failed: Saving local config store failed during shutdown ):/home/buildbot/buildslave_steam/steam_rel_client_linux/build/src/clientdll/configstore.cpp:1256
[18:41:17]
[18:41:17] configstore.cpp (97) : Assertion Failed: ConfigStore (InstallConfigStore) is dirty, and being destroyed, we're discarding data
[18:41:17] L 06/04/2014 - 19:47:01: Server shutdown
[18:41:17] L 06/04/2014 - 19:47:01: Log file closed
[18:41:17] L 06/04/2014 - 19:47:01: FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client
[18:41:17]
[18:41:17] FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client

aron9forever 06-05-2014 00:04

Re: Sentry need to add validation!
 
can't look at source, if it's an entity use pev_valid
if it's a player check if he's connected and alive

Xaleer 06-06-2014 08:54

Re: Sentry need to add validation!
 
Quote:

Originally Posted by aron9forever (Post 2147013)
can't look at source, if it's an entity use pev_valid
if it's a player check if he's connected and alive


I don't know how to do this, please write me here)) error in lines 1055 and 1165...


if (!get_user_godmode(target) && hitRatio <= 0.0) {
line 1055 sentry_damagetoplayer(ent, sentryLevel, sentryOrigin, target)
}

----------------------------------------------------------------------------------------------------------------------------------------

if (newHealth <= 0) {
new targetFrags = get_user_frags(target) + 1
new owner = GetSentryPeople(sentry, OWNER)
new ownerFrags = get_user_frags(owner) + 1
set_user_frags(target, targetFrags) // otherwise frags are subtracted from victim for dying (!!)
line 1165 set_user_frags(owner, ownerFrags)
new contributors[3], moneyRewards[33] = {0, ...}
contributors[0] = owner
contributors[1] = GetSentryPeople(sentry, UPGRADER_1)
contributors[2] = GetSentryPeople(sentry, UPGRADER_2)
for (new i = SENTRY_LEVEL_1; i <= sentryLevel; i++) {
moneyRewards[contributors[i]] += g_SENTRYFRAGREWARDS[i]
}
for (new i = 1; i <= g_MAXPLAYERS; i++) {
if(!moneyRewards[i] || !is_user_connected(i) || cs_get_user_team(owner)!=cs_get_user_team(i)) continue
cs_set_user_money(i, cs_get_user_money(i) + moneyRewards[i])
if(cs_get_user_money(i)>16000) cs_set_user_money(i, 16000)
}

message_begin(MSG_ALL, g_msgDeathMsg, {0, 0, 0} ,0)
write_byte(owner)
write_byte(target)
write_byte(0)
write_string("sentry gun")
message_end()

scoreinfo_update(owner, ownerFrags, cs_get_user_deaths(owner), int:cs_get_user_team(owner))
set_msg_block(g_msgDeathMsg, BLOCK_ONCE)
}

aron9forever 06-06-2014 13:45

Re: Sentry need to add validation!
 
1 Attachment(s)
those errors are not crashing the server
this is: [18:41:17] FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client basically meaning MSG_ONES to non connected players

try this, if u have any more problems with runtimeerror add if(!is_user_connected(id)) before the line with the problem(remember to change id with what u need)

Xaleer 06-06-2014 19:48

Re: Sentry need to add validation!
 
1 Attachment(s)
Quote:

Originally Posted by aron9forever (Post 2147672)
those errors are not crashing the server
this is: [18:41:17] FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client basically meaning MSG_ONES to non connected players

try this, if u have any more problems with runtimeerror add if(!is_user_connected(id)) before the line with the problem(remember to change id with what u need)

Thanks, but there are some mistakes when i compiled:

sentry.sma(1205) : warning 209: function "sentry_damagetoplayer" should return a value

sentry.sma(1464) : warning 217: loose indentation

scripting\sentry.sma(1465) : warning 217: loose indentation


can you fix them please?


And i add my dhudmessage include to this post, because with this site I can not download the plugin, it produces errors, because he is old here.

Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/2/2/3/3/7/7/134189.attach(12) : fatal error 100: cannot read from file: "dhudmessage"

Compilation aborted.
1 Error.

aron9forever 06-07-2014 06:30

Re: Sentry need to add validation!
 
Quote:

Originally Posted by Xaleer (Post 2147785)
Thanks, but there are some mistakes when i compiled:

sentry.sma(1205) : warning 209: function "sentry_damagetoplayer" should return a value

sentry.sma(1464) : warning 217: loose indentation

scripting\sentry.sma(1465) : warning 217: loose indentation


can you fix them please?


And i add my dhudmessage include to this post, because with this site I can not download the plugin, it produces errors, because he is old here.

Plugin failed to compile! Please try contacting the author.
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/2/2/3/3/7/7/134189.attach(12) : fatal error 100: cannot read from file: "dhudmessage"

Compilation aborted.
1 Error.

those are simple warnings that can be ignored, the plugin will still run fine
first one means I didnt add a return to the end of the function
the others mean I've used bad spacing

Xaleer 06-07-2014 09:55

Re: Sentry need to add validation!
 
Quote:

Originally Posted by aron9forever (Post 2147907)
those are simple warnings that can be ignored, the plugin will still run fine
first one means I didnt add a return to the end of the function
the others mean I've used bad spacing

ok, Thank you! ;)

Xaleer 06-17-2014 10:52

Re: Sentry need to add validation!
 
Quote:

Originally Posted by aron9forever (Post 2147907)
those are simple warnings that can be ignored, the plugin will still run fine
first one means I didnt add a return to the end of the function
the others mean I've used bad spacing

Today again server is down ... With such errors:

[AMXX] Displaying debug trace (plugin "sentry.amxx")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] sentry.sma::sentry_detonate ( line 988 )
[AMXX] [1] sentry.sma::createsentryhead ( line 521 )

Do not know what it could be?

aron9forever 06-17-2014 13:41

Re: Sentry need to add validation!
 
go to the line, and add above the line if(!is_user_alive(id)) return PLUGIN_HANDLED

so if you have at lne 521
xxx
createsentryhead(id)
xxx

make it

xxx
if(!is_user_alive(id)) return PLUGIN_HANDLED
createsentryhead(id)
xxx


also check index, if it's not "id" and it's something like "target "player" "iplayer" or whatever, use that

Xaleer 06-17-2014 14:27

Re: Sentry need to add validation!
 
Quote:

Originally Posted by aron9forever (Post 2153153)
go to the line, and add above the line if(!is_user_alive(id)) return PLUGIN_HANDLED

so if you have at lne 521
xxx
createsentryhead(id)
xxx

make it

xxx
if(!is_user_alive(id)) return PLUGIN_HANDLED
createsentryhead(id)
xxx


also check index, if it's not "id" and it's something like "target "player" "iplayer" or whatever, use that

Sorry, but there is not so simple ... There are already conditions:

Code:

xxx
          if(!is_user_connected(creator))
          {
521                  sentry_detonate(ent, true, false)
                  return
          }
xxx

Code:

xxx
              // Put the last sentry in the deleted entity's place
              if(0 > (g_sentriesNum - 1) > MAXSENTRIES) return
988              g_sentries[i] = g_sentries[g_sentriesNum - 1]
xxx



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

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