Hello everyone,
Can anyone make a litle tutorial or just example plugin who read arguments from ini file and from specific line of thet file. Example, I have .ini file and I want to plugin read line 8. On line 8 are two arguments: "BaD CopY" "1000" (First argument is betwen first and second quotes and second argument is betwen third and fourth quotes).
So, plugin must give golds. First argument is nick of player and second argument is number of player's golds. Plugin must set golds like second argument from .ini file to player (first argument)
Plugin will create file: golds.ini and in thet file is nick of all players who connected to the server and who have min. 1 kill (gold)
This is a part of gold system plugin
PHP Code:
new gGolds[32]
register_event( "DeathMsg", "Hook_Deathmessage", "a" );
public Hook_Deathmessage()
{
new killer = read_data( 1 );
new victim = read_data( 2 );
if( killer == victim )
{
return PLUGIN_HANDLED;
}
gGolds[ killer ] += 1
return PLUGIN_CONTINUE;
}
If you don't understend something, post questin in comment and send me PM...