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

Request for parachute module


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ali0mer
Senior Member
Join Date: Jan 2016
Location: Iraq
Old 10-29-2018 , 03:53   Request for parachute module
Reply With Quote #1

I saw in this topic a parachute souce module , Ive tried to install visual studio 2013 and i do everything
but i couldnt compile it to windows .
If anyone can compile for windows or linux please post it here or upload it to link something.
Source code
Code:
#include "amxxmodule.h"
struct CPlayer
{
     bool parachute;
};
CPlayer g_Player[33];
 
#define GET_PLAYER_POINTER(i) (&g_Player[i])
 
void PlayerPreThink( edict_t *ePlayer )
{
    CPlayer *Player = GET_PLAYER_POINTER(ENTINDEX(ePlayer));
    if (!Player->parachute)
        RETURN_META(MRES_IGNORED);
    if( ePlayer -> v.button & IN_USE && ePlayer -> v.velocity.z < 0 )
        ePlayer -> v.velocity.z = -100.0;
    RETURN_META( MRES_IGNORED );
}
 
static cell AMX_NATIVE_CALL get_user_parachute(AMX *amx, cell *params)
{
    if (params[1] < 0 || params[1] > gpGlobals->maxEntities)
    {
        MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", params[1]);
        return 0;
    }else{
        if (!MF_IsPlayerIngame(params[1]) || FNullEnt(MF_GetPlayerEdict(params[1])))
        {
            MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", params[1]);
            return 0;
        }
    }
    CPlayer *Player = GET_PLAYER_POINTER(params[1]);
    return (Player->parachute) ? 1 : 0;
}
 
static cell AMX_NATIVE_CALL set_user_parachute(AMX *amx, cell *params)
{
    if (params[1] < 0 || params[1] > gpGlobals->maxEntities)
    {
        MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", params[1]);
        return 0;
    }else{
        if (!MF_IsPlayerIngame(params[1]) || FNullEnt(MF_GetPlayerEdict(params[1])))
        {
            MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", params[1]);
            return 0;
        }
    }
    CPlayer *Player = GET_PLAYER_POINTER(params[1]);
    if (params[2])
    {
        Player->parachute = true;
        return 1;
    }else {
        Player->parachute = false;
        return 1;
    }
    return 0;
}
 
AMX_NATIVE_INFO My_Natives[] = {
    {"get_user_parachute", get_user_parachute},
    {"set_user_parachute", set_user_parachute},
    {0,  0}
};
 
void OnAmxxAttach(void)
{
    MF_AddNatives(My_Natives);
}
Ali0mer is offline
Send a message via Skype™ to Ali0mer
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 04:10.


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