Hello guys i have two bugs in this codes.
I'm not understanding if the error is funtions or the code complete itself.
The first error is the funtion don't get user name (admin), the motd appears but shows as admin always offline.
Image :
http://**************/photo/my-images/6/firsterror.png/
Code:
public print_leaderlist(id)
{
static motd[1501],name[32]
new i, count, x, len
for(i = 1 ; i <= maxplayers ; i++)
if(is_user_connected(i))
if(get_user_flags(i) & LEADER_CHECK)
get_user_name(i,name,sizeof name - 1)
len = format(motd[len], 1500-len,"<body bgcolor=#000000><font color=#000000><pre>")
len += format(motd[len],1500-len,"<center><img src=^"http://mysite.com/images/Admin_image...</center></img>")
len += format(motd[len],1500- len,"%L",id,"<body bgcolor=#000000><font color=^"green^"><h4>[LEADER ADMIN]<font color=^"red^">ACTIVE:</h4><br>")
len += format(motd[len],sizeof motd - 1 - len,"<h3><font color=^"blue^"><b>%s</b><br></h3>", name, count)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(motd[len],sizeof motd - 1 -len, "<body bgcolor=#000000><font color=#000000><pre>", name[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
show_motd(id, motd)
}
}
}
else {
len = format(motd[len], 1500-len,"<body bgcolor=#000000><font color=#000000><pre>")
len += format(motd[len], 1500-len,"<center><img src=^"http://mysite.com/images/Admin_image...</center></img>")
len += format(motd[len], 1500-len, "<h3><font color=^"red^">NO<font color=^"green^">[LEADER ADMIN]<font color=^"red^">ACTIVE</h3>")
len += format(motd[len],1500- len,"<h3><font color=^"red^">Contacto Admin --><font color=^"blue^"> http://mysite.com/Contact</h3>")
show_motd(id, motd)
}
}
The second error is the motd repeats the image, and shows as online admin, but the name of the admin don't shows.
Image:
http://**************/photo/my-images...conderror.png/
Code:
public print_adminlist(id)
{
static motd[1501],name[32]
new i, count, x, len
for(i = 1 ; i <= maxplayers ; i++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_CHECK)
get_user_name(i,name,sizeof name - 1)
len = format(motd[len], 1500-len,"<body bgcolor=#000000><font color=#000000><pre>")
len += format(motd[len], 1500-len,"<center><img src=^"http://mysite.com/images/Admin_image.png^"></center></img>")
len += format(motd[len],1500- len,"%L",id,"<body bgcolor=#000000><font color=^"green^"><h4>[MOD]<font color=^"red^">ACTIVE:</h4><br>")
len += format(motd[len],sizeof motd - 1 - len,"<h3><font color=^"blue^"><b>%s</b><br></h3>", name, count)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(motd[len],sizeof motd - 1 -len, "<body bgcolor=#000000><font color=#000000><pre>", name[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
show_motd(id, motd)
}
}
}
else {
len += format(motd[len], 1500-len,"<center><img src=^"http://mysite.com/images/Admin_image.png^"></center></img>")
len += format(motd[len], 1500-len, "<h3><font color=^"red^">NO<font color=^"green^">[MOD]<font color=^"red^">ACTIVE</h3>")
len += format(motd[len],1500- len,"<h3><font color=^"red^">Contact Admin --><font color=^"blue^"> http://mysite.com/Contact</h3>")
show_motd(id, motd)
}
}
Someone can help me please.