Raised This Month: $ Target: $400
 0% 

Solved Making a plugin from .inc


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
RAW_192
Senior Member
Join Date: Feb 2017
Old 07-19-2017 , 12:44   Re: Making a plugin from .inc
Reply With Quote #8

Actually i have made some progress , But the issue is when i install this plugin , The server crashes

PHP Code:
public plugin_natives()
{
    
// Player natives //
    
register_native("get_user_point""native_get_user_point"1);
    
register_native("set_user_point""native_set_user_point"1);
}
public 
My_Point(id)
{
    if(!
is_user_alive(id) && is_user_connected(id))
        return 
PLUGIN_HANDLED;
        
    
client_print_color(idprint_chat"^4[%s] you have %d points."TAGg_iPoints[id])
    
    return 
PLUGIN_HANDLED
}
Load(id)
{   
    new 
szAuthId[32]; get_user_authid(idszAuthIdcharsmax(szAuthId));
    
    new 
szData[200], iTimeStamp;
    if(
nvault_lookup(g_iVaultszAuthIdszDatacharsmax(szData), iTimeStamp))
    {
              new 
szSavedname[32], szPoint[16];
              
parse(szDataszSavednamecharsmax(szSavedname), szPointcharsmax(szPoint))
              
remove_quotes(szSavedname)
              
remove_quotes(szPoint)
              
set_user_info(id"name"szSavedname)
              
g_iPoints[id] = str_to_num(szPoint)
     }
}
// Native: get_user_point
public native_get_user_point(id)
{
    return 
g_iPoints[id];
}

// Native: set_user_point
public native_set_user_point(idamount)

{
    
g_iPoints[id] = amount;


Last edited by RAW_192; 07-19-2017 at 12:47.
RAW_192 is offline
 



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 10:01.


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