Raised This Month: $32 Target: $400
 8% 

who can found the problem :D


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Redhaess10
Member
Join Date: Apr 2016
Old 05-08-2016 , 15:33   who can found the problem :D
Reply With Quote #1

PHP Code :

#include < amxmodx >
#include < fun >
#include < engine >
#include < hamsandwich >

#define PLUGIN "restrict weapon ts"
#define VERSION "extremepluginz.blogspot.com"
#define AUTHOR "26-{indra}"

public plugin_init( )
{
register_plugin(PLUGIN, VERSION, AUTHOR);

//register_event
RegisterHam(Ham_Spawn, "player", "Spawn", 1);

//block weapon pickup
register_touch("weaponbox", "player", "Weapon_Pickup")
register_touch("armoury_entity", "player", "Weapon_Pickup")

//block buy
register_message( get_user_msgid( "StatusIcon" ), "Msg_StatusIcon" );
}

public Spawn(id)
{
if(is_user_alive(id))
{
new Players[ 32 ], iNum, id;
get_players( Players, iNum, "eh" ,"TERRORIST");

while( --iNum >= 0 )
{
id = Players[iNum];
strip_user_weapons(id);
give_item(id,"weapon_knife");
give_item(id,"weapon_hegrenade");
give_item(id,"weapon_flashbang");
give_item(id,"weapon_smokegrenade");
}
}
}

public Msg_StatusIcon( msgid, msgdest, id ) {
static szMsg[ 8 ];
get_msg_arg_string( 2, szMsg, 7 );

if( equal( szMsg, "buyzone" ) && get_msg_arg_int( 1 ) && (get_user_team(id) == 1) )
{
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public Weapon_Pickup(iEnt, id)
{
return get_user_team(id) == 1
}

Last edited by Redhaess10; 05-08-2016 at 17:53.
Redhaess10 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-08-2016 , 16:30   Re: who can found the problem :D
Reply With Quote #2

use php code
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-08-2016 , 16:32   Re: who can found the problem :D
Reply With Quote #3

Don't use the ham spawn and loop all players 32 times. Omg.
This is called for every player appart.
Best way is to use this and don't use ham include.
PHP Code:
#include < amxmodx >
#include < fun >
#include < engine >

#define PLUGIN "Restrict"
#define VERSION "1.0"
#define AUTHOR "26-{indra}"

#define TASK_SW 11442

public plugin_init( ) 
{
register_plugin(PLUGINVERSIONAUTHOR);

//register_event
register_event("HLTV""event_new_round""a""1=0""2=0")  

//block weapon pickup
register_touch("weaponbox""player""Weapon_Pickup")
register_touch("armoury_entity""player""Weapon_Pickup")

//block buy
register_messageget_user_msgid"StatusIcon" ), "Msg_StatusIcon" ); 
}

public 
event_new_round(){

  if(
task_exists(TASK_SW))
  
remove_task(TASK_SW)
  
set_task(1.5"set_weapons"TASK_SW)
}

public 
set_weapons()
{
    new 
iPlayers[32], iPlayersNumiid;
    
get_players(iPlayersiPlayersNum"ae" ,"TERRORIST")
    for (
0iPlayersNum; ++i)
    { 
      
id iPlayers[iPlayersNum];
      
strip_user_weapons(id);
      
give_item(id,"weapon_knife");
      
give_item(id,"weapon_hegrenade");
      
give_item(id,"weapon_flashbang");
      
give_item(id,"weapon_smokegrenade");
    }


public 
Msg_StatusIconmsgidmsgdestid ) { 
static 
szMsg]; 
get_msg_arg_string2szMsg); 

if( 
equalszMsg"buyzone" ) && get_msg_arg_int) && (get_user_team(id) == 1) )

return 
PLUGIN_HANDLED

return 
PLUGIN_CONTINUE
}
public 
Weapon_Pickup(iEntid)
{
return 
get_user_team(id) == 1


Last edited by siriusmd99; 05-08-2016 at 16:42.
siriusmd99 is offline
Redhaess10
Member
Join Date: Apr 2016
Old 05-08-2016 , 17:33   Re: who can found the problem :D
Reply With Quote #4

the same problem bro
1 - the first code php ( me ) plugin not work
2 - your amxx error ( can't compiler )
Redhaess10 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-08-2016 , 17:54   Re: who can found the problem :D
Reply With Quote #5

compiler works , i did myself. Post a screenshot with compiler error.
siriusmd99 is offline
Redhaess10
Member
Join Date: Apr 2016
Old 05-09-2016 , 07:02   Re: who can found the problem :D
Reply With Quote #6

Redhaess10 is offline
crnova
Senior Member
Join Date: Sep 2015
Old 05-09-2016 , 07:28   Re: who can found the problem :D
Reply With Quote #7

Don't use online compiler, use the local one
__________________
crnova is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2016 , 08:40   Re: who can found the problem :D
Reply With Quote #8

Quote:
Originally Posted by crnova View Post
Don't use online compiler, use the local one
The online compiler works just fine for the plugin posted by siriusmd99.
__________________
fysiks is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 05-09-2016 , 08:43   Re: who can found the problem :D
Reply With Quote #9

here just click on get plugin.

Quote:
Originally Posted by fysiks View Post
The online compiler works just fine for the plugin posted by siriusmd99.
some times it give errors , i mostly compile plugin locally.
Attached Files
File Type: sma Get Plugin or Get Source (restrict_weapon.sma - 537 views - 1.4 KB)

Last edited by tousif; 05-09-2016 at 08:44.
tousif is offline
Redhaess10
Member
Join Date: Apr 2016
Old 05-09-2016 , 11:08   Re: who can found the problem :D
Reply With Quote #10

tousif bro o.O player terrorist can't buy or pickup weapon but bot's can o.O WTF
pro if you can try to edit plugin that bot's terrorist can't olso buy or pickup weapon only knife and the 3 bombs
Redhaess10 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 17:37.


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