24.04.2009, 06:38
[pawno]stock ChangeHostName()
{
new HostName = 0;//note it always stays zero here // and u forgot to put the end piece of code ;
HostName++;//it always sets the hostname value + 1
if(HostName > 2)//if hostname is 2, which it never becomes it sets the value = zero
{
HostName = 0;
}
switch(HostName)//the number mostlikely is the case
{
case 0: format(string, sizeof(string), "hostname %s", HOSTNAME1);//i guess these are defines.
case 1: format(string, sizeof(string), "hostname %s", HOSTNAME2);//the value that always get picked
case 2: format(string, sizeof(string), "hostname %s", HOSTNAME3);//never gets picked, same goes for case 0
}
SendRconCommand(string);//its not a problem with this code, but the rest. since i expect u to use a_samp. it is already defined, and therefore u cannot use that same functionname for anything else.
return HostName;
}[/pawno]
also u forgot return.
the problem though mostlikely lies within a forward or variable.
not within this piece of code.
{
new HostName = 0;//note it always stays zero here // and u forgot to put the end piece of code ;
HostName++;//it always sets the hostname value + 1
if(HostName > 2)//if hostname is 2, which it never becomes it sets the value = zero
{
HostName = 0;
}
switch(HostName)//the number mostlikely is the case
{
case 0: format(string, sizeof(string), "hostname %s", HOSTNAME1);//i guess these are defines.
case 1: format(string, sizeof(string), "hostname %s", HOSTNAME2);//the value that always get picked
case 2: format(string, sizeof(string), "hostname %s", HOSTNAME3);//never gets picked, same goes for case 0
}
SendRconCommand(string);//its not a problem with this code, but the rest. since i expect u to use a_samp. it is already defined, and therefore u cannot use that same functionname for anything else.
return HostName;
}[/pawno]
also u forgot return.
the problem though mostlikely lies within a forward or variable.
not within this piece of code.