Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Strange server side error.. (https://forums.graalonline.com/forums/showthread.php?t=63602)

Moondeath_2 01-21-2006 04:14 AM

Strange server side error..
 
For some reason this script triggers off a error but i don't know why it does maybe i'm ignorant but here it is and yes it is triggered to serverside but it says this stupid error though. :\

NPC Code:
    
case "summon-u":
p = findplayer(params[1]);
p.setlevel2(player.level,player.x,player.y);
break;

case "add-i":
tokens = player.chat.tokenize();
p = findplayer(tokens[1]);
p.addweapon(tokens[2]);
break;



GraalScript: Function setlevel2 not found at line 22 in script of MD/Tool (in level event_swimrace3.nw at pos (0, 0))
All local db npcs from level event_swimrace3.nw have been removed
GraalScript: Function addweapon not found at line 40 in script of MD/Tool (in level event_swimrace3.nw at pos (0, 0))

Rick 01-21-2006 04:24 AM

Well, I'm probably wrong but it doesn't look like you're checking to make sure the result from findPlayer succeeded.

Moondeath_2 01-21-2006 04:27 AM

Well it does go through the people receive items and it summons so i don't know what the problem is. :/

napo_p2p 01-21-2006 04:28 AM

It's probably because 'p' is NULL ('findplayer' did not find the player).

EDIT: Rick beat me :p. Adding a check will get rid of that:
PHP Code:

if (!= NULL) {




Moondeath_2 01-21-2006 04:52 AM

Quote:

Originally Posted by napo_p2p
It's probably because 'p' is NULL ('findplayer' did not find the player).

EDIT: Rick beat me :p. Adding a check will get rid of that:
PHP Code:

if (!= NULL) {





Weapon/GUI-script MD/Tool added/updated by Moondeath_2
Player: Moondeath_2 has logged on GV-4.03.
New Client-RC: *Moondeath_2 (Moondeath_2)

I then summoned Nitro, so yes it got rid of the error except for the item giver.

Edit: Nevermind that it does work, thanks.


All times are GMT +2. The time now is 10:17 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.