AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP]How to do check smth after map change (https://forums.alliedmods.net/showthread.php?t=87008)

Metanabol 03-05-2009 13:44

[HELP]How to do check smth after map change
 
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 :)



anakin_cstrike 03-05-2009 14:03

Re: [HELP]How to do check smth after map change
 
plugin_init? or what are you talking about :|

Metanabol 03-05-2009 14:12

Re: [HELP]How to do check smth after map change
 
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... :)

Brad 03-05-2009 14:23

Re: [HELP]How to do check smth after map change
 
Can't you just use map-specific config files?

Metanabol 03-05-2009 14:32

Re: [HELP]How to do check smth after map change
 
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) :)...

hleV 03-05-2009 14:32

Re: [HELP]How to do check smth after map change
 
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         } }

Metanabol 03-05-2009 14:55

Re: [HELP]How to do check smth after map change
 
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


All times are GMT -4. The time now is 17:05.

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