View Single Post
Author Message
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 12-26-2010 , 07:33   Problem with pointers c++ amxx
Reply With Quote #1

I can`t write into the memory my code is:

PHP Code:
// Amxmod...
static cell AMX_NATIVE_CALL read_sayparty(AMX *amxcell *params)
{
    
int id params[1];
    if(
in_party[id-1]>=0)
    {
        
CPluginMngr::CPlugin *plugin g_plugins.findPlugin(zombie_id);
        
int func;
        if (
amx_FindPublic(plugin->getAMX(), "writeMessage", &func) == AMX_ERR_NONE)
        {
            
register celldest;
            
            
int *send = &func;
            
dest = (cell *)(amx->base + (int)(((AMX_HEADER *)amx->base)->dat params[2]));
            *
dest++ = (cell)*send;
            *
dest 0;

            
send = &plr_party[in_party[id-1]][0];
            
dest = (cell *)(amx->base + (int)(((AMX_HEADER *)amx->base)->dat params[3]));
            *
dest++ = (cell)*send;
            *
dest 0;
            
            
send = &plr_party[in_party[id-1]][1];
            
dest = (cell *)(amx->base + (int)(((AMX_HEADER *)amx->base)->dat params[4]));
            *
dest++ = (cell)*send;
            *
dest 0;
            
            
send = &plr_party[in_party[id-1]][2];
            
dest = (cell *)(amx->base + (int)(((AMX_HEADER *)amx->base)->dat params[5]));
            *
dest++ = (cell)*send;
            *
dest 0;
    
            
send = &plr_party[in_party[id-1]][3];
            
dest = (cell *)(amx->base + (int)(((AMX_HEADER *)amx->base)->dat params[6]));
            *
dest++ = (cell)*send;
            *
dest 0;
            
            
send = &plr_party[in_party[id-1]][4];
            
dest = (cell *)(amx->base + (int)(((AMX_HEADER *)amx->base)->dat params[7]));
            *
dest++ = (cell)*send;
            *
dest 0;

            return 
1;
        }
    }
    return 
0;
};

//Plugin amx..
register_clcmd("say_team""say_party");

public 
say_party(id)
{
    
client_print(0,print_chat,"%d",id);
    
    static 
message[192],func,plr_owner,plr2,plr3,plr4,plr5,final_msg[250],name[32];
    
read_args(messagesizeof(message) - 1);
    
remove_quotes(message);
    
trim(message);
    
    if( !
message[0] ) return PLUGIN_CONTINUE;
    
    
client_print(0,print_chat,"%d,%d,%d,%d,%d,%d,%d",id,func,plr_owner,plr2,plr3,plr4,plr5);
    
    if(!
read_sayparty(id,func,plr_owner,plr2,plr3,plr4,plr5)) return PLUGIN_HANDLED;
    
    
client_print(0,print_chat,"%d,%d,%d,%d,%d,%d,%d",id,func,plr_owner,plr2,plr3,plr4,plr5);
    
    new 
plr[5],count;
    
get_user_name(id,name,charsof(name));
        
    if(
id == plr_ownerformatex(final_msgcharsof(final_msg), "[Party-Chat]-[Lider] ^x03%s^x04: ^x01%s"namemessage);
    else 
formatex(final_msgcharsof(final_msg), "[Party-Chat]-[Invitado] ^x03%s^x04: ^x01%s"namemessage);
    
    if(
33 plr_owner && is_user_connected(plr_owner)) plr[count++] = plr_owner;
    if(
33 plr2 && is_user_connected(plr2)) plr[count++] = plr2;
    if(
33 plr3 && is_user_connected(plr3)) plr[count++] = plr3;
    if(
33 plr4 && is_user_connected(plr4)) plr[count++] = plr4;
    if(
33 plr5 && is_user_connected(plr5)) plr[count++] = plr5;
    
    for(new 
i;i<count;i++)
    {
        if(
is_user_connected(plr[i]))
        {
            
callfunc_begin_ifuncget_zombieid() );
            
callfunc_push_int(plr[i])
            
callfunc_push_str(final_msg)
            
callfunc_end()
        }
    }
    return 
PLUGIN_HANDLED;

Always print:
1
1,0,0,0,0,0,0
1,0,0,0,0,0,0



can help me?
__________________
capostrike93 is offline