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

Weapons War v7.5 (26 Weapons)


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-23-2015 , 05:24   Re: Weapons War v6.1 (26 Weapons)
Reply With Quote #111

Have you modified the cs_reward.sma file?
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-28-2015 , 23:39   Re: [API] Weapons War v6.1 (26 Weapons || 4 Forwards)
Reply With Quote #112

[API] Weapons War v6.2
(26 Weapons || 4 Forwards)

Status:
UP-TO-DATE
(29/1/2015)

It is Weapons war!



New Cvars?
PHP Code:
    g_iAutoWarVote register_cvar("ww_auto_vote""1"// Allow auto war vote
    
g_iVoteDelay register_cvar("ww_vote_delay""2"// Amount of round delay for auto war vote
    
g_iAutoWarStart register_cvar("ww_auto_war""1"// Allow auto war start
    
g_iWarDelay register_cvar("ww_war_delay""3"// Amount of round delay for auto war start
    
g_iAutoRespawn register_cvar("ww_allow_respawn""1"// Allow auto respawn during war round 
New Features?

This plugin is different from other weapons round plugin:
1. There is an option for you to choose whether to show hud about current weapons war round.

2. Now, you can allow auto-war vote or auto-war start.

3. Adding custom natives and forwards for any coders to modify the gameplay.

4. Auto-respawn feature.

Multi-lingual?

New senteces that need to be translated. ;)
Code:
[en]
EQUAL = There is no points leader!
LEADER = %s is point leader with %d point!
cs_war.inc file?

So, this is the list of natives and forwards:
PHP Code:
/**
 * Return whether current round is war round
 */
native cs_is_war_round();

/**
 * Return current war name
 */
native cs_current_war();

/**
 * Return war ID
 */
native cs_get_war_id(const szWarID[]);

/**
 * This is called during a war round is started
 * param sWarID - Internal ID for the chosen war
 */
forward cs_fw_war_start(sWarID);

/**
 * This is called during a war round is end
 * param sWarID - Internal ID for the chosen war
 */
forward cs_fw_war_end(sWarID);

/**
 * This is called during a war vote is started
 * param sWarID - Internal ID for the chosen war
 */
forward cs_fw_vote_start();

/**
 * This is called during a war vote is end
 * param sWarID - Internal ID for the chosen war
 */
forward cs_fw_vote_end(); 
For example, just download the war_trail.sma file to see how to use them. ;)

API Example?

Just download the war_trail.sma file to see how to use them. Then, open the war_trail.sma file to configure the trail color:
PHP Code:
    g_iWarTrail register_cvar("ww_allow_trail""1"// Allow player trail during war round
    
g_iCTAdminTrail register_cvar("ww_CT_admin_trail""0 255 0"// Trail color for CT admin
    
g_iTAdminTrail register_cvar("ww_T_admin_trail""255 127 0"// Trail color for T admin
    
g_iCTTrail register_cvar("ww_CT_trail""0 0 255"// Trail color for CT player
    
g_iTTrail register_cvar("ww_T_trail""255 0 0"// Trail color for T player 
Screenshots:

1. War Trail during weapon war.






Credits:
1. Exolent[jNr] for code helping.

Changelog:
Quote:
(29/1/2015)
v6.2
- [FIXED] Improved the readability or code.
- [FIXED] Code for HE grenade war as before this players only recieved 1 grenade only.
- [ADDED] Custom natives and forwards.
- [ADDED] New options to allow auto-war vote or auto-war start. ;)

Last edited by zmd94; 01-28-2015 at 23:54.
zmd94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-29-2015 , 09:04   Re: [API] Weapons War v6.2 (26 Weapons || 4 Forwards)
Reply With Quote #113

This api seems a bit poor, don't take it in a bad way. I will explain my point of view. This would be cool if the API allows us to register our own custom wars with plugin. Like only headshot with deagle. A bazooka war. Etc. Also all this current weapons could be inside of one single sub-plugin with something to people decide what weapons want to use. The idea would be more interesting, adding new guns with sub-plugins, could be used in any mod like zombie etc.
__________________
Jhob94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-29-2015 , 10:07   Re: [API] Weapons War v6.2 (26 Weapons || 4 Forwards)
Reply With Quote #114

Ah, you learned how to create an api, nice, but don't include it in every plugin you make just for the sake of having more code. If you want to add it, then do as Jhob said. I don't say that you should remove the current one, just add new natives.
__________________

Last edited by HamletEagle; 01-29-2015 at 10:07.
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-29-2015 , 19:41   Re: [API] Weapons War v6.2 (26 Weapons || 4 Forwards)
Reply With Quote #115

Jhob94 and HamletEagle, I appreciate your suggestion. It is very nice.

I will update this plugin. ;)
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-01-2015 , 09:09   Re: [API] Weapons War v6.3 (26 Weapons + 4 Forwards)
Reply With Quote #116

[API] Weapons War v6.3
(26 Weapons + 4 Forwards)

Status:
UP-TO-DATE
(1/2/2015)


Changelog:
Quote:
(1/2/2015)
v6.3
- [FIXED] Improved the code.
- [ADDED] New natives to allow player to design their own weapon war. ;)
- [ADDED] New options to allow auto-respawn. ;)
Advantages?

This plugin is different from other weapons round plugin:
1. Now, you can start custom war round. Just download custom_war.sma to see how I'm using the new natives. ;)
New senteces?

So, I would love if anyone can help me to translate the word into their language. Just visit here to help me to translate it: https://forums.alliedmods.net/showthread.php?t=246330
Code:
[en]
WAR = %s round!
WAR2 = Current round: ^n%s war!
New natives?

So, this is the list of natives and forwards:
PHP Code:
/*
 * Return current war name
 * param const szWarName[] - the name of current weapon war round
 * param iLen - maximum size of buffer
*/
native cs_current_war(const szWarName[], iLen);

/*
 * Return last war name
 * param const szWarName[] - the name of current weapon war round
 * param iLen - maximum size of buffer
*/
native cs_last_war(const szWarName[], iLen);

/**
 * Return point leader
 * param id - ID of client
 */
native cs_is_point_leader(id); 
Custom Weapon War?

Just see custom_war.sma file. ;)
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cs_war>

// Configure admin flag
#define ADMIN_FLAG ADMIN_VOTE

// String
new g_sCurrentWar[32]

public 
plugin_init()
{
    
register_plugin("Custom War""1.0""zmd94")
    
    
// In this example, I just show how to start a custom war using a command.
    // If you want to start the custom war automatically, just comment to learn.
    // We also can add more that 1 custom war. ;)
    
register_clcmd("say /cw""clcmd_custom_war")
    
register_clcmd("say_team /cw""clcmd_custom_war")
    
register_clcmd("say /cvote""clcmd_custom_vote")
    
register_clcmd("say_team /ccvote""clcmd_custom_vote")
    
    
register_forward(FM_TraceLine"forward_traceline"1)
}

public 
clcmd_custom_war(id)
{
    
// Register our custom war 
    // Just use cs_war_set(const szWarName[], const szWarID[]) native.
    // const szWarName[] - the name of weapon war round
    // const szWarID[] - the name of weapon ID
    
    // In this example, I choose to give all players AK-47. ;)
    
cs_war_set("Head Hunter""weapon_ak47"
    
// Other than this, you also can set random custom war
    // and just using pcvar.
    // Just comment if you want to learn. ;)
    
    // Then, start our custom war
    // Just use cs_start_war() native 
    
    
cs_start_war()
}

public 
clcmd_custom_vote(id)
{
    
// Register our custom war vote
    // Just use cs_war_set(const szWarName[], const szWarID[]) native.
    // const szWarName[] - the name of weapon war round
    // const szWarID[] - the name of weapon ID
    
    // In this example, I choose to give all players AK-47. ;)
    
cs_war_set("Head Hunter""weapon_ak47")
    
// Other than this, you also can set random custom war
    // and just using pcvar.
    // Just comment if you want to learn. ;)
    
    // Then, start our custom war
    // Just use cs_start_vote(Float:fVoteTime) native
    // Float:fVoteTime - the durations for voting
    
    // Vote for 30s
    
cs_start_vote(30.0)
}

// War round is start.
public cs_fw_war_start()
{    
    
// Just use native cs_current_war(const szWarName[], iLen) inside cs_fw_war_start() forward. ;)
    
cs_current_war(g_sCurrentWarcharsmax(g_sCurrentWar))    
    
    
// No.'11' is number of characters to compare.
    // In this example is '11' characters. ;)
    
if(equal(g_sCurrentWar"Head Hunter"11))
    {
        
client_print(0print_chat"[WW] Run everyone!")
    }
}

// Credit to ConnorMcLeod
// This will only allow player to dealt a damage if their bullets hit enemies's head. ;)
public forward_traceline(Float:v1[3], Float:v2[3], noMonsterspentToSkip)
{
    
// If now is not war round. ;)
    
if(!cs_is_war_round() || !is_user_alive(pentToSkip))
        return 
FMRES_IGNORED

    
static entity2 entity2 get_tr(TR_pHit)
    if(!
is_user_alive(entity2) || pentToSkip == entity2)
        return 
FMRES_IGNORED

    
if(get_tr(TR_iHitgroup) != 1
    {
        
set_tr(TR_flFraction,1.0)
        return 
FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED



How to use the API?
PHP Code:
///////////////////////////////////////////////////////////////
// Below is how to get current weapon war round as global string? 

// String
new g_sCurrentWar[32]

public 
cs_fw_war_start()
{
    
// Just use native cs_current_war(const szWarName[], iLen) inside cs_fw_war_start() forward. ;)
    
cs_current_war(g_sCurrentWarcharsmax(g_sCurrentWar))    
}

public 
cs_fw_vote_start()
{
    if(
equal(g_sCurrentWar"Auto-Shotgun"11))
    {
        
client_print(0print_chat"Voting Auto-Shotgun round!")
    }
}

/////////////////////////////////////////////////////////////
// Below is how to use cs_fw_war_start() forward.
public cs_fw_war_start()
{
    
// Below is how to get current weapon war round. ;)
    // Just use native cs_current_war(const szWarName[], iLen);
    
new sCurrentWar[32]
    
cs_current_war(sCurrentWarcharsmax(sCurrentWar))
    
    if(
equal(sCurrentWar"Auto-Shotgun"11))
    {
        
client_print(0print_chat"Now is Auto-Shotgun round!")
    }
}

/////////////////////////////////////////////////////////////
// Below is how to use cs_fw_vote_start() forward.
public cs_fw_war_end()
{
    
client_print(0print_chat"End of war!")
}

/////////////////////////////////////////////////////////////
// Below is how to use cs_fw_vote_start() forward.
public cs_fw_vote_start()
{
    
client_print(0print_chat"Please vote now!")
}

/////////////////////////////////////////////////////////////
// Below is how to use cs_fw_vote_end() forward.
public cs_fw_vote_end()
{
    
client_print(0print_chat"End of voting!")
}

/////////////////////////////////////////////////////////////
// Below is how to use cs_is_point_leader(id) native.
public fw_PlayerRespawn(id)
{
    if(
is_user_alive(id))
    {
        
// If point leader still in server after war round. Just tell about it again. ;)
        
if(cs_is_point_leader(id))
        {
            new 
szName[32]
            
get_user_name(idszNamecharsmax(szName))
            
            
client_print(0print_chat"[WW] %s is points leader!"szName)
        }
    }

zmd94 is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 02-04-2015 , 15:35   Re: Weapons War v6.1 (26 Weapons)
Reply With Quote #117

Quote:
Originally Posted by zmd94 View Post
Have you modified the cs_reward.sma file?
no I didn't modify anythings !!
__________________
MaTriX is my life
Visit Here ;) For ZP MODs
feifei is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-04-2015 , 18:11   Re: [API] Weapons War v6.3 (26 Weapons + 4 Forwards)
Reply With Quote #118

So, is the error still the same?
zmd94 is offline
feifei
Senior Member
Join Date: Sep 2014
Location: India
Old 02-05-2015 , 00:43   Re: [API] Weapons War v6.3 (26 Weapons + 4 Forwards)
Reply With Quote #119

Quote:
Originally Posted by zmd94 View Post
So, is the error still the same?
yes.. when I want to compile cs_reward.sma that time showing error..

and I compiled custom_war.sma war_tail.sma all are done just need cs_reward.sma !! sad
__________________
MaTriX is my life
Visit Here ;) For ZP MODs
feifei is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-05-2015 , 11:59   Re: [API] Weapons War v6.3 (26 Weapons + 4 Forwards)
Reply With Quote #120

Just try to update your compiler version. It is weird as I can compile the .sma file with 1.8.2 and also 1.8.3 version.
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:53.


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