AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Little help with debug (https://forums.alliedmods.net/showthread.php?t=17094)

Sp4rt4n 08-25-2005 17:36

Little help with debug
 
ok, this plugin compiles with no warnings, no errors, and runs fine, but in the server console, i get these two things:

'invalid player 1' on line 2424, heres the function with line 2424 in it, the set_user_hitzones line is the error line:

Code:
public evade_loop() {     if (!Dragoneye()) return     for (new a = 1; a <= PLAYERS; a++) {         if (assassin[a] && pskills5[a] > 0 && automagic[a][ AMid[a] ] == 12 && is_user_alive(a) && get_user_armor(a) >= 1) {             set_evade(a)             set_user_armor(a, get_user_armor(a) - 1)         }         else {             set_user_hitzones(0, a, 255)         }     } }

and i get 'invalid player id 24' on line 1558, heres the function, the new clip, ammo (etc) line is the error line:

Code:
public check_speed() {     for (new s = 1; s <= PLAYERS; s++) {                 new clip, ammo, wpnid = get_user_weapon(s,clip,ammo)         if (is_user_alive(s) && Dragoneye()) {             if (frozen[s][0] == 1 && is_user_alive(s) && frozen[s][1] > 0) {                 new freezer = frozen[s][1]                 set_user_maxspeed(s, maxSpeed[s] - pskills2[freezer] * 40)                 render_user(s,0,20,40)                      }             else if (frozen[s][0] == 1 && is_user_alive(s) && frozen[s][1] == -1) {                 set_user_maxspeed(s, maxSpeed[s] - 100)                 render_user(s,0,20,40)             }             else if (frozen[s][0] == 1 && is_user_alive(s) && frozen[s][1] == -2) {                 set_user_maxspeed(s, maxSpeed[s] - 80)                 render_user(s,0,20,40)             }             else if (frozen[s][0] == 0 && wpnid == CSW_KNIFE && is_user_alive(s) && assassin[s] && maxSpeed[s] > 210.0) {                 set_user_maxspeed(s, maxSpeed[s])                 render_user_off(s)             }             else if (frozen[s][0] == 0 && wpnid != CSW_KNIFE && is_user_alive(s) && assassin[s] && maxSpeed[s] > 210.0) {                 set_user_maxspeed(s, maxSpeed[s] - 20)                 render_user_off(s)             }             else if (inBerserk[s]) {                 set_user_maxspeed(s, maxSpeed[s] + 50)             }         }     } }

can someone please help me? its the dragoneye plugin i ported if you want the full source

Xanimos 08-25-2005 17:41

Quote:

'invalid player 1' on line 2424, heres the function with line 2424 in it, the set_user_hitzones line is the error line:

Small:

public evade_loop() {

if (!Dragoneye()) return

for (new a = 1; a <= PLAYERS; a++) {
if (assassin[a] && pskills5[a] > 0 && automagic[a][ AMid[a] ] == 12 && is_user_alive(a) && get_user_armor(a) >= 1) {
set_evade(a)
set_user_armor(a, get_user_armor(a) - 1)
}
else {
set_user_hitzones(0, a, 255)
}
}
}

add

Code:
if(!is_user_connected(a)) continue

Sp4rt4n 08-25-2005 18:00

2 Attachment(s)
well, i did it... but i am now getting 2 warnings and the errors in the server are still coming up. heres the source and include file without what i did, maybe someone could work with it?

XxAvalanchexX 08-25-2005 20:08

Okay, I put the functions from dragoneye.inc into dragoneye.sma (there were so few and extra includes is a pain), added defines for classes (CLASS_NECRO, CLASS_PALLY, CLASS_MAGE, CLASS_ASSN), as get_user_class returns an integer and not a string, and changed cs_user_spawn (amxmod function) to spawn (amxmodx function).

EDIT: files removed

Sp4rt4n 08-25-2005 21:05

:D thank you avalance, your a genius


All times are GMT -4. The time now is 14:18.

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