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

a plugin/mod was started.. and Id like...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hell_Puppy
Junior Member
Join Date: Aug 2005
Old 01-19-2006 , 07:43   a plugin/mod was started.. and Id like...
Reply With Quote #1

Id like to learn how to work on things like this... so I can finish this.. but I have no idea.

Its a Assassin EXP based leveling... thats all it started as.
Id like to have it give speed boost, lower visability, knife damage increase, or silece for beginning classes... then as they level up they can choose from a list of other things like

Higher jumps (low grav for them only)
Wall hooks
and more to come.. still just starting.

I have a base .sma from the old one, ill post here, maybe you can help me out.. i know pretty much nothing on what to do


heres what he/they had started, i take no credit for this::

Description\
============================================= ====

Ninja Mod shows new players a menu, where they choose their "Ninja Type" or Class
Strong, Fast, Accurate, Stealthy


_____
Usage\
============================================= ====

Commands
========
amx_ninjaon - Turns plugin on/off 0 = off 1 = on. (Default = 1)
amx_ninjasave - Turns XP Saving on/off (Default = 1) *XP is saved to addons/amxmodx/data/vault.ini
amx_ninja_xppk - Sets the amount of XP given Per Kill. "xppk" = XP Per Kill (Default = 20)



_________
Changelog\
============================================= ====

Version
=======
v0.8beta - Xp is workin, and added a menu as well as several cvars, no powers yet though.
Cost cvar is gone too, same with all the say commands.
v0.7 - Fixed speed for real now. Added new message when plugin is on/off
v0.6 - Added Cost Cvar "amx_ninja_cost" (Default 5000). And fixed the speed problem.
v0.5 - Added speed for ninja's, they go faster now
v0.4 - Fixed the armor bug, changed ninja hp to 255 so hud shows it correctly
v0.3 - Bugs squashed, "amx_ninjaon" cvar added, Code simplified.
v0.2 - Added hud message
v0.1 - First Version


__________
To-Do List\
============================================= ====

List Percent Complete
==== ================
1. Menu 70%
2. XP Control CVARs 100%
3. Class Skills 0%
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <nvault>

//Classes
#define MAXCLASSES 5

#define CLASS_NOTHING 0
#define CLASS_STRONG 1
#define CLASS_FAST 2
#define CLASS_ACCURATE 3
#define CLASS_STEALTHY 4

//XP Variables
new PlayerClass[33]
new PlayerXP[33]
new PlayerLevel[33]

//XP
new const CLASSES[MAXCLASSES][] = {
"None",
"Strong",
"Fast",
"Accurate",
"Stealthy"
}

new msgtext

new const LEVELS[10] = {
100,
200,
400,
800,
1600,
3200,
6400,
12800,
25600,
51200
}


public plugin_init()
{
register_plugin("Ninja Mode","0.8beta","Kensai/smallwimpyboy")

//CVARs
register_cvar("amx_ninjaon","1")
register_cvar("amx_ninjasave", "1")
register_cvar("amx_ninja_xppk", "20")

//Events
register_event("ResetHUD","ResetHud","b")
register_event("DeathMsg", "DeathMsg", "a")

//Lets register a menu to choose animal with...
register_menucmd(register_menuid("menu_Choose Type"),1023,"DoChooseType");
msgtext = get_user_msgid("StatusText")

}

public client_connect(id)
{
//Only load their XP if our SaveXP cvar is 1.
if(get_cvar_num("amx_ninjasave") == 1) {

LoadXP(id)

//Add a message if you want....
client_print(id, print_chat, "[Ninja Mod] XP Loaded!")
client_print(id, print_chat, "[Ninja Mod] You are a %s with level %s and %s XP", PlayerClass[id], PlayerLevel[id], PlayerXP[id])
}
}

public client_disconnect(id)
{
//Only save their XP if our SaveXP cvar is 1.
if(get_cvar_num("amx_ninjasave") == 1) {

SaveXP(id)
}
}

public SaveXP(id)
{
new authid[32];
get_user_authid(id,authid,31);

new vaultkey[64], vaultdata[64];

//Save their class
format(vaultkey,63,"NINJA-%s-class",authid);
format(vaultdata,63,"%d",PlayerClass[id]);
set_vaultdata(vaultkey,vaultdata);

//Save their XP
format(vaultkey,63,"NINJA-%s-xp",authid);
format(vaultdata,63,"%d",PlayerXP[id]);
set_vaultdata(vaultkey,vaultdata);

//Save their level
format(vaultkey,63,"NINJA-%s-level",authid);
format(vaultdata,63,"%d",PlayerLevel[id]);
set_vaultdata(vaultkey,vaultdata);
}

public LoadXP(id)
{
new authid[32];
get_user_authid(id,authid,31);

new vaultkey[64], vaultdata[64];

//Load their class
format(vaultkey,63,"NINJA-%s-class",authid);
get_vaultdata(vaultkey,vaultdata,63);
PlayerClass[id] = str_to_num(vaultdata);

//Load their XP
format(vaultkey,63,"NINJA-%s-xp",authid);
get_vaultdata(vaultkey,vaultdata,63);
PlayerXP[id] = str_to_num(vaultdata);

//Load their level
format(vaultkey,63,"NINJA-%s-level",authid);
get_vaultdata(vaultkey,vaultdata,63);
PlayerLevel[id] = str_to_num(vaultdata);
}

stock ChooseType(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3


format(menu, 191, "Ninja Mod: Choose Ninja Type^n^n1. Strong^n2. Fast^n3. Accurate^n4. Stealthy^n^n0. Exit")
show_menu(id, keys, menu, -1, "menu_ChooseType")
return PLUGIN_CONTINUE
}

public DoChooseType(id, key)
{
if(key == 0) {

if(PlayerClass[id] == CLASS_STRONG) {


client_print(id, print_chat, "[Ninja Mod] You are already a Strong Ninja! Choose something else!")
ChooseType(id)
return PLUGIN_HANDLED
}

PlayerClass[id] = CLASS_STRONG
client_print(id, print_chat, "[Ninja Mod] You are now a Strong Ninja!")
}

if(key == 1) {

if(PlayerClass[id] == CLASS_FAST) {

client_print(id, print_chat, "[Ninja Mod] You are already a Fast Ninja! Choose something else!")
ChooseType(id)
return PLUGIN_HANDLED
}

PlayerClass[id] = CLASS_FAST
client_print(id, print_chat, "[Ninja Mod] You are now a Fast Ninja!")
}

if(key == 2) {

if(PlayerClass[id] == CLASS_ACCURATE) {

client_print(id, print_chat, "[Ninja Mod] You are already an Accurate Ninja! Choose something else!")
ChooseType(id)
return PLUGIN_HANDLED
}

PlayerClass[id] = CLASS_ACCURATE
client_print(id, print_chat, "[Ninja Mod] You are now a Accurate Ninja!")
}

if(key == 3) {

if(PlayerClass[id] == CLASS_STEALTHY) {

client_print(id, print_chat, "[Ninja Mod] You are already a Stealthy Ninja! Choose something else!")
ChooseType(id)
return PLUGIN_HANDLED
}

PlayerClass[id] = CLASS_STEALTHY
client_print(id, print_chat, "[Ninja Mod] You are now a Stealthy Ninja!")
}

ShowHUD(id)

return PLUGIN_HANDLED
}

public ResetHud(id)
{
if(PlayerClass[id] == CLASS_NOTHING) {

ChooseType(id)
return PLUGIN_HANDLED
}

return PLUGIN_HANDLED
}

public DeathMsg()
{
if(get_cvar_num("amx_ninjaon") == 0) {
return PLUGIN_HANDLED
}

new attacker = read_data(1)

if(PlayerClass[attacker] == CLASS_NOTHING) {
return PLUGIN_HANDLED
}

if(PlayerLevel[attacker] == 6) {
return PLUGIN_HANDLED
}

PlayerXP[attacker] += get_cvar_num("amx_ninja_xppk")

if(PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {

PlayerLevel[attacker] += 1

client_print(attacker, print_chat, "[Ninja Mod] Congratulations! You are now level %i!", PlayerLevel[attacker])

if(get_cvar_num("amx_ninjasave") == 1) {

SaveXP(attacker)
}

ShowHUD(attacker)
}

ShowHUD(attacker)

return PLUGIN_CONTINUE
}

public ShowHUD(id)
{
new HUD[51]
format(HUD, 50, "[%s]Level: %i XP: %i", CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id])

message_begin(MSG_ONE, msgtext, {0,0,0}, id)
write_byte(0)
write_string(HUD)
message_end()
return
}
__________________
Hell_Puppy is offline
Send a message via AIM to Hell_Puppy
Dirty DuMont
Member
Join Date: Jan 2006
Old 01-19-2006 , 08:12  
Reply With Quote #2

Mind posting it in *small*? Easier to read.
Dirty DuMont is offline
Send a message via AIM to Dirty DuMont
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 01-19-2006 , 08:15  
Reply With Quote #3

ROFL this is totally my Ninja Mod

What did you even start? Copying and pasting my code?
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
$tretch
Junior Member
Join Date: Nov 2005
Old 01-20-2006 , 11:39  
Reply With Quote #4

Yup that's Kensai's code alright......
(PS Kensai, not quite sure what "karma" is but I gave you all that it would let me lol)
$tretch is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 01-20-2006 , 11:59  
Reply With Quote #5

Why don't you just post in the original plugin's thread and ask the author of that plugin, Kensai, if he'd make the changes you'd like? That's the standard operating procedure.
Brad is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 01-20-2006 , 12:52  
Reply With Quote #6

Atleast he didn't take credit for it:
Quote:
Originally Posted by Hell_Puppy
heres what he/they had started, i take no credit for this:
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
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:36.


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