Raised This Month: $ Target: $400
 0% 

[Help]Need help to fix this code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
byetovice
Senior Member
Join Date: Nov 2009
Location: Turkey
Old 02-02-2010 , 14:13   [Help]Need help to fix this code
Reply With Quote #1

Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <engine>
new thismod = 4;
new nextmod = 4;
new bool:isvoting;
new results[5];
new bool:has_koruma[32];
#define PLUGIN "JailBreak Extreme"
#define VERSION "1.0"
#define AUTHOR "ByEtoVice"
public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
 register_cvar("jb_extreme","1")
 register_cvar("jb_clanname","JailBreak ServeR")
 register_event("HLTV", "new_round", "a", "1=0", "2=0");
 register_event("Damage","Damage_event","b")
 // Add your code here...
}
public Damage_event(id)
{
new Weap,PartHit;
new attacker = get_user_attacker(id,Weap,PartHit)
if(has_koruma[attacker])
{
set_user_godmode(attacker,0)
has_koruma[attacker] = false
}
}

//Kolay ulasim icin extra kodlarim byetovice
public set_user_alpha(id,value)
{
 set_user_rendering(id,kRenderFxNone ,0,0,0,kRenderTransAlpha,value)
}
public set_user_noweapons(id,value)
{
 if(value==1)
 {
 set_task(0.1,"NoWeapons",id + 1453,"",0,"b")
 }
 else
 {
 remove_task(id + 1453)
 }
}
public FwdHamPlayerSpawn(id)
{
if(get_cvar_num("jb_extreme"))
{
thismod = nextmod;
switch(thismod)
{
case 0:
{
if(cs_get_user_team(id)==CS_TEAM_CT)
{
set_user_health(id,250)
set_user_alpha(id,0)
set_user_noweapons(id,1)
has_koruma[id] = false;
}
if(cs_get_user_team(id)==CS_TEAM_T)
{
give_item(id,"weapon_m4a1")
cs_set_user_bpammo( id, CSW_M4A1, 90 )
}
}
case 1:
{
if(cs_get_user_team(id)==CS_TEAM_T)
{
set_user_alpha(id,25)
set_user_health(id,150)
set_user_noweapons(id,1)
set_user_footsteps(id,0)
}
}
case 2:
{
if(cs_get_user_team(id)==CS_TEAM_T)
{
give_item(id,"weapon_deagle")
cs_set_user_bpammo( id, CSW_DEAGLE, 90 )
}
}
case 3:
{
if(cs_get_user_team(id)==CS_TEAM_T)
{
set_user_godmode(id,1)
has_koruma[id] = true;
}
}
}
voting()
}
}
 
 
 
public new_round()
{
if(get_cvar_num("jb_extreme"))
{
thismod = nextmod;
if(thismod==1)
{
set_lights("b")
}
else
{
set_lights("m")
}
voting()
}
}
public voting()
{
 new menu = menu_create("JailBreak Extreme Modz : ", "menu_handler");
 menu_additem(menu, "Assassins Day", "1", 0);
         menu_additem(menu, "NightMares Day", "2", 0);
 menu_additem(menu, "Mutiny Day", "3", 0);
         menu_additem(menu, "Free Day", "4", 0);
 menu_additem(menu, "Return to Cage", "5", 0);
 menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
     new players[32], pnum, tempid;
    get_players(players, pnum);
    for( new i; i<pnum; i++ )
    {
 if(cs_get_user_team(players[i])==CS_TEAM_CT)
 {
        tempid = players[i];
 menu_display(tempid, menu, 0);
 }

    }
    
    set_task(10.0, "EndVote");
    isvoting = true;
return PLUGIN_HANDLED;
   
}
public NoWeapons(TaskID)
{
new id = TaskID - 1453;
if(get_user_weapon(id)!=CSW_KNIFE)
{
strip_user_weapons(id)
give_item(id,"CSW_KNIFE")
}
}
public menu_handler(id,menu,item)
{
 //If the menu was exited or if there is not a vote
    if( item == MENU_EXIT || isvoting )
    {
        //Note were not destroying the menu
        return PLUGIN_HANDLED;
    }
    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
    new key = str_to_num(data);
    switch(key)
    {
 case 1:
 {
 results[0] += 1;
 }
 case 2:
 {
 results[1] += 1; 
 }
 case 3:
 {
 results[2] += 1; 
 }
 case 4:
 {
 results[3] += 1; 
 }
 case 5:
 {
 results[4] += 1; 
 }
 
    }
    return PLUGIN_HANDLED;
}
public EndVote()
{
if(results[0]>results[1])
{
if(results[0]>results[2])
{
if(results[0]>results[3])
{
if(results[0]>results[4])
{
nextmod = 0;
client_print(0,print_chat,"Birdahaki el Assassin's Day olacak[%s Oy]",results[0])
}
}
}
}
if(results[1]>results[0])
{
if(results[1]>results[2])
{
if(results[1]>results[3])
{
if(results[1]>results[4])
{
nextmod = 1;
client_print(0,print_chat,"Birdahaki el Nightmare's Day olacak[%s Oy]",results[1])
}
}
}
}
if(results[2]>results[1])
{
if(results[2]>results[0])
{
if(results[2]>results[3])
{
if(results[2]>results[4])
{
nextmod = 2;
client_print(0,print_chat,"Birdahaki el Mutiny Day olacak[%s Oy]",results[2])
}
}
}
}
if(results[3]>results[1])
{
if(results[3]>results[2])
{
if(results[3]>results[0])
{
if(results[3]>results[4])
{
nextmod = 3;
client_print(0,print_chat,"Birdahaki el Free Day olacak[%s Oy]",results[3])
}
}
}
}
if(results[4]>results[1])
{
if(results[4]>results[2])
{
if(results[4]>results[3])
{
if(results[4]>results[0])
{
nextmod = 4;
client_print(0,print_chat,"Birdahaki el Normal kurallar ile oynanacak[%s Oy]",results[4])
}
}
}
}
isvoting = false;
return PLUGIN_HANDLED;
}
my code is this..i tried to make a fun plugin..ct players vote a mod..
next round ..they play that mod.....please help me .. i cant fix this..i cant see any error but its not working .please fix this code.
thanks..
byetovice 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 07:21.


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