Raised This Month: $ Target: $400
 0% 

Trade perks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
InteX01
Senior Member
Join Date: Jan 2017
Old 03-03-2018 , 13:45   Trade perks
Reply With Quote #1

Can someone help me making this trade system work.

PHP Code:
public ZamNekomPredmet(id

    new 
menu menu_create("Izaberi Igraca""ZamNekomPredmet_Handle"); 
    new 
cb menu_makecallback("ZamNekomPredmet_Callback"); 
    new 
broj_predmeta
    for(new 
i=0i<=32i++) 
    { 
        if(!
is_user_connected(i)) 
            continue; 
        
menu_additem(menunaziv_igraca[i], "0"0cb); 
    } 
    
menu_display(idmenu); 

This is opened using /trade command.

Nextup

PHP Code:
public ZamNekomPredmet_Handle(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
    
}
    
    static 
dst[32], cuvarname[32], data[5], tempidaccesscallback
    menu_item_getinfo
(menuitemaccessdatacharsmax(data), dstcharsmax(dst), callback)
    
tempid str_to_num(data)
    
    new 
parm[1]
    
parm[0]=id
    
    
if(!is_user_connected(tempid)) 
    { 
        
ColorChat(idNORMAL"^4[COD:MW4]^1 Igrac se diskonektovao."); 
        return 
PLUGIN_CONTINUE
    } 
    if(!
informacije_predmet_igraca[id][0]) 
    { 
        
ColorChat(idNORMAL"^4[COD:MW4]^1 Nemate nijedan predmet."); 
        return 
PLUGIN_CONTINUE
    } 
    if(!
informacije_predmet_igraca[tempid][0]) 
    { 
        
ColorChat(idNORMAL"^4[COD:MW4]^1 Ovaj igrac nema predmet."); 
        return 
PLUGIN_CONTINUE
    } 
    if(!
is_user_alive(tempid)) 
    { 
        
ColorChat(idNORMAL"^4[COD:MW4]^1 Igrac kome dajes mora biti ziv."); 
        return 
PLUGIN_CONTINUE
    } 
    
    
get_user_name(iddst15)
    
get_user_name(tempidcuvarname15)
    
    new 
naslovs[256]
    
formatex(naslovscharsmax(naslovs), "\d[ \y%s ti nudi: \r%s \d]",dst,naziv_predmeta[informacije_predmet_igraca[id][0]]);
    new 
menus menu_create(naslovs"trade_select");
    
menu_additem(menus"\yAccept");
    
menu_additem(menus"\rDecline");
    
menu_display(tempidmenus);
    
    return 
PLUGIN_CONTINUE;
}
public 
item_check(idmenuitemtempid)
{
    
item1[id] = informacije_predmet_igraca[id][0]
    
item2[tempid] = informacije_predmet_igraca[tempid][0]
}
public 
trade_select(idmenuitem,tempid)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_CONTINUE;
    }
    
    new 
dst[32], cuvarname[32];
    
get_user_name(iddst15)
    
get_user_name(tempidcuvarname15)
    switch(
item)
    {
        case 
0:
        {        
            
item_check(idmenuitemtempid)
            
DajPredmet(tempiditem1[id])//informacije_predmet_igraca[id][0]); 
            
DajPredmet(iditem2[tempid])//informacije_predmet_igraca[daj_igracu[item]][0]); 
            //informacije_predmet_igraca[daj_igracu[item]][1] = informacije_predmet_igraca[id][1]; 
            
ColorChat(idNORMAL"^4[COD:MW4]^1 Zamenio si se sa ^3%s ^1za item ^4%s."cuvarnamenaziv_predmeta[informacije_predmet_igraca[id][0]]); 
            
ColorChat(tempidNORMAL"^4[COD:MW4]^1 Zamenio si se sa ^3%s ^1za item ^4%s."dstnaziv_predmeta[informacije_predmet_igraca[tempid][0]]);  
        }
        case 
1:
        {
            
ColorChat(idNORMAL"^4[COD:MW4]^3 %s^1 je odbio ponudu."cuvarname);  
            
ColorChat(tempidNORMAL"^4[COD:MW4]^1 Odbio si ponudu.");  
        }
        
    }
    return 
PLUGIN_CONTINUE
}
public 
ZamNekomPredmet_Callback(idmenuitem

    if(
daj_igracu[item] == id
        return 
ITEM_DISABLED
    return 
ITEM_ENABLED

I tried something but its not working well... And i guess problem is using that player index from first command :/ I hope u understand what i want.
InteX01 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 03:13.


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