Countdown Help
#1

CountDown problem :
when i typed for example /countdown 5
it make the countdown 65550
cmd:
Код:
dcmd_countdown(playerid,params[])
{
	new time;
	if(sscanf(params,"u",time))
	{
	    SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /countdown (time)");
	    return 1;
	}
	cdtime = time;
	return 1;
}
More

Код:
         PlayerPlayingTimeHour[i] ++;
     }
    }
    if(cdtime > 1)
	{
	new string[56];
	format(string,sizeof(string),"Countdown\n%d~b~",cdtime);
	GameTextForAll(string,5000,3);
	cdtime --;
	}
	if(cdtime == 1)
	{
	cdtime = 0;
	GameTextForAll("GOO",5000,3);
	}
Reply
#2

Should be sscanf i... u is for players.
Reply
#3

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Should be sscanf i... u is for players.
Explain sir , or Change the code and post it here .
Reply
#4

you mean
if(sscanf(params,"u",time))
will be
if(sscanf(params,"i",time))
Reply
#5

Код:
if(sscanf(params,"u",time))
u is for playernames, and IDs, i is for integers.

Код:
if(sscanf(params,"i",time))
65535 is INVALID_PLAYER_ID hence why it's coming out with that. If you had someone on there with ID 5, it'd likely work randomly, by fluke.
Reply
#6

Fixed.
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)