Hey there again, have been trying to get this copy() function to work for the past hour, but it keeps over-writing the whole variable "hud_1" with the data from the last copy string.
Code:
new hud_1[256]
if(retrieve_data(g_Query[id],data) == -1)
{
format(hud_1,128," » %s ^n___________________^n Unregistered.",g_hud_1_title)
}
else
{
new jobinfo[3][32]
if(job_info(id,str_to_num(data[5]),jobinfo) == -1)
{
jobinfo[0] = "Invalid Job"
jobinfo[1] = "Invalid Job"
}
new main[64]
format(main,63,"%s Bank # / $: %s / %s^n Wallet: %s^n ",g_hud_1_header,data[1],data[0],data[2])
copy(hud_1,63,main)
new job_str[64]
if(equali(jobinfo[0],"")) format(job_str,63," Job: %s ^n",jobinfo[1])
else format(job_str,63,"Org: %s^n Job: %s",jobinfo[0],jobinfo[1])
copy(hud_1,63,job_str)
new salary_str[64]
new salary = str_to_num(jobinfo[2])
new pay_type = str_to_num(data[3])
new pay_pos = str_to_num(data[4])
switch(pay_type)
{
case 24:
{
format(salary_str,63," Salary: $%i^n Pay/D: $%i^n PayTimer(daily): %i/24",salary,salary*24,pay_pos)
}
case 60:
{
format(salary_str,63," Salary: $%i^n PayTimer(hourly): %i/60",salary,pay_pos)
}
default:
{
pick_paytype(id)
}
}
copy(hud_1,63,salary_str)
}
set_hudmessage(g_hud_1_rgb[0],g_hud_1_rgb[1],g_hud_1_rgb[2],g_hud_1_xy[0],g_hud_1_xy[1],0,0.0,99.0,0.0,0.0,HUD_1_CHANNEL)
show_hudmessage(id,hud_1)