I'm trying to replace the NW system with my own umsg'd system, however I am getting the error
[code]
Warning: Unhandled usermessage 'SetNWIntCool'
[/code]
I have no idea what's wrong, can someone point out?
I am basicly setting a variable server, then sending a umsg to the client which then the client gets and stores.
The 'sent umsg' print prints, so it's something on the client side.
[lua]
local meta = FindMetaTable( "Player" );
if( CLIENT ) then
if( not NWInt ) then
NWInt = { }
end
end
function meta:GetNWInt( var )
if( SERVER ) then
return self:GetTable()[var];
else
if( NWInt[var] ) then
return NWInt[var];
end
end
return 0;
end
function meta:SetNWInt( key, val )
if( SERVER ) then
self:GetTable()[key] = val;
umsg.Start( "SetNWInt" .. key, self );
umsg.String( key );
umsg.Short( val );
umsg.End();
print( "sent umsg" )
end
if( CLIENT ) then
usermessage.Hook( "SetNWInt" .. key, function( msg )
local key = msg:ReadString();
local val = msg:ReadShort();
NWInt[key] = val;
end );
end
end
if( SERVER ) then
function spawn( ply )
ply:SetNWInt( "Cool", 1 );
end
hook.Add( "PlayerInitialSpawn", "spawndo", spawn );
end
[/lua]
You're not hooking it.
[QUOTE=_Chewgum;22666562]You're not hooking it.[/QUOTE]
I've tried the hooking part before the umsg sending, still no difference
Well you see, negros are black.
[highlight](User was banned for this post ("This post is not relevant to the thread topic" - verynicelady))[/highlight]
[QUOTE=H0rsey;22666641]I've tried the hooking part before the umsg sending, still no difference[/QUOTE]
What do you mean, in your code shown here you only call SetNWInt serverside.
[QUOTE=_Chewgum;22666742]What do you mean, in your code shown here you only call SetNWInt serverside.[/QUOTE]
I've already tried removing the if( SERVER ) from the spawn function, still no difference.
[editline]09:57PM[/editline]
ah, disregard
[editline]09:58PM[/editline]
i know what u mean now, lol.
[QUOTE=H0rsey;22666831]I've already tried removing the if( SERVER ) from the spawn function, still no difference.
[editline]09:57PM[/editline]
ah, disregard
[editline]09:58PM[/editline]
i know what u mean now, lol.[/QUOTE]
Because PlayerInitialSpawn is serverside
[url]http://www.facepunch.com/showthread.php?t=854829[/url]
Use that, saves time and works too.
The download of that is a 404
I still have it. Wonder if I'm allowed to reupload.
Have you got FastDL, if you don't update the cache you get this error.
Sorry, you need to Log In to post a reply to this thread.