AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show Info on Screen (https://forums.alliedmods.net/showthread.php?t=12332)

Stephen 04-12-2005 12:00

Show Info on Screen
 
Hi.

I am Making an Offset Plugin. The Plugin compiles without errors and the "Amxx Plugins" shwos my Plugin running, and i also get NO errors when i type then, get_offset.

Erm BUT ,I dunno how to display the Offsets now so i can see them on Screen.

Could anyone help me with that ?

xeroblood 04-12-2005 13:00

What are the offset values? Ints or strings or what?

Also, posting some code would help, that way someone can just add to your existing to code for you, instead of having to write out a complete example from scratch..

Stephen 04-12-2005 13:05

Quote:

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <core>

new PLUGIN[]="Offset"
new AUTHOR[]="Stephenr"
new VERSION[]="0.1"

public plugin_init()
{
register_clcmd("amx_offset","get_offset")
register_plugin(PLUGIN, VERSION, AUTHOR)

return PLUGIN_CONTINUE
}

public get_offset(id)
{

get_pdata_int(id, 500)
get_pdata_int(id, 600)
get_pdata_int(id, 700)

return PLUGIN_HANDLED
}
Thx for the Reply.

here is the Code.
Also is there a way that i ont have to add every Offset Nr., instead have like everyOffset on command, like when i type offset 007 i get the offset value form that Nr.

xeroblood 04-12-2005 13:19

First off, you dont need to include core, since amxmodx does that already..
and I added <amxmisc> for the cmd_access() function..
Oh, and the return value in plugin_init() is ignored, so you dont need it..
Edit: oooops.. you dont need engine module either..
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> new PLUGIN[]="Offset" new AUTHOR[]="Stephenr" new VERSION[]="0.1" public plugin_init() {     register_clcmd("amx_offset","get_offset", ADMIN_LEVEL_A, "<offset>")     register_plugin(PLUGIN, VERSION, AUTHOR) } public get_offset(id, lvl, cid) {     if( !cmd_access( id, lvl, cid, 1 ) )         return PLUGIN_HANDLED     new szOffset[16]     read_argv( 1, szOffset, 15 )     new iOffset = str_to_num( szOffset )     if( iOffset > 0 )     {         new iPDataVal = get_pdata_int( id, iOffset )         client_print( id, print_chat, "Your Private Data at Offset %d is: %d", iOffset, iPDataVal )     }     return PLUGIN_HANDLED }

I hope that helps..

Stephen 04-12-2005 13:26

Thx. :D
It works.
Youre Great :D


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

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