Raised This Month: $ Target: $400
 0% 

Sample of how NOT to code for approval: XpMod


Post New Thread Reply   
 
Thread Tools Display Modes
Jon
Veteran Member
Join Date: Dec 2007
Old 10-29-2009 , 12:30   Re: XpMod
Reply With Quote #11

PHP Code:
public LoadData(id
{
    if(
get_pcvar_num(SaveXp) == 1){
        new 
AuthID[35];
        
get_user_authid(id,AuthID,34);
        new 
vaultkey[64],vaultdata[256
        
format(vaultkey,63,"%s-XPMod",AuthID
        
format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#",PlayerXp[id],PlayerLevels[id][1],PlayerLevels[id][2],PlayerLevels[id][3],PlayerLevels[id][4],PlayerLevels[id][5],PlayerLevels[id][6]) 
        
fvault_get_data(g_vault,vaultkey,vaultdata,255
        
replace_all(vaultdata255"#"" "
        new 
playerlxp[32], playerlvl1[32], playerlvl2[32], playerlvl3[32], playerlvl4[32], playerlvl5[32], playerlvl6[32]; 
        
parse(vaultdataplayerlxp31playerlvl131playerlvl231playerlvl331playerlvl431playerlvl531playerlvl631
        
PlayerXp[id] = str_to_num(playerlxp);
        
PlayerLevels[id][1] = str_to_num(playerlvl1)
        
PlayerLevels[id][2] = str_to_num(playerlvl2)
        
PlayerLevels[id][3] = str_to_num(playerlvl3)
        
PlayerLevels[id][4] = str_to_num(playerlvl4)
        
PlayerLevels[id][5] = str_to_num(playerlvl5)
        
PlayerLevels[id][6] = str_to_num(playerlvl6)
    }
    if(
PlayerLevels[id][1] == 0){
        
PlayerLevels[id][1] = 1;
        
PlayerXp[id] = get_pcvar_num(StarterXp);
    }
    if(
PlayerLevels[id][2] == 0){
        
PlayerLevels[id][2] = 1;
    }
    if(
PlayerLevels[id][3] == 0){
        
PlayerLevels[id][3] = 1;
    }
    if(
PlayerLevels[id][4] == 0){
        
PlayerLevels[id][4] = 1;
    }
    if(
PlayerLevels[id][5] == 0){
        
PlayerLevels[id][5] = 1;
    }
    if(
PlayerLevels[id][6] == 0){
        
PlayerLevels[id][6] = 1;
    }
    if(
PlayerLevels[id][1] == 2){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth1);
    }
    if(
PlayerLevels[id][1] == 3){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth2);
    }
    if(
PlayerLevels[id][1] == 4){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth3);
    }
    if(
PlayerLevels[id][1] == 5){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth4);
    }
    if(
PlayerLevels[id][1] == 6){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth5);
    }
    if(
PlayerLevels[id][2] == 2){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe1);
    }
    if(
PlayerLevels[id][2] == 3){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe2);
    }
    if(
PlayerLevels[id][2] == 4){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe3);
    }
    if(
PlayerLevels[id][2] == 5){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe4);
    }
    if(
PlayerLevels[id][2] == 6){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe5);
    }
    if(
PlayerLevels[id][3] == 2){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash11);
    }
    if(
PlayerLevels[id][3] == 3){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash12);
    }
    if(
PlayerLevels[id][3] == 4){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash13);
    }
    if(
PlayerLevels[id][3] == 5){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash14);
    }
    if(
PlayerLevels[id][4] == 2){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash21);
    }
    if(
PlayerLevels[id][4] == 3){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash22);
    }
    if(
PlayerLevels[id][4] == 4){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash23);
    }
    if(
PlayerLevels[id][4] == 5){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash24);
    }
    if(
PlayerLevels[id][5] == 2){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke1);
    }
    if(
PlayerLevels[id][5] == 3){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke2);
    }
    if(
PlayerLevels[id][5] == 4){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke3);
    }
    if(
PlayerLevels[id][5] == 5){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke4);
    }
    if(
PlayerLevels[id][6] == 2){
        
PlayerPercent[id][6] = get_pcvar_num(PtRespawn1);
    }
    if(
PlayerLevels[id][6] == 3){
        
PlayerPercent[id][6] = get_pcvar_num(PtRespawn2);
    }
    if(
PlayerLevels[id][6] == 4){
        
PlayerPercent[id][6] = get_pcvar_num(PtRespawn3);
    }
    return 
PLUGIN_CONTINUE 
}
//The content of the menu
public XpMenu(id) {
    new 
temp[64];
    
formatextemp63"%L"LANG_PLAYER"MENU_TITLE");
    new 
menu menu_create(temp"xpmenu_handler");
    if(
PlayerLevels[id][1] == 1){XpHealth get_pcvar_num(XpHealth1); HpHealth get_pcvar_num(HpHealth1); PtHealth get_pcvar_num(PtHealth1);}
    if(
PlayerLevels[id][1] == 2){XpHealth get_pcvar_num(XpHealth2); HpHealth get_pcvar_num(HpHealth2); PtHealth get_pcvar_num(PtHealth2);}
    if(
PlayerLevels[id][1] == 3){XpHealth get_pcvar_num(XpHealth3); HpHealth get_pcvar_num(HpHealth3); PtHealth get_pcvar_num(PtHealth3);}
    if(
PlayerLevels[id][1] == 4){XpHealth get_pcvar_num(XpHealth4); HpHealth get_pcvar_num(HpHealth4); PtHealth get_pcvar_num(PtHealth4);}
    if(
PlayerLevels[id][1] == 5){XpHealth get_pcvar_num(XpHealth5); HpHealth get_pcvar_num(HpHealth5); PtHealth get_pcvar_num(PtHealth5);}
    if(
PlayerLevels[id][2] == 1){XpHe get_pcvar_num(XpHe1); PtHe get_pcvar_num(PtHe1);}
    if(
PlayerLevels[id][2] == 2){XpHe get_pcvar_num(XpHe2); PtHe get_pcvar_num(PtHe2);}
    if(
PlayerLevels[id][2] == 3){XpHe get_pcvar_num(XpHe3); PtHe get_pcvar_num(PtHe3);}
    if(
PlayerLevels[id][2] == 4){XpHe get_pcvar_num(XpHe4); PtHe get_pcvar_num(PtHe4);}
    if(
PlayerLevels[id][2] == 5){XpHe get_pcvar_num(XpHe5); PtHe get_pcvar_num(PtHe5);}
    if(
PlayerLevels[id][3] == 1){XpFlashnr1 get_pcvar_num(XpFlash11); PtFlashnr1 get_pcvar_num(PtFlash11);}
    if(
PlayerLevels[id][3] == 2){XpFlashnr1 get_pcvar_num(XpFlash12); PtFlashnr1 get_pcvar_num(PtFlash12);}
    if(
PlayerLevels[id][3] == 3){XpFlashnr1 get_pcvar_num(XpFlash13); PtFlashnr1 get_pcvar_num(PtFlash13);}
    if(
PlayerLevels[id][3] == 4){XpFlashnr1 get_pcvar_num(XpFlash14); PtFlashnr1 get_pcvar_num(PtFlash14);}
    if(
PlayerLevels[id][4] == 1){XpFlashnr2 get_pcvar_num(XpFlash21); PtFlashnr2 get_pcvar_num(PtFlash21);}
    if(
PlayerLevels[id][4] == 2){XpFlashnr2 get_pcvar_num(XpFlash22); PtFlashnr2 get_pcvar_num(PtFlash22);}
    if(
PlayerLevels[id][4] == 3){XpFlashnr2 get_pcvar_num(XpFlash23); PtFlashnr2 get_pcvar_num(PtFlash23);}
    if(
PlayerLevels[id][4] == 4){XpFlashnr2 get_pcvar_num(XpFlash24); PtFlashnr2 get_pcvar_num(PtFlash24);}
    if(
PlayerLevels[id][5] == 1){XpSmoke get_pcvar_num(XpSmoke1); PtSmoke get_pcvar_num(PtSmoke1);}
    if(
PlayerLevels[id][5] == 2){XpSmoke get_pcvar_num(XpSmoke2); PtSmoke get_pcvar_num(PtSmoke2);}
    if(
PlayerLevels[id][5] == 3){XpSmoke get_pcvar_num(XpSmoke3); PtSmoke get_pcvar_num(PtSmoke3);}
    if(
PlayerLevels[id][5] == 4){XpSmoke get_pcvar_num(XpSmoke4); PtSmoke get_pcvar_num(PtSmoke4);}
    if(
PlayerLevels[id][6] == 1){XpRespawn get_pcvar_num(XpRespawn1); PtRespawn get_pcvar_num(PtRespawn1);}
    if(
PlayerLevels[id][6] == 2){XpRespawn get_pcvar_num(XpRespawn2); PtRespawn get_pcvar_num(PtRespawn2);}
    if(
PlayerLevels[id][6] == 3){XpRespawn get_pcvar_num(XpRespawn3); PtRespawn get_pcvar_num(PtRespawn3);}
    if(
PlayerLevels[id][1] < 6){
        
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_HP"HpHealthPlayerLevels[id][1], XpHealthPtHealth );
        
menu_additem(menutemp"1"0);
    }
    if(
cs_get_user_team(id) == CS_TEAM_T){
        if(
PlayerLevels[id][2] < 6){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_HE"PlayerLevels[id][2], XpHePtHe );
            
menu_additem(menutemp"2"0);
        }
        if(
PlayerLevels[id][3] < 5){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_FLASH1"PlayerLevels[id][3], XpFlashnr1PtFlashnr1 );
            
menu_additem(menutemp"3"0);
        }
        if(
PlayerLevels[id][4] < 5){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_FLASH2"PlayerLevels[id][4], XpFlashnr2PtFlashnr2 );
            
menu_additem(menutemp"4"0);
        }
        if(
PlayerLevels[id][5] < 5){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_SMOKE"PlayerLevels[id][5], XpSmokePtSmoke );
            
menu_additem(menutemp"5"0);
        }
        if(
PlayerLevels[id][6] < 4){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_RESPAWN"PlayerLevels[id][6], XpRespawnPtRespawn );
            
menu_additem(menutemp"6"0);
        }
    }
    
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_INFO");
    
menu_additem(menutemp"7"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);

No offence, but that's terrible coding. You should really learn more before getting into plugins like this.

Last edited by Jon; 10-29-2009 at 12:33.
Jon is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-29-2009 , 13:48   Re: XpMod
Reply With Quote #12

Quote:
Originally Posted by Jon View Post
PHP Code:
public LoadData(id
{
    if(
get_pcvar_num(SaveXp) == 1){
        new 
AuthID[35];
        
get_user_authid(id,AuthID,34);
        new 
vaultkey[64],vaultdata[256
        
format(vaultkey,63,"%s-XPMod",AuthID
        
format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#",PlayerXp[id],PlayerLevels[id][1],PlayerLevels[id][2],PlayerLevels[id][3],PlayerLevels[id][4],PlayerLevels[id][5],PlayerLevels[id][6]) 
        
fvault_get_data(g_vault,vaultkey,vaultdata,255
        
replace_all(vaultdata255"#"" "
        new 
playerlxp[32], playerlvl1[32], playerlvl2[32], playerlvl3[32], playerlvl4[32], playerlvl5[32], playerlvl6[32]; 
        
parse(vaultdataplayerlxp31playerlvl131playerlvl231playerlvl331playerlvl431playerlvl531playerlvl631
        
PlayerXp[id] = str_to_num(playerlxp);
        
PlayerLevels[id][1] = str_to_num(playerlvl1)
        
PlayerLevels[id][2] = str_to_num(playerlvl2)
        
PlayerLevels[id][3] = str_to_num(playerlvl3)
        
PlayerLevels[id][4] = str_to_num(playerlvl4)
        
PlayerLevels[id][5] = str_to_num(playerlvl5)
        
PlayerLevels[id][6] = str_to_num(playerlvl6)
    }
    if(
PlayerLevels[id][1] == 0){
        
PlayerLevels[id][1] = 1;
        
PlayerXp[id] = get_pcvar_num(StarterXp);
    }
    if(
PlayerLevels[id][2] == 0){
        
PlayerLevels[id][2] = 1;
    }
    if(
PlayerLevels[id][3] == 0){
        
PlayerLevels[id][3] = 1;
    }
    if(
PlayerLevels[id][4] == 0){
        
PlayerLevels[id][4] = 1;
    }
    if(
PlayerLevels[id][5] == 0){
        
PlayerLevels[id][5] = 1;
    }
    if(
PlayerLevels[id][6] == 0){
        
PlayerLevels[id][6] = 1;
    }
    if(
PlayerLevels[id][1] == 2){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth1);
    }
    if(
PlayerLevels[id][1] == 3){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth2);
    }
    if(
PlayerLevels[id][1] == 4){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth3);
    }
    if(
PlayerLevels[id][1] == 5){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth4);
    }
    if(
PlayerLevels[id][1] == 6){
        
PlayerPercent[id][1] = get_pcvar_num(PtHealth5);
    }
    if(
PlayerLevels[id][2] == 2){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe1);
    }
    if(
PlayerLevels[id][2] == 3){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe2);
    }
    if(
PlayerLevels[id][2] == 4){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe3);
    }
    if(
PlayerLevels[id][2] == 5){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe4);
    }
    if(
PlayerLevels[id][2] == 6){
        
PlayerPercent[id][2] = get_pcvar_num(PtHe5);
    }
    if(
PlayerLevels[id][3] == 2){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash11);
    }
    if(
PlayerLevels[id][3] == 3){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash12);
    }
    if(
PlayerLevels[id][3] == 4){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash13);
    }
    if(
PlayerLevels[id][3] == 5){
        
PlayerPercent[id][3] = get_pcvar_num(PtFlash14);
    }
    if(
PlayerLevels[id][4] == 2){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash21);
    }
    if(
PlayerLevels[id][4] == 3){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash22);
    }
    if(
PlayerLevels[id][4] == 4){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash23);
    }
    if(
PlayerLevels[id][4] == 5){
        
PlayerPercent[id][4] = get_pcvar_num(PtFlash24);
    }
    if(
PlayerLevels[id][5] == 2){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke1);
    }
    if(
PlayerLevels[id][5] == 3){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke2);
    }
    if(
PlayerLevels[id][5] == 4){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke3);
    }
    if(
PlayerLevels[id][5] == 5){
        
PlayerPercent[id][5] = get_pcvar_num(PtSmoke4);
    }
    if(
PlayerLevels[id][6] == 2){
        
PlayerPercent[id][6] = get_pcvar_num(PtRespawn1);
    }
    if(
PlayerLevels[id][6] == 3){
        
PlayerPercent[id][6] = get_pcvar_num(PtRespawn2);
    }
    if(
PlayerLevels[id][6] == 4){
        
PlayerPercent[id][6] = get_pcvar_num(PtRespawn3);
    }
    return 
PLUGIN_CONTINUE 
}
//The content of the menu
public XpMenu(id) {
    new 
temp[64];
    
formatextemp63"%L"LANG_PLAYER"MENU_TITLE");
    new 
menu menu_create(temp"xpmenu_handler");
    if(
PlayerLevels[id][1] == 1){XpHealth get_pcvar_num(XpHealth1); HpHealth get_pcvar_num(HpHealth1); PtHealth get_pcvar_num(PtHealth1);}
    if(
PlayerLevels[id][1] == 2){XpHealth get_pcvar_num(XpHealth2); HpHealth get_pcvar_num(HpHealth2); PtHealth get_pcvar_num(PtHealth2);}
    if(
PlayerLevels[id][1] == 3){XpHealth get_pcvar_num(XpHealth3); HpHealth get_pcvar_num(HpHealth3); PtHealth get_pcvar_num(PtHealth3);}
    if(
PlayerLevels[id][1] == 4){XpHealth get_pcvar_num(XpHealth4); HpHealth get_pcvar_num(HpHealth4); PtHealth get_pcvar_num(PtHealth4);}
    if(
PlayerLevels[id][1] == 5){XpHealth get_pcvar_num(XpHealth5); HpHealth get_pcvar_num(HpHealth5); PtHealth get_pcvar_num(PtHealth5);}
    if(
PlayerLevels[id][2] == 1){XpHe get_pcvar_num(XpHe1); PtHe get_pcvar_num(PtHe1);}
    if(
PlayerLevels[id][2] == 2){XpHe get_pcvar_num(XpHe2); PtHe get_pcvar_num(PtHe2);}
    if(
PlayerLevels[id][2] == 3){XpHe get_pcvar_num(XpHe3); PtHe get_pcvar_num(PtHe3);}
    if(
PlayerLevels[id][2] == 4){XpHe get_pcvar_num(XpHe4); PtHe get_pcvar_num(PtHe4);}
    if(
PlayerLevels[id][2] == 5){XpHe get_pcvar_num(XpHe5); PtHe get_pcvar_num(PtHe5);}
    if(
PlayerLevels[id][3] == 1){XpFlashnr1 get_pcvar_num(XpFlash11); PtFlashnr1 get_pcvar_num(PtFlash11);}
    if(
PlayerLevels[id][3] == 2){XpFlashnr1 get_pcvar_num(XpFlash12); PtFlashnr1 get_pcvar_num(PtFlash12);}
    if(
PlayerLevels[id][3] == 3){XpFlashnr1 get_pcvar_num(XpFlash13); PtFlashnr1 get_pcvar_num(PtFlash13);}
    if(
PlayerLevels[id][3] == 4){XpFlashnr1 get_pcvar_num(XpFlash14); PtFlashnr1 get_pcvar_num(PtFlash14);}
    if(
PlayerLevels[id][4] == 1){XpFlashnr2 get_pcvar_num(XpFlash21); PtFlashnr2 get_pcvar_num(PtFlash21);}
    if(
PlayerLevels[id][4] == 2){XpFlashnr2 get_pcvar_num(XpFlash22); PtFlashnr2 get_pcvar_num(PtFlash22);}
    if(
PlayerLevels[id][4] == 3){XpFlashnr2 get_pcvar_num(XpFlash23); PtFlashnr2 get_pcvar_num(PtFlash23);}
    if(
PlayerLevels[id][4] == 4){XpFlashnr2 get_pcvar_num(XpFlash24); PtFlashnr2 get_pcvar_num(PtFlash24);}
    if(
PlayerLevels[id][5] == 1){XpSmoke get_pcvar_num(XpSmoke1); PtSmoke get_pcvar_num(PtSmoke1);}
    if(
PlayerLevels[id][5] == 2){XpSmoke get_pcvar_num(XpSmoke2); PtSmoke get_pcvar_num(PtSmoke2);}
    if(
PlayerLevels[id][5] == 3){XpSmoke get_pcvar_num(XpSmoke3); PtSmoke get_pcvar_num(PtSmoke3);}
    if(
PlayerLevels[id][5] == 4){XpSmoke get_pcvar_num(XpSmoke4); PtSmoke get_pcvar_num(PtSmoke4);}
    if(
PlayerLevels[id][6] == 1){XpRespawn get_pcvar_num(XpRespawn1); PtRespawn get_pcvar_num(PtRespawn1);}
    if(
PlayerLevels[id][6] == 2){XpRespawn get_pcvar_num(XpRespawn2); PtRespawn get_pcvar_num(PtRespawn2);}
    if(
PlayerLevels[id][6] == 3){XpRespawn get_pcvar_num(XpRespawn3); PtRespawn get_pcvar_num(PtRespawn3);}
    if(
PlayerLevels[id][1] < 6){
        
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_HP"HpHealthPlayerLevels[id][1], XpHealthPtHealth );
        
menu_additem(menutemp"1"0);
    }
    if(
cs_get_user_team(id) == CS_TEAM_T){
        if(
PlayerLevels[id][2] < 6){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_HE"PlayerLevels[id][2], XpHePtHe );
            
menu_additem(menutemp"2"0);
        }
        if(
PlayerLevels[id][3] < 5){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_FLASH1"PlayerLevels[id][3], XpFlashnr1PtFlashnr1 );
            
menu_additem(menutemp"3"0);
        }
        if(
PlayerLevels[id][4] < 5){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_FLASH2"PlayerLevels[id][4], XpFlashnr2PtFlashnr2 );
            
menu_additem(menutemp"4"0);
        }
        if(
PlayerLevels[id][5] < 5){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_SMOKE"PlayerLevels[id][5], XpSmokePtSmoke );
            
menu_additem(menutemp"5"0);
        }
        if(
PlayerLevels[id][6] < 4){
            
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_RESPAWN"PlayerLevels[id][6], XpRespawnPtRespawn );
            
menu_additem(menutemp"6"0);
        }
    }
    
formatextemp63"%L"LANG_PLAYER"MENU_ITEM_INFO");
    
menu_additem(menutemp"7"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);

No offence, but that's terrible coding. You should really learn more before getting into plugins like this.
I dont like doing that way either but get_pcvar_num can only handle the pcvar itself i wanted to do something like
Code:
PlayerPercent[id][1] = get_pcvar_num(PtHealth%d, PlayerLevels[id][1] - 1);
But that wouldnt work with the way get_pcvar_num() works
micke1101 is offline
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-29-2009 , 14:06   Re: XpMod
Reply With Quote #13

Bugged like hell

Last edited by Redfalcon; 11-07-2009 at 09:19.
Redfalcon is offline
Send a message via MSN to Redfalcon
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-29-2009 , 15:23   Re: XpMod
Reply With Quote #14

Quote:
Originally Posted by Redfalcon View Post
I have use this plugin on my Hide N Seek server for about 3-5 days and it works perfectly.

But i got a bug. When people buy +10 Hp, +15, 25+ and such. they get first 110 then 115 hp if u know what i mean.
When i told u to make the plugin i meant if u buy +10 HP and buy +15 you will get 125 hp.

Sorry for my terrible english

EDIT: I don't think this one will be approved because of Exolents Xp MOd if he gonna release it.
You change your mind all the time XD

Neither do i but thats not why i made it i made it cause you kept nagging about it
micke1101 is offline
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-29-2009 , 16:04   Re: XpMod
Reply With Quote #15

........

Last edited by Redfalcon; 11-07-2009 at 09:19.
Redfalcon is offline
Send a message via MSN to Redfalcon
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-29-2009 , 16:14   Re: XpMod
Reply With Quote #16

I'm actually amazed that you managed to make a simple thing so complicated. Your LoadData and menu functions are just amazing. Not to be rude at all, but you need a rewrite, not optimizations.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-29-2009 , 16:28   Re: XpMod
Reply With Quote #17

Quote:
Originally Posted by Xellath View Post
I'm actually amazed that you managed to make a simple thing so complicated. Your LoadData and menu functions are just amazing. Not to be rude at all, but you need a rewrite, not optimizations.
Probably
micke1101 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-29-2009 , 16:37   Re: Sample of how NOT to code for approval: XpMod
Reply With Quote #18

Unapproved and stickied. The title should say it all. Maybe I'm being a little mean, but this has to be the worst code I've seen (except for the indentation, which is just mediocre). There is absolutely no way possible that this can ever be approved, unless you completely rewrote it, in which case it wouldn't be this mod anymore.

That's not to say that you shouldn't try. If you want to make it better, go to scripting help. However, this is not an acceptable plugin submission.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-31-2009 , 09:47   Re: Sample of how NOT to code for approval: XpMod
Reply With Quote #19

Lol micke1101 i thode u was a great coder.....
Redfalcon is offline
Send a message via MSN to Redfalcon
SoYti
Member
Join Date: Oct 2008
Old 11-02-2009 , 08:22   Re: Sample of how NOT to code for approval: XpMod
Reply With Quote #20


Last edited by SoYti; 11-02-2009 at 08:39.
SoYti is offline
Reply


Thread Tools
Display Modes

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 18:22.


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