Raised This Month: $ Target: $400
 0% 

VIP Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
4iriks
Member
Join Date: Nov 2009
Old 05-17-2010 , 08:08   VIP Plugin
Reply With Quote #1

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
}

Last edited by 4iriks; 05-17-2010 at 08:11.
4iriks is offline
FlyingHorse
Senior Member
Join Date: Apr 2010
Location: Under your bed.
Old 05-17-2010 , 15:03   Re: VIP Plugin
Reply With Quote #2

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
}
FlyingHorse is offline
Send a message via Skype™ to FlyingHorse
4iriks
Member
Join Date: Nov 2009
Old 05-17-2010 , 15:29   Re: VIP Plugin
Reply With Quote #3

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.
4iriks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-17-2010 , 15:36   Re: VIP Plugin
Reply With Quote #4

@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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
4iriks
Member
Join Date: Nov 2009
Old 05-17-2010 , 15:52   Re: VIP Plugin
Reply With Quote #5

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 !
4iriks is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-17-2010 , 22:39   Re: VIP Plugin
Reply With Quote #6

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");
    }

__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]

Last edited by NiQu; 05-17-2010 at 22:57.
NiQu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-17-2010 , 22:54   Re: VIP Plugin
Reply With Quote #7

Quote:
Originally Posted by NiQu View Post
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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-17-2010 , 22:56   Re: VIP Plugin
Reply With Quote #8

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?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]

Last edited by NiQu; 05-17-2010 at 23:17.
NiQu is offline
4iriks
Member
Join Date: Nov 2009
Old 05-18-2010 , 12:03   Re: VIP Plugin
Reply With Quote #9

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 !

Last edited by 4iriks; 05-18-2010 at 12:25.
4iriks is offline
JaGareN
Senior Member
Join Date: Mar 2009
Old 05-19-2010 , 04:02   Re: VIP Plugin
Reply With Quote #10

For making a print message use this code:
PHP Code:
client_print(0print_chat"Your print message"
JaGareN 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 03:33.


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