Raised This Month: $ Target: $400
 0% 

inc error


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-03-2015 , 21:58   Re: inc error
Reply With Quote #21

Quote:
Originally Posted by zombiesucker View Post
@fysiks code what i can't understand you?,, can you give Inc file you made that can help me do .inc
I think you need to get a better translator. Find somebody that speaks English so they can tell you what I said in your own language.
__________________

Last edited by fysiks; 10-03-2015 at 21:58.
fysiks is offline
zombiesucker
Member
Join Date: Sep 2015
Old 10-04-2015 , 02:40   Re: inc error
Reply With Quote #22

Quote:
Originally Posted by fysiks View Post
I think you need to get a better translator. Find somebody that speaks English so they can tell you what I said in your own language.
are you serious? I told I wrote those natives in the include file to make include for myself not to tack others include and to see if I could made one very will,, and you talking about native code, I told you I'm still noob so I tried to make one and see if I can do,, i'm just asking for help asking if you could guide me on making good include

Last edited by zombiesucker; 10-04-2015 at 05:39.
zombiesucker is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 10-04-2015 , 05:51   Re: inc error
Reply With Quote #23

Everyone is helping you, but you ain't listening.

1. Create a "handler" for specific native in first plugin
2. Create a include
3. Create a second plugin that uses native
OvidiuS is offline
Send a message via Skype™ to OvidiuS
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-04-2015 , 06:54   Re: inc error
Reply With Quote #24

Fysiks, want you to show how you register the natives. As an example:

1. para_api.sma (The file which we register the natives):
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

/*
HOW TO USE?
You need to add these 2 natives in your plugin.
native get_user_parachute(id) //to get whether player has parachute or not
native set_user_parachute(id, set=0) //to set whether player has parachute or not 1-Yes 0-No
*/

//fall speed must be in negative (float), lower mean more slower
#define FALL_SPEED -60.0
new bool:bHasParachute[33]

public plugin_natives()
{
    register_library("cs_para")
    register_native("get_user_parachute", "_get_user_parachute", 1)
    register_native("set_user_parachute", "_set_user_parachute", 1)
}

public plugin_init()
{
    register_plugin("Invisible Parachute API", "0.0.1", "wbyokomo")
    RegisterHam(Ham_Killed, "player", "OnPlayerKilled")
    register_forward(FM_CmdStart, "OnCmdStart")
}

public client_disconnect(id)
{
    bHasParachute[id] = false
}

public OnPlayerKilled(id)
{
    bHasParachute[id] = false
}

public OnCmdStart(id, uc_handle)
{
    if(!bHasParachute[id]) return;
    
    static button; button = get_uc(uc_handle, UC_Buttons);
    if(button & IN_USE)
    {
        static Float:fVelocity[3]; pev(id, pev_velocity, fVelocity);
        if(fVelocity[2] < 0.0)
        {
            fVelocity[2] = FALL_SPEED
            set_pev(id, pev_velocity, fVelocity)
        }
    }
}

public _get_user_parachute(id)
{
    return bHasParachute[id];
}

public _set_user_parachute(id, set)
{
    if(set > 0) bHasParachute[id] = true;
    else bHasParachute[id] = false;
}
2. cs_para.inc file:
Code:
#if defined _cs_para_included
    #endinput
#endif
#define _cs_para_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib cs_para
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib cs_para
    #endif
#else
    #pragma library cs_para
#endif

/****************************************************
*                    custom natives                 *
*****************************************************/

/**
 * param id - ID of client
 */
native get_user_parachute(id)
 
 
 /**
 * param id - ID of client
 */
native set_user_parachute(id, set=0)
3. test_plugin.sma file:
Code:
#include <amxmodx>
#include <hamsandwich>
#include <cs_para> // <---------------------- Your custom include

native zp_get_user_nemesis(id)
native zp_get_user_assassin(id)

public plugin_init()
{
    register_plugin("Free Parachute For All", "0.0.2", "wbyokomo")
    RegisterHam(Ham_Spawn, "player", "OnPlayerSpawnPost", 1)
}

public OnPlayerSpawnPost(id)
{
    //give parachute everytime player spawn
    if(!is_user_alive(id)) return;
    
    if(zp_get_user_nemesis(id) || zp_get_user_assassin(id)) set_user_parachute(id, 0); //nemesis & assassin no need parachute
    else set_user_parachute(id, 1); //give zombie/human parachute too
}

public zp_user_infected_post(id)
{
    if(!is_user_alive(id)) return;
    
    if(zp_get_user_nemesis(id) || zp_get_user_assassin(id)) set_user_parachute(id, 0); //nemesis & assassin no need parachute
    else set_user_parachute(id, 1); //give zombie parachute too
}

public zp_user_humanized_post(id)
{
    if(is_user_alive(id)) set_user_parachute(id, 1); //give parachute to human
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

Last edited by zmd94; 10-04-2015 at 06:55.
zmd94 is offline
zombiesucker
Member
Join Date: Sep 2015
Old 10-04-2015 , 07:50   Re: inc error
Reply With Quote #25

thank you it work now

Last edited by zombiesucker; 10-04-2015 at 08:24.
zombiesucker is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-04-2015 , 09:27   Re: inc error
Reply With Quote #26

Nevermind.
zmd94 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 09:46.


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