AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help-Me (https://forums.alliedmods.net/showthread.php?t=224914)

Lawiet 08-29-2013 14:42

Help-Me
 
Quote:

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

#define PLUGIN "WeaponGive"
#define VERSION "1.0"
#define AUTHOR "Dr.House"

new CurrentRound
new maxplayers
new g_menu_active
new bool:cmdAcces[33], g_iMaxPlayers

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("LogEvent_RoundStart", 1, "1=Round_Start" );
maxplayers = get_maxplayers()
g_menu_active = register_cvar("menu_active", "1");
}

public LogEvent_RoundStart()
{
CurrentRound++;
new players[32], player, pnum;
get_players(players, pnum, "a");
for(new i = 0; i < pnum; i++)
{
player = players[i];
if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
{
give_item(id, "weapon_hegrenade");
give_item(id, "item_assaultsuit");
give_item(id, "item_thighpack");

if (!get_pcvar_num(g_menu_active))
return PLUGIN_CONTINUE

if(CurrentRound >= 1)

return PLUGIN_HANDLED
}
}
}
Error In Give Item, He Da Error In Compile Time Help Me Please

YamiKaitou 08-29-2013 14:47

Re: Help-Me
 
Replace id with player

Lawiet 08-29-2013 14:49

Re: Help-Me
 
Please, Could Tell Me Fit. Sma Cause I'm Very Apprentice!

wickedd 08-29-2013 14:52

Re: Help-Me
 
He told you what to do.

Quote:

Originally Posted by YamiKaitou (Post 2024270)
Replace id with player


Lawiet 08-29-2013 15:17

Re: Help-Me
 
I managed to compile worked, So Do not Give Owed the Weapons!

Lawiet 08-29-2013 15:32

Help-Me
 
My Plugin Is Not Giving Weapon, More When I Player I put in place of id Compiles When I id I put in place the Player Not Compile Error

Quote:

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

#define PLUGIN "WeaponGive"
#define VERSION "1.0"
#define AUTHOR "Dr.House"

new CurrentRound
new maxplayers
new g_menu_active
new bool:cmdAcces[33], g_iMaxPlayers

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("LogEvent_RoundStart", 1, "1=Round_Start" );
maxplayers = get_maxplayers()
g_menu_active = register_cvar("menu_active", "1");
}

public LogEvent_RoundStart()
{
CurrentRound++;
new players[32], player, pnum;
get_players(players, pnum, "a");
for(new i = 0; i < pnum; i++)
{
player = players[i];
if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
{
give_item(player, "weapon_m3")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"ammo_556nato")
give_item(player,"weapon_deagle")
give_item(player,"ammo_50ae")
give_item(player,"ammo_50ae")
give_item(player,"ammo_50ae")
give_item(player,"ammo_50ae")
give_item(player,"ammo_50ae")
give_item(player,"ammo_50ae")
give_item(player,"ammo_50ae")
give_item(player,"weapon_knife")
give_item(player,"weapon_hegrenade")
give_item(player, "item_assaultsuit");
give_item(player, "item_thighpack");
cs_set_user_bpammo( player, CSW_M3, 99 )
cs_set_user_bpammo( player, CSW_DEAGLE, 99 )

if (!get_pcvar_num(g_menu_active))
return PLUGIN_CONTINUE

if(CurrentRound >= 1)

return PLUGIN_HANDLED
}
}
}

Black Rose 08-29-2013 16:23

Re: Help-Me
 
First, fix the title.

is_user_alive(player) is not needed because of the "a" flag in get_players().
I would suggest adding "h" as a flag aswell.

Code:
            if (!get_pcvar_num(g_menu_active))                 return PLUGIN_CONTINUE             if(CurrentRound >= 1) // This will always return true.                 return PLUGIN_HANDLED
Both of these will break the loop and exit the function after one player receive these items. Is this what you want?

Why don't you explain what you want instead? It's hard to guess with these things.

wickedd 08-29-2013 16:31

Re: Help-Me
 
You can remove "give_item( player, "ammo_556nato" ) because "cs_set_user_bpammo( player, CSW_M3, 99 )
does the same thing.


All times are GMT -4. The time now is 19:14.

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