Raised This Month: $ Target: $400
 0% 

help me plugins!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rebeccs
Junior Member
Join Date: May 2015
Old 05-14-2015 , 01:28   help me plugins!
Reply With Quote #1

This plugin is I adapted, but after use, upgrade the wrong name, hope you help me will he the D.O.D. thanks.



#include <amxmodx>
#include <amxmisc>
#include <dodstats>

#define HUD_INTERVAL 1.0

#define RANK_Just_Joined 0
#define RANK_PRIVATE 1
#define RANK_PRIVATE_FIRST_CLASS 2
#define RANK_CORPORAL 3
#define RANK_SERGEANT 4
#define RANK_STAFF_SERGEANT 5
#define RANK_GUNNERY_SERGEANT 6
#define RANK_MASTER_SERGEANT 7
#define RANK_COMMAND_SERGEANT 8
#define RANK_SECOND_LIEUTENANT 9
#define RANK_FIRST_LIEUTENANT 10
#define RANK_COLONEL 11
#define RANK_BRIGADIER_GENERAL 12
#define RANK_MAJOR_GENERAL 13
#define RANK_LIEUTENANT_GENERAL 14
#define RANK_GENERAL 15
#define RANK_GENERAL_OF_THE_ARMY 16

#define MAXRANKS 17

new PlayerRank[33]

new const RANKS[MAXRANKS][] =
{
"Just Joined",
"Private",
"Private First Class",
"Corporal",
"Sergeant",
"Staff Sergeant",
"Gunnery Sergeant",
"Master Sergeant",
"Command Sergeant",
"Second Lieutenant",
"First Lieutenant",
"Colonel",
"Brigadier General",
"Major General",
"Lietenant General",
"General",
"General of the Army"

}

public plugin_init()
{
register_plugin("Rank Display", "1.0", "Kensai")
register_cvar("sv_mranks","1")
}

public client_putinserver(id)
{
set_task(HUD_INTERVAL, "ShowHUD", id)
if(get_cvar_num("sv_mranks")==0)
{
return PLUGIN_HANDLED
}
return 0
}



public ShowHUD(id)
{
if(!is_user_connected(id))
return 0

new stats[9]
new hits[8]
get_user_stats(id, stats, hits)

new name[33]
get_user_name(id, name, 32)

if(stats[0] < 100)
{
PlayerRank[id] = RANK_Just_Joined
}
if(stats[0] >= 100 || stats[0] <= 200)
{
PlayerRank[id] = RANK_PRIVATE
}
if(stats[0] >= 201 || stats[0] <= 400)
{
PlayerRank[id] = RANK_PRIVATE_FIRST_CLASS
}
if(stats[0] >= 401 || stats[0] <= 800)
{
PlayerRank[id] = RANK_CORPORAL
}
if(stats[0] >= 801 || stats[0] <= 1000)
{
PlayerRank[id] = RANK_SERGEANT
}
if(stats[0] >= 1001 || stats[0] <= 2000)
{
PlayerRank[id] = RANK_STAFF_SERGEANT
}
if(stats[0] >= 2001 || stats[0] <= 4000)
{
PlayerRank[id] = RANK_GUNNERY_SERGEANT
}
if(stats[0] >= 4001 || stats[0] <= 8000)
{
PlayerRank[id] = RANK_MASTER_SERGEANT
}
if(stats[0] >= 8001 || stats[0] <= 10000)
{
PlayerRank[id] = RANK_COMMAND_SERGEANT
}
if(stats[0] >= 10001 || stats[0] <= 12000)
{
PlayerRank[id] = RANK_SECOND_LIEUTENANT
}
if(stats[0] >= 12001 || stats[0] <= 15000)
{
PlayerRank[id] = RANK_FIRST_LIEUTENANT
}
if(stats[0] >= 15001 || stats[0] <= 20000)
{
PlayerRank[id] = RANK_COLONEL
}
if(stats[0] >= 20001 || stats[0] <= 40000)
{
PlayerRank[id] = RANK_BRIGADIER_GENERAL
}
if(stats[0] >= 40001 || stats[0] <= 50000)
{
PlayerRank[id] = RANK_MAJOR_GENERAL
}
if(stats[0] >= 50001 || stats[0] <= 80000)
{
PlayerRank[id] = RANK_LIEUTENANT_GENERAL
}
if(stats[0] >= 80001 || stats[0] <= 100000)
{
PlayerRank[id] = RANK_GENERAL
}
if(stats[0] >= 100001)
{
PlayerRank[id] = RANK_GENERAL_OF_THE_ARMY
}

set_hudmessage(237, 245, 9, 0.0, 0.6, 0, 6.0, 12.0)
show_hudmessage(id, "[%s - %s] Kills: %i", name, RANKS[PlayerRank[id]], stats[0])

set_task(HUD_INTERVAL, "ShowHUD", id)

return 0
}
rebeccs is offline
MaSTeR64
Member
Join Date: Apr 2015
Location: Serbia <3
Old 05-14-2015 , 03:58   Re: help me plugins!
Reply With Quote #2

Quote:
Originally Posted by rebeccs View Post
This plugin is I adapted, but after use, upgrade the wrong name, hope you help me will he the D.O.D. thanks.



#include <amxmodx>
#include <amxmisc>
#include <dodstats>

#define HUD_INTERVAL 1.0

#define RANK_Just_Joined 0
#define RANK_PRIVATE 1
#define RANK_PRIVATE_FIRST_CLASS 2
#define RANK_CORPORAL 3
#define RANK_SERGEANT 4
#define RANK_STAFF_SERGEANT 5
#define RANK_GUNNERY_SERGEANT 6
#define RANK_MASTER_SERGEANT 7
#define RANK_COMMAND_SERGEANT 8
#define RANK_SECOND_LIEUTENANT 9
#define RANK_FIRST_LIEUTENANT 10
#define RANK_COLONEL 11
#define RANK_BRIGADIER_GENERAL 12
#define RANK_MAJOR_GENERAL 13
#define RANK_LIEUTENANT_GENERAL 14
#define RANK_GENERAL 15
#define RANK_GENERAL_OF_THE_ARMY 16

#define MAXRANKS 17

new PlayerRank[33]

new const RANKS[MAXRANKS][] =
{
"Just Joined",
"Private",
"Private First Class",
"Corporal",
"Sergeant",
"Staff Sergeant",
"Gunnery Sergeant",
"Master Sergeant",
"Command Sergeant",
"Second Lieutenant",
"First Lieutenant",
"Colonel",
"Brigadier General",
"Major General",
"Lietenant General",
"General",
"General of the Army"

}

public plugin_init()
{
register_plugin("Rank Display", "1.0", "Kensai")
register_cvar("sv_mranks","1")
}

public client_putinserver(id)
{
set_task(HUD_INTERVAL, "ShowHUD", id)
if(get_cvar_num("sv_mranks")==0)
{
return PLUGIN_HANDLED
}
return 0
}



public ShowHUD(id)
{
if(!is_user_connected(id))
return 0

new stats[9]
new hits[8]
get_user_stats(id, stats, hits)

new name[33]
get_user_name(id, name, 32)

if(stats[0] < 100)
{
PlayerRank[id] = RANK_Just_Joined
}
if(stats[0] >= 100 || stats[0] <= 200)
{
PlayerRank[id] = RANK_PRIVATE
}
if(stats[0] >= 201 || stats[0] <= 400)
{
PlayerRank[id] = RANK_PRIVATE_FIRST_CLASS
}
if(stats[0] >= 401 || stats[0] <= 800)
{
PlayerRank[id] = RANK_CORPORAL
}
if(stats[0] >= 801 || stats[0] <= 1000)
{
PlayerRank[id] = RANK_SERGEANT
}
if(stats[0] >= 1001 || stats[0] <= 2000)
{
PlayerRank[id] = RANK_STAFF_SERGEANT
}
if(stats[0] >= 2001 || stats[0] <= 4000)
{
PlayerRank[id] = RANK_GUNNERY_SERGEANT
}
if(stats[0] >= 4001 || stats[0] <= 8000)
{
PlayerRank[id] = RANK_MASTER_SERGEANT
}
if(stats[0] >= 8001 || stats[0] <= 10000)
{
PlayerRank[id] = RANK_COMMAND_SERGEANT
}
if(stats[0] >= 10001 || stats[0] <= 12000)
{
PlayerRank[id] = RANK_SECOND_LIEUTENANT
}
if(stats[0] >= 12001 || stats[0] <= 15000)
{
PlayerRank[id] = RANK_FIRST_LIEUTENANT
}
if(stats[0] >= 15001 || stats[0] <= 20000)
{
PlayerRank[id] = RANK_COLONEL
}
if(stats[0] >= 20001 || stats[0] <= 40000)
{
PlayerRank[id] = RANK_BRIGADIER_GENERAL
}
if(stats[0] >= 40001 || stats[0] <= 50000)
{
PlayerRank[id] = RANK_MAJOR_GENERAL
}
if(stats[0] >= 50001 || stats[0] <= 80000)
{
PlayerRank[id] = RANK_LIEUTENANT_GENERAL
}
if(stats[0] >= 80001 || stats[0] <= 100000)
{
PlayerRank[id] = RANK_GENERAL
}
if(stats[0] >= 100001)
{
PlayerRank[id] = RANK_GENERAL_OF_THE_ARMY
}

set_hudmessage(237, 245, 9, 0.0, 0.6, 0, 6.0, 12.0)
show_hudmessage(id, "[%s - %s] Kills: %i", name, RANKS[PlayerRank[id]], stats[0])

set_task(HUD_INTERVAL, "ShowHUD", id)

return 0
}
Next time, put it like this:
PHP Code:
Test Test Test 
MaSTeR64 is offline
rebeccs
Junior Member
Join Date: May 2015
Old 05-14-2015 , 04:23   Re: help me plugins!
Reply With Quote #3

Sorry, I just don't know how to release
rebeccs is offline
bakir123
Senior Member
Join Date: Jan 2015
Location: Palestine, Hebron
Old 05-14-2015 , 04:28   Re: help me plugins!
Reply With Quote #4

Is easy go to advance
And put php code And add your code between ]here[
Without space
Like this
PHP Code:
test 

Last edited by bakir123; 05-14-2015 at 04:29.
bakir123 is offline
Send a message via Skype™ to bakir123
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 05-14-2015 , 07:11   Re: help me plugins!
Reply With Quote #5

use this tags :p [PHP] ur code here [/PHP]

Last edited by tousif; 05-15-2015 at 03:02.
tousif is offline
rebeccs
Junior Member
Join Date: May 2015
Old 05-14-2015 , 20:45   Re: help me plugins!
Reply With Quote #6

php why? /php
rebeccs is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-14-2015 , 22:03   Re: help me plugins!
Reply With Quote #7

Quote:
Originally Posted by rebeccs View Post
php why? /php
We suggest that you use [PHP][/PHP] or [CODE][/CODE] tags around your code so that it shows more properly and much easier to read. The advantage of the PHP tags is that it highlights the code syntax.

Quote:
Originally Posted by tousif View Post
use this tags :p [PHP.] text here [/PHP.]

remove dots :p
When telling someone how to use bbcode, you can use the [noparse][/noparse] tags. Before you post, it will look like this:

[noparse][PHP]code[/PHP][/noparse]

and after:

[PHP]code[/PHP]
__________________
fysiks is offline
rebeccs
Junior Member
Join Date: May 2015
Old 05-15-2015 , 02:31   Re: help me plugins!
Reply With Quote #8

Sorry, I know. But it is not about how should I release my information. It solved my problems. How should I edit this plugin, it can be used in Day of Defeat.......... Thank you.
rebeccs is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-15-2015 , 06:02   Re: help me plugins!
Reply With Quote #9

What doesn't work? Your original description is vague. I don't see anything that would inherently cause it to not work.
__________________
fysiks is offline
RaZ_HU
Senior Member
Join Date: May 2015
Location: Hungary
Old 05-15-2015 , 07:10   Re: help me plugins!
Reply With Quote #10

Try this one, modified it a bit.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dodstats>

#define HUD_INTERVAL 1.0

#define RANK_Just_Joined 0
#define RANK_PRIVATE 1
#define RANK_PRIVATE_FIRST_CLASS 2 
#define RANK_CORPORAL 3
#define RANK_SERGEANT 4
#define RANK_STAFF_SERGEANT 5
#define RANK_GUNNERY_SERGEANT 6
#define RANK_MASTER_SERGEANT 7
#define RANK_COMMAND_SERGEANT 8
#define RANK_SECOND_LIEUTENANT 9
#define RANK_FIRST_LIEUTENANT 10
#define RANK_COLONEL 11
#define RANK_BRIGADIER_GENERAL 12
#define RANK_MAJOR_GENERAL 13
#define RANK_LIEUTENANT_GENERAL 14
#define RANK_GENERAL 15
#define RANK_GENERAL_OF_THE_ARMY 16

#define MAXRANKS 17

new PlayerRank[33]
    new 
stats[9]
    new 
bodyhits[8]
    new 
name[33]
    
new const 
RANKS[MAXRANKS][] = 

    
"Just Joined",
    
"Private",
    
"Private First Class",
    
"Corporal",
    
"Sergeant",
    
"Staff Sergeant",
    
"Gunnery Sergeant",
    
"Master Sergeant",
    
"Command Sergeant",
    
"Second Lieutenant",
    
"First Lieutenant",
    
"Colonel",
    
"Brigadier General",
    
"Major General",
    
"Lietenant General",
    
"General",
    
"General of the Army"
}

public 
plugin_init() 
{
    
register_plugin("Rank Display""1.1""Kensai")
    
register_cvar("sv_mranks","1")
}

public 
client_putinserver(id)

    
set_task(HUD_INTERVAL"ShowHUD"id)
    if(
get_cvar_num("sv_mranks")==0)
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
getKills(id)
{
    
get_user_stats(idstatsbodyhits)    
}

public 
getName(id)
{
    
get_user_name(idname32)
}

public 
ShowHUD(id

    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE

    getKills
(id)
    
getName(id)

    if(
stats[0] < 100)
    {
        
PlayerRank[id] = RANK_Just_Joined
    
}
    if(
stats[0] >= 100 && stats[0] < 200)
    {
        
PlayerRank[id] = RANK_PRIVATE
    
}
    if(
stats[0] >= 200 && stats[0] < 400)
    {
        
PlayerRank[id] = RANK_PRIVATE_FIRST_CLASS
    
}
    if(
stats[0] >= 400 && stats[0] < 800)
    {
        
PlayerRank[id] = RANK_CORPORAL
    
}
    if(
stats[0] >= 800 && stats[0] < 1000)
    {
        
PlayerRank[id] = RANK_SERGEANT
    
}
    if(
stats[0] >= 1000 && stats[0] < 2000)
    {
        
PlayerRank[id] = RANK_STAFF_SERGEANT
    
}
    if(
stats[0] >= 2000 && stats[0] < 4000)
    {
        
PlayerRank[id] = RANK_GUNNERY_SERGEANT
    
}
    if(
stats[0] >= 4000 && stats[0] < 8000)
    {
        
PlayerRank[id] = RANK_MASTER_SERGEANT
    
}
    if(
stats[0] >= 8000 && stats[0] < 10000)
    {
        
PlayerRank[id] = RANK_COMMAND_SERGEANT
    
}
    if(
stats[0] >= 10000 && stats[0] < 12000)
    {
        
PlayerRank[id] = RANK_SECOND_LIEUTENANT
    
}
    if(
stats[0] >= 12000 && stats[0] < 15000)
    {
        
PlayerRank[id] = RANK_FIRST_LIEUTENANT
    
}
    if(
stats[0] >= 15000 && stats[0] < 20000)
    {
        
PlayerRank[id] = RANK_COLONEL
    
}
    if(
stats[0] >= 20000 && stats[0] < 40000)
    {
        
PlayerRank[id] = RANK_BRIGADIER_GENERAL
    
}
    if(
stats[0] >= 40000 && stats[0] < 50000)
    {
        
PlayerRank[id] = RANK_MAJOR_GENERAL
    
}
    if(
stats[0] >= 50000 && stats[0] < 80000)
    {
        
PlayerRank[id] = RANK_LIEUTENANT_GENERAL
    
}
    if(
stats[0] >= 80000 && stats[0] < 100000)
    {
        
PlayerRank[id] = RANK_GENERAL
    
}
    if(
stats[0] >= 100000)
    {
        
PlayerRank[id] = RANK_GENERAL_OF_THE_ARMY
    
}

    
set_hudmessage(23724590.00.606.012.0)
    
show_hudmessage(id"[%s - %s] Kills: %i"nameRANKS[PlayerRank[id]], stats[0])

    
set_task(HUD_INTERVAL"ShowHUD"id)

    return 
PLUGIN_CONTINUE


Last edited by RaZ_HU; 05-15-2015 at 07:19. Reason: Error corrected.
RaZ_HU 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 20:10.


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