Raised This Month: $51 Target: $400
 12% 

Solved Making a plugin from .inc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RAW_192
Senior Member
Join Date: Feb 2017
Old 07-16-2017 , 05:21   Making a plugin from .inc
Reply With Quote #1

PHP Code:
#if defined _levelsystem_included
    #endinput
#endif

#define _levelsystem_included

// Returns player Level.
native get_user_point(id)

// Sets player Level.
native set_user_point(idamount
This is my .inc

it does a simple task and thats assigning points to a player

I want to make a plugin for this .inc so that i can use it on servers .. Help please ?

Last edited by RAW_192; 07-23-2017 at 12:19.
RAW_192 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-16-2017 , 05:59   Re: Making a plugin from .inc
Reply With Quote #2

Append every blue ( according to this very post ) colored line to your plugin outside of any publics.
eyal282 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 07-16-2017 , 08:03   Re: Making a plugin from .inc
Reply With Quote #3

please read this tutorial: https://forums.alliedmods.net/showthread.php?t=41251 before asking any questions, because it is very detailed and simple.
edit--
this might help you aswell: https://forums.alliedmods.net/showthread.php?t=46779
__________________
retired chump

Last edited by DjSoftero; 07-16-2017 at 08:06.
DjSoftero is offline
RAW_192
Senior Member
Join Date: Feb 2017
Old 07-17-2017 , 12:10   Re: Making a plugin from .inc
Reply With Quote #4

Can i get a little more help here?

I did understand this [https://forums.alliedmods.net/showthread.php?t=41251]

But the thing is since it is a point system so

I will have to define a new global

and then set the parameters?
RAW_192 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-17-2017 , 12:30   Re: Making a plugin from .inc
Reply With Quote #5

Quote:
Originally Posted by RAW_192 View Post
Can i get a little more help here?

I did understand this [https://forums.alliedmods.net/showthread.php?t=41251]

But the thing is since it is a point system so

I will have to define a new global

and then set the parameters?
Check what I told you that you ignored. After you do it, natives will work.
eyal282 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 07-17-2017 , 12:51   Re: Making a plugin from .inc
Reply With Quote #6

Quote:
Originally Posted by eyal282 View Post
Check what I told you that you ignored. After you do it, natives will work.
i`m pretty sure he created that inc file. it won`t magicaly save players xp and it wont have a magical way of knowing how much p to give per kill/death etc.

RAW, have you got the saving part done? or you just wrote a simple include file and want to know what to do next?
what global variable are you talking about? player_xp[] or smth?
__________________
retired chump

Last edited by DjSoftero; 07-17-2017 at 12:53.
DjSoftero is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2017 , 12:59   Re: Making a plugin from .inc
Reply With Quote #7

What the above guy is asking is if you have the points system ready and:
a)you want to create an API for it to use in other plugin
b)you have the API and you want to use it in other plugin
c)you don't even have the points system and you want to build it from 0.
__________________
HamletEagle is offline
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
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 07-19-2017 , 14:18   Re: Making a plugin from .inc
Reply With Quote #9

what does console say when you load plugin in debug mode?
__________________
retired chump
DjSoftero is offline
Reply



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 00:51.


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