AlliedModders

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

4iriks 05-17-2010 08:08

VIP Plugin
 
Is it possible to edit this when i got 2 HE grenades , 2 flashes , and 2 smokes in each round?

AND + get 5 ammo packs for Zombie Plague mod each round?

Code:

public fwHamPlayerSpawnPost() {

    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_hegrenade");
        give_item(player, "weapon_flashbang");
        give_item(player, "weapon_flashbang");
        give_item(player, "weapon_smokegrenade");
        give_item(player, "item_assaultsuit");
        give_item(player, "item_thighpack");
        }
    }
    return PLUGIN_HANDLED
}


FlyingHorse 05-17-2010 15:03

Re: VIP Plugin
 
i never used nades and stuff before.. but this might work
Code:

public fwHamPlayerSpawnPost() {

    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_hegrenade");
    cs_set_user_bpammo( player, CSW_HE, 2 );
}
{
    give_item(player, "weapon_flashbang");
    cs_set_user_bpammo( player, CSW_FLASHBANG, 2 );
}
{
    give_item(player, "weapon_smokegrenade");
    cs_set_user_bpammo( player, CSW_SMOKE, 2 );
       
    give_item(player, "item_assaultsuit");
        give_item(player, "item_thighpack");
        }
    }
    return PLUGIN_HANDLED
}


4iriks 05-17-2010 15:29

Re: VIP Plugin
 
Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phpLqylxF.sma(32) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpLqylxF.sma(117) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/phpLqylxF.sma(117) : error 017: undefined symbol "CSW_HE"
/home/groups/amxmodx/tmp3/phpLqylxF.sma(117) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpLqylxF.sma(117) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpLqylxF.sma(117) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpLqylxF.sma(117) : fatal error 107: too many error messages on one line

Compilation aborted.
5 Errors.

Exolent[jNr] 05-17-2010 15:36

Re: VIP Plugin
 
@OP
I don't know anything about ZP coding, but here's the rest.
Code:

public fwHamPlayerSpawnPost(player) {
    if(get_user_flags(player) & ADMIN_LEVEL_H)
    {
        give_item(player, "weapon_hegrenade");
        cs_set_user_bpammo(player, CSW_HEGRENADE, 2);
       
        give_item(player, "weapon_flashbang");
        give_item(player, "weapon_flashbang");
       
        give_item(player, "weapon_smokegrenade");
        cs_set_user_bpammo(player, CSW_SMOKEGRENADE, 2);
       
        give_item(player, "item_assaultsuit");
       
        give_item(player, "item_thighpack");
    }
}

@FlyingHorse
That code is horrid.
Learn scripting before helping others.

4iriks 05-17-2010 15:52

Re: VIP Plugin
 
Okey Thanks , all is working fine , but is it possible when i get those all items with 5 seconds interval?

Because , when i spawn i get those items yeah , but than zombie plague mod gives me automaticly 1 he 1 smoke 1 flash , and it removes my grenades !

NiQu 05-17-2010 22:39

Re: VIP Plugin
 
use set_task sir.

PHP Code:

public fwHamPlayerSpawnPost(player) {
    
set_task(5.0"giveNades"player);


PHP Code:

public giveNades(player)
{
    if(
get_user_flags(player) & ADMIN_LEVEL_H)
    {
        
give_item(player"weapon_hegrenade");
        
cs_set_user_bpammo(playerCSW_HEGRENADE2);
        
        
give_item(player"weapon_flashbang");
        
give_item(player"weapon_flashbang");
        
        
give_item(player"weapon_smokegrenade");
        
cs_set_user_bpammo(playerCSW_SMOKEGRENADE2);
        
        
give_item(player"item_assaultsuit");
        
        
give_item(player"item_thighpack");
    }



Exolent[jNr] 05-17-2010 22:54

Re: VIP Plugin
 
Quote:

Originally Posted by NiQu (Post 1183778)
use set_task sir.

PHP Code:

public fwHamPlayerSpawnPost(player) {
    
set_task(5.0"giveNades"player);


PHP Code:

public giveNades
{
    if(
get_user_flags(player) & ADMIN_LEVEL_H)
    {
        
give_item(player"weapon_hegrenade");
        
cs_set_user_bpammo(playerCSW_HEGRENADE2);
        
        
give_item(player"weapon_flashbang");
        
give_item(player"weapon_flashbang");
        
        
give_item(player"weapon_smokegrenade");
        
cs_set_user_bpammo(playerCSW_SMOKEGRENADE2);
        
        
give_item(player"item_assaultsuit");
        
        
give_item(player"item_thighpack");
    }



That code is wrong.

NiQu 05-17-2010 22:56

Re: VIP Plugin
 
Maybe you can tell us what is wrong in that code instead of just saying its wrong?

I forgot the "()" after giveNades i know, i edited it now.
I forgot about the parameters to lol.

Pourquoi n'êtes-vous pas aussi amical que Wrecked?

4iriks 05-18-2010 12:03

Re: VIP Plugin
 
Thanks , its working fine !

Is it possible to make a chat message when i get those items?

EDIT -

Found this for the ammo packs

Code:

// Native: zp_set_user_ammo_packs
public native_set_user_ammo_packs(id, amount)
{
    g_ammopacks[id] = amount;
}

Maybe thats the thing i need

how i can make when it gives me +5 ammo packs in each round?



P.S.

What can be the problem when i cant gag players?

Its like i gag them ,but they still can talk and write in the chat !

JaGareN 05-19-2010 04:02

Re: VIP Plugin
 
For making a print message use this code:
PHP Code:

client_print(0print_chat"Your print message"



All times are GMT -4. The time now is 03:33.

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