Hello i have this:
Code:
stock get_data(host[])
{
new ip[32], port[10], err;
copy(ip,charsmax(ip),host);
copy(port,charsmax(port),"27015");
if(containi(host,":")!=-1)
strtok(host, ip, charsmax(ip), port, charsmax(port), ':');
new sock = socket_open(ip,str_to_num(port),SOCKET_UDP,err);
if(sock<0 || err)
{
server_print("Socket error");
socket_close(sock);
return;
}
new buffer[1500];
copy(buffer,charsmax(buffer),"^xFF^xFF^xFF^xFF^x54Source Engine Query");
socket_send2(sock,buffer,strlen(buffer)+1);
new r = socket_recv(sock,buffer,sizeof(buffer));
socket_close(sock);
if(r<2)
{
server_print("No data");
return;
}
}
but when i use i get:
Code:
test.sma(238) : warning 209: function "get_data" should return a value
test.sma(250) : warning 209: function "get_data" should return a value
test.sma(253) : warning 209: function "get_data" should return a value
I need small code to get server status if is on = 1 if is off = 0.
Thanks.