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

need some help about a script of mine


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-(L-S)-LAT
Member
Join Date: Jun 2009
Old 05-04-2011 , 12:58   need some help about a script of mine
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#define PLUGIN_NAME "Adv Free-Weapons"
#define PLUGIN_VERSION "1.2"
#define PLUGIN_AUTHOR "-(L-S)- LAT"
#pragma semicolon 1
public plugin_init(){
    
register_pluginPLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR );
    
RegisterHam(Ham_Spawn,"player","free_weapons"1);
    
register_cvar("amx_free_weapons","1");
    
register_cvar("amx_fw_priweapon","m4a1");
    
register_cvar("amx_fw_secweapon","desert");
    
register_cvar("amx_fw_ammo","5");
    
register_cvar("amx_fw_hegrenade","1");
    
register_cvar("amx_fw_smokegrenade","1");
    
register_cvar("amx_fw_flashbang","2");
    
register_cvar("amx_fw_allnades","1");
    
register_cvar("amx_fw_nightgoogles","1");
    
register_cvar("amx_fw_defuse","1");
    
register_cvar("amx_fw_armor","300");
    
register_cvar("amx_fw_armortype","2");
    
register_cvar("amx_fw_bots","1");

    
register_cvar("amx_fw_mode","1");
}
public 
free_weapons(id){
    if(
get_cvar_num("amx_free_weapons") && is_user_bot(id)){
        switch(
get_user_team(id)){
            case 
1:
            {
                
// Team 1
                
new bots get_cvar_num("amx_fw_bots");
                if(
"bots" "3"){
                    if(
amx_fw_botsupport=3){
                        
Giveitems();
                        if(
get_cvar_num("amx_fw_secweapon")){
                            
GiveWeapons(get_cvar_num("amx_fw_secweapon"));
                        }
                        if(
get_cvar_num("amx_fw_priweapon")){
                            
GiveWeapons(get_cvar_num("amx_fw_priweapon"));
                        }
                    }
                }
            }
            case 
2:
            {
                
// Team 2
                
if(get_cvar_num("amx_fw_botsupport") == || get_cvar_num("amx_fw_botsupport") == 3){
                    if(
get_cvar_num("amx_fw_defuse")){
                        
cs_set_user_defuse(id,1,0,0,205);
                    }
                    
Giveitems();
                    if(
get_cvar_num("amx_fw_secweapon")){
                        
GiveWeapons(get_cvar_num("amx_fw_secweapon"));
                    }
                    if(
get_cvar_num("amx_fw_priweapon")){
                        
GiveWeapons(get_cvar_num("amx_fw_priweapon"));
                    }
                }
            }
        }
    }
    if(
get_cvar_num("amx_free_weapons") && is_user_connected(id) && !is_user_bot(id) && is_user_alive(id)){
        switch(
get_user_team(id)){
            case 
1:
            {
                
// Team 1
                
if(get_cvar_num("amx_fw_mode") = || get_cvar_num("amx_fw_mode") = 3){
                    
Giveitems();
                    if(
get_cvar_num("amx_fw_secweapon")){
                        
GiveWeapons(get_cvar_num("amx_fw_secweapon"));
                    }
                    if(
get_cvar_num("amx_fw_priweapon")){
                        
GiveWeapons(get_cvar_num("amx_fw_priweapon"));
                    }
                }
            }
            case 
2:
            {
                
// Team 2
                
if(get_cvar_num("amx_fw_mode") = || get_cvar_num("amx_fw_mode") = 3){
                    if(
get_cvar_num("amx_fw_defuse")){
                        
cs_set_user_defuse(id,1,0,0,205);
                    }
                    
Giveitems();
                    if(
get_cvar_num("amx_fw_secweapon")){
                        
GiveWeapons(get_cvar_num("amx_fw_secweapon"));
                    }
                    if(
get_cvar_num("amx_fw_priweapon")){
                        
GiveWeapons(get_cvar_num("amx_fw_priweapon"));
                    }
                }
            }
        }
    }
}
Giveitems(){
    switch(
get_cvar_num("amx_fw_armortype")){
        case 
1:
        {
            
give_item(id,"item_kevlar");
            
cs_set_user_armor(id,get_cvar_num("amx_fw_armor"), CsArmorType:);
        }
        case 
2:
        {
            
give_item(id,"item_assaultsuit");
            
cs_set_user_armor(id,get_cvar_num("amx_fw_armor"), CsArmorType:);
        }
    }
    if(
get_cvar_num("amx_fw_googles")){
        
cs_set_user_nvg(id,1);
    }
    if(
get_cvar_num("amx_fw_allnades")){
        
give_item(id,"weapon_hegrenade");
        
give_item(id,"weapon_smokegrenade");
        
give_item(id,"weapon_flashbang");
        
give_item(id,"weapon_flashbang");
    }else{
        if(
get_cvar_num("amx_fw_hegrenade")){
            
give_item(id,"weapon_hegrenade");
        }
        if(
get_cvar_num("amx_fw_smokegrenade")){
            
give_item(id,"weapon_smokegrenade");
        }
        switch(
get_cvar_num("amx_fw_flashbang")){
            case 
1:
            {
                
give_item(id,"weapon_flashbang");
            }
            case 
2:
            {
                
give_item(id,"weapon_flashbang");
                
give_item(id,"weapon_flashbang");
            }
        }
    }
}
GiveWeapons(id){
    if(
id==awp){
        
give_item(id,"weapon_awp");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_338magnum");
        }
    }
    if(
id==g3sg1){
        
give_item(id,"weapon_g3sg1");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_762nato");
        }
    }
    if(
id==sg552){
        
give_item(id,"weapon_sg552");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556nato");
        }
    }
    if(
id==galil){
        
give_item(id,"weapon_galil");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556nato");
        }
    }
    if(
id==famas){
        
give_item(id,"weapon_famas");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556nato");
        }
    }
    if(
id==m249){
        
give_item(id,"weapon_m249");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556natobox");
        }
    }
    if(
id==ak47){
        
give_item(id,"weapon_ak47");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_762nato");
        }
    }
    if(
id==m4a1){
        
give_item(id,"weapon_m4a1");
        for( new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556nato");
        }
    }
    if(
id==p90){
        
give_item(id,"weapon_p90");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_57mm");
        }
    }
    if(
id==m3){
        
give_item(id,"weapon_m3");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_buckshot");
        }
    }
    if(
id==xm1014){
        
give_item(id,"weapon_xm1014");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_buckshot");
        }
    }
    if(
id==scout){
        
give_item(id,"weapon_scout");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_762nato");
        }
    }
    if(
id==mac10){
        
give_item(id,"weapon_mac10");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_45acp");
        }
    }
    if(
id==ump45){
        
give_item(id,"weapon_ump45");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_45acp");
        }
    }
    if(
id==mp5navy){
        
give_item(id,"weapon_mp5navy");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_9mm");
        }
    }
    if(
id==aug){
        
give_item(id,"weapon_aug");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556nato");
        }
    }
    if(
id==sg550){
        
give_item(id,"weapon_sg550");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_556nato");
        }
    }
    if(
id==p228){
        
give_item(id,"weapon_p228");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_357sig");
        }
    }
    if(
id==elite){
        
give_item(id,"weapon_elite");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_9mm");
        }
    }
    if(
id==fiveseven){
        
give_item(id,"weapon_fiveseven");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_57mm");
        }
    }
    if(
id==glock18){
        
give_item(id,"weapon_glock18");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_9mm");
        }
    }
    if(
id==usp){
        
give_item(id,"weapon_usp");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_45acp");
        }
    }
    if(
id==tmp){
        
give_item(id,"weapon_tmp");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_9mm");
        }
    }
    if(
id==desert){
        
give_item(id,"weapon_deagle");
        for(new 
i=0i<get_cvar_num("amx_fw_ammo"); i++){
            
give_item(id,"ammo_50ae");
        }
    }

Please help

it wont compile and i can see whats the problem are, what does i do wrong.

It could be nice with a helping hand because i steering blind on it.

Last edited by -(L-S)-LAT; 05-04-2011 at 15:21.
-(L-S)-LAT is offline
pRoxxxDD
Junior Member
Join Date: Feb 2011
Location: Ukraine
Old 05-04-2011 , 13:08   Re: need some help about a script of mine
Reply With Quote #2

Help What?
__________________
pRoxxxDD is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-04-2011 , 19:33   Re: need some help about a script of mine
Reply With Quote #3

You don't use quotes around variables. And, you use == to compare two variables.

PHP Code:
                if("bots" "3")
                { 


PHP Code:
                if(bots == 3)
                { 
There are still errors but after fixing this issue it no longer crashes the compiler.

EDIT:

Other tips:
1. "id" is undefined in Giveitems(), presumably it should be passed as an argument of the function.
2. GiveWeapons() function is set up incorrectly. You should pass the "id" as the first argument then also pass the weapon identifier as teh second (meaning you need to change all the "id" in the if() statements to what ever your second argument is.
3. Use a switch() in GiveWeapons instead of multiple if() statements for the mutually exclusive cases.
__________________

Last edited by fysiks; 05-04-2011 at 19:39.
fysiks is offline
-(L-S)-LAT
Member
Join Date: Jun 2009
Old 05-05-2011 , 12:47   Re: need some help about a script of mine
Reply With Quote #4

thanks fysiks

yes i now but i will learn, but i trying to have a
amx_fw_bots
0 - both teams, 1 - terrorist only, 2 - ct only // bot player
amx_fw_mode 0 - both team, 1 - terrorist only, 2 - ct only // human player

that are what i am trying to do.

but i wil try that.

if i have karma you got it....

Last edited by -(L-S)-LAT; 05-05-2011 at 13:01. Reason: my spelling was not good
-(L-S)-LAT is offline
-(L-S)-LAT
Member
Join Date: Jun 2009
Old 05-05-2011 , 15:09   Re: need some help about a script of mine
Reply With Quote #5

Hello i done this but new it says undefined switch() case awp: ?

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#define PLUGIN_NAME "Adv Free-Weapons"
#define PLUGIN_VERSION "1.2"
#define PLUGIN_AUTHOR "-(L-S)- LAT"
#pragma semicolon 1
public plugin_init(){
    
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
    
RegisterHam(Ham_Spawn,"player","free_weapons"1);
    
register_cvar("amx_free_weapons","1");
    
register_cvar("amx_fw_priweapon_t","m4a1");
    
register_cvar("amx_fw_priweapon_ct","m4a1");
    
register_cvar("amx_fw_secweapon_t","desert");
    
register_cvar("amx_fw_secweapon_ct","desert");
    
register_cvar("amx_fw_ammo","5");
    
register_cvar("amx_fw_hegrenade","1");
    
register_cvar("amx_fw_smokegrenade","1");
    
register_cvar("amx_fw_flashbang","2");
    
register_cvar("amx_fw_allnades","1");
    
register_cvar("amx_fw_nightgoogles","1");
    
register_cvar("amx_fw_defuse","1");
    
register_cvar("amx_fw_armor","300");
    
register_cvar("amx_fw_armortype","2");
    
register_cvar("amx_fw_bots","1");
    
register_cvar("amx_fw_mode","1");
}
public 
free_weapons(id){
    if(
get_cvar_num("amx_free_weapons")){
        if(
is_user_bot(id)){
            switch(
get_user_team(id)){
                case 
1:
                {
                    
// Team 1
                    
if(get_cvar_num("amx_fw_bots") == || get_cvar_num("amx_fw_bots") == 3){
                        
Giveitems(id);
                        if(
get_cvar_num("amx_fw_secweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_secweapon_t"),get_cvar_num("amx_fw_ammo"));
                        }
                        if(
get_cvar_num("amx_fw_priweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_priweapon_t"),get_cvar_num("amx_fw_ammo"));
                        }
                    }
                }
                case 
2:
                {
                    
// Team 2
                    
if(get_cvar_num("amx_fw_bots") == || get_cvar_num("amx_fw_bots") == 3){
                        if(
get_cvar_num("amx_fw_defuse")){
                            
cs_set_user_defuse(id,1,0,0,205);
                        }
                        
Giveitems(id);
                        if(
get_cvar_num("amx_fw_secweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_secweapon_ct"),get_cvar_num("amx_fw_ammo"));
                        }
                        if(
get_cvar_num("amx_fw_priweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_priweapon_ct"),get_cvar_num("amx_fw_ammo"));
                        }
                    }
                }
            }
        }
        if(
get_cvar_num("amx_free_weapons") && is_user_connected(id) && !is_user_bot(id) && is_user_alive(id)){
            switch(
get_user_team(id)){
                case 
1:
                {
                    
// Team 1
                    
if(get_cvar_num("amx_fw_mode") == || get_cvar_num("amx_fw_mode") == 3){
                        
Giveitems(id);
                        if(
get_cvar_num("amx_fw_secweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_secweapon_t"),get_cvar_num("amx_fw_ammo"));
                        }
                        if(
get_cvar_num("amx_fw_priweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_priweapon_t"),get_cvar_num("amx_fw_ammo"));
                        }
                    }
                }
                case 
2:
                {
                    
// Team 2
                    
if(get_cvar_num("amx_fw_mode") == || get_cvar_num("amx_fw_mode") == 3){
                        if(
get_cvar_num("amx_fw_defuse")){
                            
cs_set_user_defuse(id,1,0,0,205);
                        }
                        
Giveitems(id);
                        if(
get_cvar_num("amx_fw_secweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_secweapon_ct"),get_cvar_num("amx_fw_ammo"));
                        }
                        if(
get_cvar_num("amx_fw_priweapon")){
                            
GiveWeapons(id,get_cvar_num("amx_fw_priweapon_ct"),get_cvar_num("amx_fw_ammo"));
                        }
                    }
                }
            }
        }
    }
}
Giveitems(id){
    switch(
get_cvar_num("amx_fw_armortype")){
        case 
1:
        {
            
give_item(id,"item_kevlar");
            
cs_set_user_armor(id,get_cvar_num("amx_fw_armor"), CsArmorType:);
        }
        case 
2:
        {
            
give_item(id,"item_assaultsuit");
            
cs_set_user_armor(id,get_cvar_num("amx_fw_armor"), CsArmorType:);
        }
    }
    if(
get_cvar_num("amx_fw_googles")){
        
cs_set_user_nvg(id,1);
    }
    if(
get_cvar_num("amx_fw_allnades")){
        
give_item(id,"weapon_hegrenade");
        
give_item(id,"weapon_smokegrenade");
        
give_item(id,"weapon_flashbang");
        
give_item(id,"weapon_flashbang");
    }else{
        if(
get_cvar_num("amx_fw_hegrenade")){
            
give_item(id,"weapon_hegrenade");
        }
        if(
get_cvar_num("amx_fw_smokegrenade")){
            
give_item(id,"weapon_smokegrenade");
        }
        switch(
get_cvar_num("amx_fw_flashbang")){
            case 
1:
            {
                
give_item(id,"weapon_flashbang");
            }
            case 
2:
            {
                
give_item(id,"weapon_flashbang");
                
give_item(id,"weapon_flashbang");
            }
        }
    }
}
GiveWeapons(id,wep,maxammo){
    switch(
wep){
        case 
awp// complaining about this
        
{
            
give_item(id,"weapon_awp");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_338magnum");
            }
        }
        case 
g3sg1// complaining about this to
        
{
            
give_item(id,"weapon_g3sg1");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_762nato");
            }
        }
        case 
g3sg1// complaining about this to
        
{
            
give_item(id,"weapon_sg552");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
galil// complaining about this to
        
{
            
give_item(id,"weapon_galil");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
famas// complaining about this to
        
{
            
give_item(id,"weapon_famas");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
m249// complaining about this to
        
{
            
give_item(id,"weapon_m249");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556natobox");
            }
        }
        case 
ak47// complaining about this to
        
{
            
give_item(id,"weapon_ak47");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_762nato");
            }
        }
        case 
m4a1// complaining about this to
        
{
            
give_item(id,"weapon_m4a1");
            for( new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
p90// complaining about this to
        
{
            
give_item(id,"weapon_p90");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_57mm");
            }
        }
        case 
m3// complaining about this to
        
{
            
give_item(id,"weapon_m3");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_buckshot");
            }
        }
        case 
xm1014// complaining about this to
        
{
            
give_item(id,"weapon_xm1014");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_buckshot");
            }
        }
        case 
scout// complaining about this to
        
{
            
give_item(id,"weapon_scout");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_762nato");
            }
        }
        case 
mac10// complaining about this to
        
{
            
give_item(id,"weapon_mac10");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_45acp");
            }
        }
        case 
ump45// complaining about this to
        
{
            
give_item(id,"weapon_ump45");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_45acp");
            }
        }
        case 
mp5navy// complaining about this to
        
{
            
give_item(id,"weapon_mp5navy");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_9mm");
            }
        }
        case 
aug// complaining about this to
        
{
            
give_item(id,"weapon_aug");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
sg550// complaining about this to
        
{
            
give_item(id,"weapon_sg550");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
p228// complaining about this to
        
{
            
give_item(id,"weapon_p228");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_357sig");
            }
        }
        case 
elite// complaining about this to
        
{
            
give_item(id,"weapon_elite");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_9mm");
            }
        }
        case 
fiveseven// complaining about this to
        
{
            
give_item(id,"weapon_fiveseven");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_57mm");
            }
        }
        case 
glock18// complaining about this to
        
{
            
give_item(id,"weapon_glock18");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_9mm");
            }
        }
        case 
usp// complaining about this to
        
{
            
give_item(id,"weapon_usp");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_45acp");
            }
        }
        case 
tmp// complaining about this to
        
{
            
give_item(id,"weapon_tmp");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_9mm");
            }
        }
        case 
desert// complaining about this to
        
{
            
give_item(id,"weapon_deagle");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_50ae");
            }
        }
    }

What do i do wrong new please help please

Last edited by -(L-S)-LAT; 05-05-2011 at 15:43.
-(L-S)-LAT is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-05-2011 , 16:47   Re: need some help about a script of mine
Reply With Quote #6

-(L-S)-LAT
Should be CSW_AWP. Look into amxconst.inc and search for "CSW_".
__________________

SonicSonedit is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-05-2011 , 19:05   Re: need some help about a script of mine
Reply With Quote #7

PHP Code:
    register_cvar("amx_fw_priweapon_t","m4a1");
    
register_cvar("amx_fw_priweapon_ct","m4a1");
    
register_cvar("amx_fw_secweapon_t","desert");
    
register_cvar("amx_fw_secweapon_ct","desert"); 
You can't put a string for these cvars and then use get_cvar_num() with them. It will always be a value of zero (0).

Also, all of those case variables are undefined. You either need to define them or use predefined variables mentioned by sonic.
__________________
fysiks is offline
-(L-S)-LAT
Member
Join Date: Jun 2009
Old 05-06-2011 , 01:08   Re: need some help about a script of mine
Reply With Quote #8

okay how to extract the info from amx_fw_priweapon_t?
get_cvar_value("amx_fw_priweapon_t"); ?

can i solve this with a array

can i make a array like this array[1]=m4a1; ?
or array[get_cvar_num("amx_fw_priweapon_t")] = m4a1;

and register_cvar("amx_fw_priweapon_t","1");

Last edited by -(L-S)-LAT; 05-06-2011 at 01:28.
-(L-S)-LAT is offline
-(L-S)-LAT
Member
Join Date: Jun 2009
Old 05-06-2011 , 01:44   Re: need some help about a script of mine
Reply With Quote #9

why are not the same for amxx as this is for people who need to learn HTML/PHP/ASP http://www.w3schools.com?

Love PHP xD
-(L-S)-LAT is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-06-2011 , 07:17   Re: need some help about a script of mine
Reply With Quote #10

-(L-S)-LAT
You didn't read what i said, did you?
Use
PHP Code:
register_cvar("amx_fw_priweapon_t","22"); // CSW_M4A1
    
register_cvar("amx_fw_priweapon_ct","22"); // CSW_M4A1
    
register_cvar("amx_fw_secweapon_t","26"); // CSW_DEAGLE
    
register_cvar("amx_fw_secweapon_ct","26");  // CSW_DEAGLE 
and then use CSW_ to check weapon id:
PHP Code:
GiveWeapons(id,wep,maxammo){
    switch(
wep){
        case 
CSW_AWP// complaining about this
        
{
            
give_item(id,"weapon_awp");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_338magnum");
            }
        }
        case 
CSW_G3SG1// complaining about this to
        
{
            
give_item(id,"weapon_g3sg1");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_762nato");
            }
        }
        case 
CSW_SG552// complaining about this to
        
{
            
give_item(id,"weapon_sg552");
            for(new 
i=0i<maxammoi++){
                
give_item(id,"ammo_556nato");
            }
        }
        case 
CSW_GALI
 
 
// and so on 
got it now?
__________________

SonicSonedit 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 19:43.


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