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

[REQ] Fix Already On


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 12-25-2011 , 17:31   [REQ] Fix Already On
Reply With Quote #1

Hey For All.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "Ammo"
#define VERSION "1.0"
#define AUTHOR "Asaf Mazon"
new g_AlreadyStealth[33]; 
public 
plugin_init()
{    
 
register_plugin(PLUGINVERSIONAUTHOR)    
 
 
register_clcmd("say /ammo""ammo");
 
 
register_event("HLTV""event_round_start""a""1=0""2=0")
}
public 
event_round_startid )
{
 
g_AlreadyStealth[id] = 0;
}
public 
ammo(id)
{
 new 
menu menu_create("Stealth""ammo3");
 
menu_additem(menu"\wStealth""1"0);
 
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
 
menu_display(idmenu0);
 return 
PLUGIN_HANDLED;
}
public 
ammo3(idmenuitem)
{
 if(
item == MENU_EXIT)
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
data[6], szName[64];
 new 
accesscallback;
 
menu_item_getinfo(menuitemaccessdata,5szName,63callback);
 
 new 
key str_to_num(data);
 
 switch(
key)
 {
  case 
1:
  {
   if(
g_AlreadyStealth[id]  == 1
   {
    
ColorChat(idNORMAL"%s You already bought^x04 Stealth^x01 in this round."TAG);
    return 
PLUGIN_HANDLED;
   }
   
   
g_AlreadyStealth[id] = 1;
   
set_user_rendering(idkRenderFxNone000kRenderTransAlpha7)
   
set_task(15.0"REMOVE")
   
ColorChat(idNORMAL"%s You have bought^x04 Flashbang."TAG);
  }
 }
 
menu_destroy(menu);
 return 
PLUGIN_HANDLED;
}
public 
REMOVE(id)
{
 
set_user_rendering(idkRenderFxNone000kRenderTransAlpha250)

i need someone fix me this plugin pls
that plugin once at map, i'll need someone fix it once at round pls..
Thank's
ShLuMieL is offline
Splot
Junior Member
Join Date: Nov 2011
Old 12-25-2011 , 18:49   Re: [REQ] Fix Already On
Reply With Quote #2

try it :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <colorchat>

#define PLUGIN "Ammo"
#define VERSION "1.0"
#define AUTHOR "Asaf Mazon"

new bool:g_AlreadyStealth 33 ]
 
public 
plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR)    
 
    
register_clcmd("say /ammo""ammo");
 
    
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
client_connect id ) {
    
g_AlreadyStealth id ] = false
}
public 
event_round_startid ) {
    
g_AlreadyStealth id ] = false
}

public 
ammo(id) {
    new 
menu menu_create("Stealth""ammo3");
    
menu_additem(menu"\wStealth""1"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}

public 
ammo3(idmenuitem) {
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5szName,63callback);
 
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1:
        {
            if(
g_AlreadyStealth[id]  == true
            {
                
ColorChat(idNORMAL"You already bought^x04 Stealth^x01 in this round.");
                return 
PLUGIN_HANDLED;
            }
            else {
                
g_AlreadyStealth[id] = true;
                
set_user_rendering(idkRenderFxNone000kRenderTransAlpha7)
                
ColorChat(idNORMAL"you have bought^x04 Flashbang.");
                
set_task(15.0"REMOVE"id)
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
REMOVE(id) {
 
set_user_rendering(idkRenderFxNone000kRenderTransAlpha250)

נסה לסדר יותר תקוד שלך , תקפיד על רווחים כדי שהקוד יהיה יותר מובן .
הורדתי לך כמה דברים כמו TAG .
שלא הגדרת אותו .

חוצמזה היית צריך לשנות את זה:
PHP Code:
set_task(15.0"REMOVE"
ל:
PHP Code:
set_task(15.0"REMOVE"id
תהנה .

Last edited by Splot; 12-25-2011 at 18:54.
Splot is offline
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 12-25-2011 , 21:29   Re: [REQ] Fix Already On
Reply With Quote #3

its doesn't work
ShLuMieL is offline
Splot
Junior Member
Join Date: Nov 2011
Old 12-26-2011 , 02:50   Re: [REQ] Fix Already On
Reply With Quote #4

try this :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <colorchat>
#include <hamsandwich> 

#define PLUGIN "Ammo"
#define VERSION "1.0"
#define AUTHOR "Asaf Mazon"

new bool:g_AlreadyStealth 33 ]
 
public 
plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR)    
 
    
register_clcmd("say /ammo""ammo");
    
RegisterHam(Ham_Spawn"player""Event_Playerspawn"1)    
}

public 
ammo(id) {
    new 
menu menu_create("Stealth""ammo3");
    
menu_additem(menu"\wStealth""1"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}

public 
ammo3(idmenuitem) {
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5szName,63callback);
 
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1:
        {
            if(
g_AlreadyStealth[id]  == false ) { 
                
g_AlreadyStealth id ] = true
                set_user_rendering
(idkRenderFxNone25500kRenderTransAlpha50)
                
ColorChat(idNORMAL"you have bought^x04 Stealth.");
                
set_task(15.0"REMOVE"id)
                return 
PLUGIN_HANDLED;
            }            
            if(
g_AlreadyStealth[id]  == true ) {  
                
ColorChat(idNORMAL"You already bought^x04 Stealth^x01 in this round.");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
client_connect id )
    
g_AlreadyStealth id ] = false
    
public Event_Playerspawnid )
    
g_AlreadyStealth id ] = false

public REMOVE(id)
    
set_user_rendering(idkRenderFxNone000kRenderTransAlpha250

Last edited by Splot; 12-26-2011 at 02:59.
Splot is offline
MyPc
Senior Member
Join Date: Sep 2011
Old 12-26-2011 , 02:51   Re: [REQ] Fix Already On
Reply With Quote #5

Quote:
Originally Posted by Splot View Post
try it :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <colorchat>

#define PLUGIN "Ammo"
#define VERSION "1.0"
#define AUTHOR "Asaf Mazon"

new bool:g_AlreadyStealth 33 ]
 
public 
plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR)    
 
    
register_clcmd("say /ammo""ammo");
 
    
register_event("HLTV""event_round_start""a""1=0""2=0")
}

public 
client_connect id ) {
    
g_AlreadyStealth id ] = false
}
public 
event_round_startid ) {
    
g_AlreadyStealth id ] = false
}

public 
ammo(id) {
    new 
menu menu_create("Stealth""ammo3");
    
menu_additem(menu"\wStealth""1"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}

public 
ammo3(idmenuitem) {
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5szName,63callback);
 
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1:
        {
            if(
g_AlreadyStealth[id]  == true
            {
                
ColorChat(idNORMAL"You already bought^x04 Stealth^x01 in this round.");
                return 
PLUGIN_HANDLED;
            }
            else {
                
g_AlreadyStealth[id] = true;
                
set_user_rendering(idkRenderFxNone000kRenderTransAlpha7)
                
ColorChat(idNORMAL"you have bought^x04 Flashbang.");
                
set_task(15.0"REMOVE"id)
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
REMOVE(id) {
 
set_user_rendering(idkRenderFxNone000kRenderTransAlpha250)

נסה לסדר יותר תקוד שלך , תקפיד על רווחים כדי שהקוד יהיה יותר מובן .
הורדתי לך כמה דברים כמו TAG .
שלא הגדרת אותו .

חוצמזה היית צריך לשנות את זה:
PHP Code:
set_task(15.0"REMOVE"
ל:
PHP Code:
set_task(15.0"REMOVE"id
תהנה .
You are not allowed to use other languages then English in this forums.
PHP Code:
#include <amxmodx>
#include <fun>
#include <colorchat>

new bool:g_bHaveStealth[33];

public 
client_connect(plr)
{
    
g_bHaveStealth[plr] = false;
}

public 
FwdRoundStart()
{
    new 
players[32], numplayer;
    
get_players(playersnum);
    for(new 
0num; ++i)
    {
        
player players[i];
        
g_bHaveStealth[player] = false;
    }
}

public 
plugin_init()
{
    
register_clcmd("say /ammo""menu");
    
register_event("HLTV""FwdRoundStart""a""1=0""2=0");
}

public 
menuiIndex )
{
    new 
iMenu menu_create"Menu name""menu_handler" );
    
    
menu_additemiMenu"\wStealth""1" );
    
    
menu_setpropiMenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayiIndexiMenu);
}

public 
menu_handleriIndexiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iData64 ], iName64 ], iAccessiCallBack;
    
menu_item_getinfoiMenuiItemiAccessiDatasizeof iData 1iNamesizeof iName 1iCallBack );
    
    new 
iKey str_to_numiData );
    
    switch( 
iKey )
    {
        case 
1:
        {
            if( 
g_bHaveStealth[iIndex] )
            {
                
ColorChat(iIndexNORMAL"You already bought^x04 Stealth^x01 in this round.");
                return 
PLUGIN_HANDLED;
            }
            else
            {
                
set_user_rendering(iIndexkRenderFxNone000kRenderTransAlpha7);
                
ColorChat(iIndexNORMAL"you have bought^x04 Flashbang.");
                
g_bHaveStealth[iIndex] = true;
                
set_task(15.0"remvoe_stealth"iIndex );
                return 
PLUGIN_HANDLED;
            }
        }
    }
    
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
remove_stealth(iIndex)
{
    
set_user_rendering(iIndex);


Last edited by MyPc; 12-26-2011 at 02:52.
MyPc 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 22:11.


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