AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me please with some basic stuff (https://forums.alliedmods.net/showthread.php?t=13641)

Anthraxnz 05-24-2005 02:53

Help me please with some basic stuff
 
iv been learning to cod in c# and c++ for about the last 14 weeks and have decided to try and write a amxx plugin.

my problem is i dont know what im really doing, even tho i read those tutorials.

im trying to make some dumb program to display cvars such as the rcon_password one but for some reason i cant figure out how to get it to work :(

heres what iv got so far.
Code:
#include <amxmodx> #include <amxmisc> new plugin[]="Rcon Commander" new author[]="Anthrax" new version[]="1.00" public plugin_init() {     register_plugin(plugin,author,version)     register_concmd("amx_rconpw","cmd_rcon_password",ADMIN_RCON," Returns the value of R-pw")     } public cmd_rcon_password(id,level,cid) {     new password[20]     if ( ! cmd_access( id, level, cid, 0 ) )     {         console_print(id, "Access Denied")         return PLUGIN_HANDLED     }     get_cvar_string("rcon_password",password,20)     console_print(id,"Rcon pw is: ", password )         return PLUGIN_HANDLED }

it's just basicly a rip of the one that comes with amxx but i dont want it to change any values, just display the value of whats been hardcoded
your help is much welcomed :)

Front Line 05-24-2005 02:57

Why would u want to display that...? Rcon password dammit.

Anthraxnz 05-24-2005 02:58

doesnt have to be rcon password, could be mp_freezetime or something else.
i posted in the help forum about removing the ability to use amx_cvar rcon_password to retreive the pw so i guess it just stuck with my mind :S.

got to learn how basic functions working in side the language, so thats why im not too interested in changing cvars atm ;)

Front Line 05-24-2005 03:12

yea go to the functions...this is where i had started...
Also asking ppl lik vex for help! could be a key.
But dunt ask him to do the whole thing atleast put effort into saying this is 51% or + yours...

Anthraxnz 05-24-2005 03:43

i was thinking along the lines of reading the value of rcon_password and copying the value into another variable "password" and then printing "password" into the console. just dont know how to do it :( some tutorials on stuff like this would be awesome :)

WaZZeR++ 05-24-2005 03:51

you must have a %s to display it, but i donr know if the rest of the script is right
Code:
console_print(id,"Rcon pw is: %s", password )

Anthraxnz 05-24-2005 03:53

k thanks for that will test it :)

Anthraxnz 05-24-2005 03:56

omfg u legend it works :D

thanks for all your helping in de-nubing me ;) kinda only %99.6 left to be de-nubed

v3x 05-24-2005 13:39

Code:
get_cvar_string("rcon_password",password,19)


All times are GMT -4. The time now is 16:45.

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