TextDrawSetString - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDrawSetString (
/showthread.php?tid=457225)
TextDrawSetString -
SwisherSweet - 10.08.2013
Код:
so this cmd is soupposed to set the time in the MAP(NOT WORLD TIME) but it does not work
TextDrawSetString(TimeLeft,"time");<<u see the problem?
i tried this aswel
TextDrawSetString(TimeLeft,"%d",time);//did not work
so i need some help
Код:
entire cmd
CMD:settime(playerid,params[])
{
new string[128];
if(!Info[playerid][Logged]) return 0;
if(Info[playerid][Level] < 2) return ERRORMSG(playerid);
new time;
if(sscanf(params,"d",time)) return SendClientMessage(playerid,COLOR_GREY,"HELP: /settime [time]");
TextDrawHideForAll(TimeLeft);
TextDrawSetString(TimeLeft,"time");
TextDrawShowForAll(TimeLeft);
format(string,sizeof(string),"%s(%d) Has set the time or map to %d,",PlayerName(playerid), playerid, time);
SendClientMessageToAll(COLOR_ADMIN,string);
return 1;
}
Re: TextDrawSetString -
BullseyeHawk - 10.08.2013
pawn Код:
CMD:settime(playerid,params[])
{
new string[128];
if(!Info[playerid][Logged]) return 0;
if(Info[playerid][Level] < 2) return ERRORMSG(playerid);
new time;
if(sscanf(params,"d",time)) return SendClientMessage(playerid,COLOR_GREY,"HELP: /settime [time]");
TextDrawHideForAll(TimeLeft);
new _timeString[3]; format(_timeString, sizeof(_timeString), "%d", time);
TextDrawSetString(TimeLeft,_timeString);
TextDrawShowForAll(TimeLeft);
SetWorldTime(time);
format(string,sizeof(string),"%s(%d) Has set the time or map to %d,",PlayerName(playerid), playerid, time);
SendClientMessageToAll(COLOR_ADMIN,string);
return 1;
}
Try that.. You forgot a function. (
https://sampwiki.blast.hk/wiki/SetWorldTime)
Re: TextDrawSetString -
SwisherSweet - 10.08.2013
i shall test, will edit when when i get back...
Re: TextDrawSetString -
SwisherSweet - 10.08.2013
im sorry but did u even read my post?
so this cmd is soupposed to set the time in the MAP(NOT WORLD TIME) but it does not work
TextDrawSetString(TimeLeft,"time");<<u see the problem?
i tried this aswel
TextDrawSetString(TimeLeft,"%d",time);//did not work
so i need some help
Re: TextDrawSetString -
BullseyeHawk - 10.08.2013
Did you even read the code?
pawn Код:
new _timeString[3]; format(_timeString, sizeof(_timeString), "%d", time);
TextDrawSetString(TimeLeft,_timeString);
It does set it.
Did you test it out?
Re: TextDrawSetString -
SwisherSweet - 10.08.2013
yes i tested it out, it's set's the world time instead...
Re: TextDrawSetString -
BullseyeHawk - 10.08.2013
You can just remove this, "SetWorldTime(time);"
Do you use, new Text:TimeLeft; ?
Re: TextDrawSetString -
SwisherSweet - 10.08.2013
I fixed it thanks anyways