AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   a little help with GG (https://forums.alliedmods.net/showthread.php?t=153921)

Racoon 03-31-2011 11:31

a little help with GG
 
1 Attachment(s)
Hello again :D I've been modifying the gungame.sma. I've tried to add some fun stuff for admins. For example, during the final level players with ADMIN_LEVEL_A access need to get 5 kills with grenade, instead of 1. The problem is the granade, which doesn't refresh, when you kill somebody...
PHP Code:

show_weapons_menu(id)
{
    new 
totalWeapons weaponNumwpnsPerPage 10;
    new 
pageTotal floatround(float(totalWeapons) / float(wpnsPerPage),floatround_ceil);

    if(
page[id] < 1page[id] = 1;
    if(
page[id] > pageTotalpage[id] = pageTotal;

    new 
len formatex(menuText,511,"\y%L %L (%i/%i)\w^n",id,"GUNGAME",id,"WEAPONS",page[id],pageTotal);
    
//len += formatex(menuText[len],511-len,"\d-----------\w^n");

    
new start = (wpnsPerPage * (page[id]-1)) + 1i;

    
// are there any custom kill requirements?
    
new customKillsFloat:expectedFloat:killsperlvl get_pcvar_float(gg_kills_per_lvl);
    for(
i=0;i<weaponNum;i++)
    {
        if(
equal(weaponName[i],KNIFE) || equal(weaponName[i],HEGRENADE)) expected 1.0;
        if(
equal(weaponName[i],HEGRENADE) && (!(get_user_flags(id) & ADMIN_LEVEL_A))) expected 5.0;
        else 
expected killsperlvl;
    
        if(
weaponGoal[i] != expected)
        {
            
customKills 1;
            break;
        }
    } 



All times are GMT -4. The time now is 14:32.

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