Raised This Month: $ Target: $400
 0% 

[HELP]How to do check smth after map change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Metanabol
Member
Join Date: Feb 2009
Old 03-05-2009 , 13:44   [HELP]How to do check smth after map change
Reply With Quote #1

Hello, i want to do it then MAP CHANGES. IT SIMPLY CHECK IS 35hp and etc. in map name. if not false, it set variable value to 0... default "mapz" value=1
I want to disable of buying menu for VIP so i need only 2 answers:
how to set variable and how to check is 35hp in mapname at mapchange.(mapname = get_mapname(mapname, 31))
so:
PHP Code:
    if (containi(mapname,"35hp")!=-1)
     
set mapz to 0i dont know how)(mapz is variable)
    if (
containi(mapname,"ka_")!=-1)
     
set mapz to 0i dont know how)(mapz is variable)
    if (
containi(mapname,"awp_")!=-1)
     
set mapz to 0i dont know how)(mapz is variable)
    if (
containi(mapname,"fy_")!=-1)
     
set mapz to 0i dont know how)(mapz is variable)
    if (
containi(mapname,"most_")!=-1)
     
set mapz to 0i dont know how)(mapz is variable
PHP Code:
if(mapz 0) {
my all commands will be executed here :)

Metanabol is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-05-2009 , 14:03   Re: [HELP]How to do check smth after map change
Reply With Quote #2

plugin_init? or what are you talking about
__________________

anakin_cstrike is offline
Metanabol
Member
Join Date: Feb 2009
Old 03-05-2009 , 14:12   Re: [HELP]How to do check smth after map change
Reply With Quote #3

I start server. And we have a map, there we play...
Every time then server change map, plugin must check:

if (containi(mapname,"35hp")!=-1)
set mapz to 0 ( i dont know how to set variable "mapz")
if (
containi(mapname,"ka_")!=-1)
set mapz to 0
if (
containi(mapname,"awp_")!=-1)
set mapz to 0
if (
containi(mapname,"fy_")!=-1)
set mapz to 0
if (
containi(mapname,"most_")!=-1)
set mapz to 0


I dont know to to set variable "mapz" to 0

then i have:
PHP Code:
if (mapz 0) { it will do my commands :)
// mapz value > 0 i will normaly enable custom item menu :) 
point of this is disable free items for VIP in these maps. (because you dont want to see player shooting from ak47 in knife maps?)

p.s. i dont paste all code, because its very long...
Metanabol is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-05-2009 , 14:23   Re: [HELP]How to do check smth after map change
Reply With Quote #4

Can't you just use map-specific config files?
__________________
Brad is offline
Metanabol
Member
Join Date: Feb 2009
Old 03-05-2009 , 14:32   Re: [HELP]How to do check smth after map change
Reply With Quote #5

like amx_retrict? hmmm... its not simple buy ...
then round start plugin to players with flag T shows menu with weapons. then they select server use: give_item to player.
PHP Code:
public logevent_Round_Start()
{
    
round++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
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_kevlar");
        
give_item(player"item_assaultsuit");
        
give_item(player"item_thighpack");
        if(
round 2) && (mapz 0Showrod(player)
        }
    }

if(round > 2) && (mapz > 0) Showrod(player)
if this is more than 3rd round and mapz more than 0
plugin makes menu: showrod(player) ...
Metanabol is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-05-2009 , 14:32   Re: [HELP]How to do check smth after map change
Reply With Quote #6

Code:
new g_NonVIPMaps[][] = {         "35hp",         "ka_",         "awp_",         "fy_",         "most_" };   new bool:g_VIP = true; // VIP is currently allowed   public plugin_init() // Mapchange {         new MapName[64];         get_mapname(MapName, 63);           for (new Map = 0; Map < sizeof(g_NonVIPMaps); Map++)                 if (containi(MapName, g_NonVIPMaps[Map]) != -1)                         g_VIP = false; // Disable VIP           if (g_VIP) // If VIP is still allowed after checking mapname         {                 // VIP stuff         } }
__________________

Last edited by hleV; 03-05-2009 at 14:35.
hleV is offline
Metanabol
Member
Join Date: Feb 2009
Old 03-05-2009 , 14:55   Re: [HELP]How to do check smth after map change
Reply With Quote #7

Thanks you understood what i wanted to do ...
// malonu kad yra lietuviu supportinanciu

Second problem:

PHP Code:
public logevent_Round_Start()
{
    
round++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
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_kevlar")
        
give_item(player"item_assaultsuit")
        
give_item(player"item_thighpack")
        if (
round 2) && (g_VIPShowrod(player)
            }
    }

compliler show error:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "-identifier-"

all in 135 line:
Code:
if (round > 2) && (g_VIP) Showrod(player)
round > 2, after 2 rounds, from started map
g_VIP=true;
showrod - opens menu.
whats the reason?
i tried to make g_VIP without bool, set 0 1 (g_VIP > 0) nothing helps, same error

Last edited by Metanabol; 03-05-2009 at 17:02.
Metanabol 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:05.


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