Quote:
Originally Posted by fysiks
It sounds like, at the very least, you need to read some of the really basic scripting tutorials like the first two under "Pawn Programming" here.
|
Been over that multiple times before I posted this thread, I can't find exactly what I need
Quote:
Originally Posted by maqi
Ill make you a tutorial:
PHP Code:
/* These will be our cvar pointers */
new g_Cvar_TutorialInt,
g_Cvar_TutorialString;
public plugin_precache( )
{
/* We registered our cvars and asigned g_Cvar_Tutorial as our cvar pointers ( That means that everything we want to do with a cvar we do with that pointer ) */
g_Cvar_TutorialInt = register_cvar( "amx_tutorial_int", "1" );
g_Cvar_TutorialString = register_cvar( "amx_tutorial_string", "Hello World" );
}
public client_connect( iIndex )
{
new iTutorial = get_pcvar_num( g_Cvar_TutorialInt ); // We get the integer value of our cvar using get_pcvar_num
new sTutorial[32]; get_pcvar_string( g_Cvar_TutorialString, sTutorial, charsmax(sTutorial) ) // We copied the string value of our cvar to a buffer
// Do stuff with iTutorial and sTutorial...
}
/* Note: Cvars always have string values, its up to you how you are gonna retrieve it, ) get_pcvar_num, get_pcvar_float, get_pcvar_string etc ... ) */
|
I probably shouldn't expect people to "spoon feed" me code but thanks anyway, this solved my problems (except I didn't need the tutorialInt bit