Raised This Month: $ Target: $400
 0% 

[REQ] Read arguments from .ini file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 05-01-2015 , 02:27   [REQ] Read arguments from .ini file
Reply With Quote #1

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);
    new 
victim read_data);
    
    if( 
killer == victim )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
gGoldskiller ] += 1
    
    
return PLUGIN_CONTINUE;

If you don't understend something, post questin in comment and send me PM...

Last edited by BaD CopY; 05-01-2015 at 02:29.
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:14.


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