Raised This Month: $ Target: $400
 0% 

Feature Request JetPack+DieGift


Post New Thread Reply   
 
Thread Tools Display Modes
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 04-02-2013 , 18:11   Re: JetPack+DieGift
Reply With Quote #11

Add me in steam and we will test it When I have time (maybe tomorrow)
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
applemes
Senior Member
Join Date: Mar 2013
Old 04-02-2013 , 18:14   Re: JetPack+DieGift
Reply With Quote #12

Added you
applemes is offline
applemes
Senior Member
Join Date: Mar 2013
Old 04-02-2013 , 21:30   DropGiftCredits
Reply With Quote #13

Can any1 fix this?
Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <gifts>
#include <store>

#define PLUGIN_VERSION	"1.0"

new String:g_currencyName[64];

public Plugin:myinfo =
{
	name = "[Store] Gifts",
	author = "Franc1sco steam: franug",
	description = "Gifts",
	version = PLUGIN_VERSION,
	url = "franug.com"
};

public OnPluginStart()
{
	Gifts_RegisterPlugin(Gifts_ClientPickUp);
}

public OnAllPluginsLoaded()
{
	Store_GetCurrencyName(g_currencyName, sizeof(g_currencyName));
}


public OnPluginEnd()
{
	Gifts_RemovePlugin();
}

public Gifts_ClientPickUp(client)
{
	new money = GetRandomInt(1,20);
	PrintToChat(client, "%s You received %i %s",STORE_PREFIX, money, g_currencyName);

	new account = Store_GetClientAccountID(client);
	Store_GiveCredits(account, money);
}
I am using it with https://forums.alliedmods.net/showthread.php?t=175185
and when i use try to load plugin, i get

Code:
L 04/01/2013 - 20:545: [SM] Unable to load plugin "store-gifts.smx": Could not find required plugin "[ANY] Gifts"
applemes is offline
Arrow768
Veteran Member
Join Date: Nov 2011
Location: Austria
Old 04-03-2013 , 06:14   Re: JetPack+DieGift
Reply With Quote #14

Please create only one thread per topic.
I have merged you three threads about the same topic into this thread
__________________
Arrow768 is offline
applemes
Senior Member
Join Date: Mar 2013
Old 04-03-2013 , 16:42   Re: JetPack+DieGift
Reply With Quote #15

I apologize.
applemes is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 04-03-2013 , 16:46   Re: JetPack+DieGift
Reply With Quote #16

Ok, the problem is that the author of gift changed the include of the plugin and now the current plugins that use his natives dont work.

So I upload the old version of the gift plugin and will work with my store-gifts plugin (tested).

btw, .inc to scripting/include and .smx to plugins/
Attached Files
File Type: zip store-gifts.zip (14.9 KB, 193 views)
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 04-03-2013 at 16:47.
Franc1sco is offline
Send a message via MSN to Franc1sco
applemes
Senior Member
Join Date: Mar 2013
Old 04-03-2013 , 21:56   Re: JetPack+DieGift
Reply With Quote #17

Can some1 help me add Jetpack? I am gonna put it in "Misc" Section.
_____________________________________

Liek what would the "Attributes" be? And whatnot.

And here is the Code i am using idk what to change/fix

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <store>

#define PLUGIN_VERSION "1.1.0"

#define MOVETYPE_WALK			2
#define MOVETYPE_FLYGRAVITY		5
#define MOVECOLLIDE_DEFAULT		0
#define MOVECOLLIDE_FLY_BOUNCE	1

#define LIFE_ALIVE	0

// ConVars
new Handle:sm_jetpack			= INVALID_HANDLE;
new Handle:sm_jetpack_sound		= INVALID_HANDLE;
new Handle:sm_jetpack_speed		= INVALID_HANDLE;
new Handle:sm_jetpack_volume	= INVALID_HANDLE;

// SendProp Offsets
new g_iLifeState	= -1;
new g_iMoveCollide	= -1;
new g_iMoveType		= -1;
new g_iVelocity		= -1;

// Soundfile
new String:g_sSound[255]	= "vehicles/airboat/fan_blade_fullthrottle_loop1.wav";

// Is Jetpack Enabled
new bool:g_bJetpacks[MAXPLAYERS + 1]	= {false,...};

// Timer For GameFrame
new Float:g_fTimer	= 0.0;

// MaxClients
new g_iMaxClients	= 0;

public Plugin:myinfo =
{
	name = "Jetpack",
	author = "Knagg0",
	description = "",
	version = PLUGIN_VERSION,
	url = "http://www.mfzb.de"
};

public OnPluginStart()
{
	AutoExecConfig();
	
	// Create ConVars
	CreateConVar("sm_jetpack_version", PLUGIN_VERSION, "", FCVAR_PLUGIN | FCVAR_REPLICATED | FCVAR_NOTIFY);
	sm_jetpack = CreateConVar("sm_jetpack", "1", "", FCVAR_PLUGIN | FCVAR_REPLICATED | FCVAR_NOTIFY);
	sm_jetpack_sound = CreateConVar("sm_jetpack_sound", g_sSound, "", FCVAR_PLUGIN);
	sm_jetpack_speed = CreateConVar("sm_jetpack_speed", "100", "", FCVAR_PLUGIN);
	sm_jetpack_volume = CreateConVar("sm_jetpack_volume", "0.5", "", FCVAR_PLUGIN);

	// Create ConCommands
	RegConsoleCmd("+sm_jetpack", JetpackP, "", FCVAR_GAMEDLL);
	RegConsoleCmd("-sm_jetpack", JetpackM, "", FCVAR_GAMEDLL);
	
	// Find SendProp Offsets
	if((g_iLifeState = FindSendPropOffs("CBasePlayer", "m_lifeState")) == -1)
		LogError("Could not find offset for CBasePlayer::m_lifeState");
		
	if((g_iMoveCollide = FindSendPropOffs("CBaseEntity", "movecollide")) == -1)
		LogError("Could not find offset for CBaseEntity::movecollide");
		
	if((g_iMoveType = FindSendPropOffs("CBaseEntity", "movetype")) == -1)
		LogError("Could not find offset for CBaseEntity::movetype");
		
	if((g_iVelocity = FindSendPropOffs("CBasePlayer", "m_vecVelocity[0]")) == -1)
		LogError("Could not find offset for CBasePlayer::m_vecVelocity[0]");
}

public OnMapStart()
{
	g_fTimer = 0.0;
	g_iMaxClients = GetMaxClients();
}

public OnConfigsExecuted()
{
	GetConVarString(sm_jetpack_sound, g_sSound, sizeof(g_sSound));
	PrecacheSound(g_sSound, true);
}

public OnGameFrame()
{
	if(GetConVarBool(sm_jetpack) && g_fTimer < GetGameTime() - 0.075)
	{
		g_fTimer = GetGameTime();
		
		for(new i = 1; i <= g_iMaxClients; i++)
		{
			if(g_bJetpacks[i])
			{
				if(!IsAlive(i)) StopJetpack(i);
				else AddVelocity(i, GetConVarFloat(sm_jetpack_speed));
			}
		}
	}
}

public OnClientDisconnect(client)
{
	StopJetpack(client);
}

public Action:JetpackP(client, args)
{
	if(GetConVarBool(sm_jetpack) && !g_bJetpacks[client] && IsAlive(client))
	{
		new Float:vecPos[3];
		GetClientAbsOrigin(client, vecPos);
		EmitSoundToAll(g_sSound, client, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, GetConVarFloat(sm_jetpack_volume), SNDPITCH_NORMAL, -1, vecPos, NULL_VECTOR, true, 0.0);
		SetMoveType(client, MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE);
		g_bJetpacks[client] = true;
	}
	
	return Plugin_Continue;
}

public Action:JetpackM(client, args)
{
	StopJetpack(client);
	return Plugin_Continue;
}

StopJetpack(client)
{
	if(g_bJetpacks[client])
	{
		if(IsAlive(client)) SetMoveType(client, MOVETYPE_WALK, MOVECOLLIDE_DEFAULT);
		StopSound(client, SNDCHAN_AUTO, g_sSound);
		g_bJetpacks[client] = false;
	}
}

SetMoveType(client, movetype, movecollide)
{
	if(g_iMoveType == -1) return;
	SetEntData(client, g_iMoveType, movetype);
	if(g_iMoveCollide == -1) return;
	SetEntData(client, g_iMoveCollide, movecollide);
}

AddVelocity(client, Float:speed)
{
	if(g_iVelocity == -1) return;
	
	new Float:vecVelocity[3];
	GetEntDataVector(client, g_iVelocity, vecVelocity);
	
	vecVelocity[2] += speed;

	TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
}

bool:IsAlive(client)
{
	if(g_iLifeState != -1 && GetEntData(client, g_iLifeState, 1) == LIFE_ALIVE)
		return true;

	return false;
}

Last edited by applemes; 04-03-2013 at 22:00.
applemes is offline
serpentine
I don't have a problem
Join Date: Feb 2011
Location: Madison, WI
Old 04-04-2013 , 06:42   Re: JetPack+DieGift
Reply With Quote #18

Quote:
Originally Posted by Franc1sco View Post
Ok, the problem is that the author of gift changed the include of the plugin and now the current plugins that use his natives dont work.

So I upload the old version of the gift plugin and will work with my store-gifts plugin (tested).

btw, .inc to scripting/include and .smx to plugins/
I changed the model to the appropriate TF2 model and recompiled but don't see any spawning. Both Gifts and Store-Gifts are running.
__________________
serpentine is offline
applemes
Senior Member
Join Date: Mar 2013
Old 04-04-2013 , 16:24   Re: JetPack+DieGift
Reply With Quote #19

I think store-gifts is for CSS
applemes is offline
applemes
Senior Member
Join Date: Mar 2013
Old 04-06-2013 , 13:30   Re: JetPack+DieGift
Reply With Quote #20

Has anyone figured out how i could add jetpack to store?
applemes 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 06:43.


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