strval
#3

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
Okay, so im making a /countdown command, and im probably making it harder than it really should be. But im trying to convert the integer into a string or vise versa so i can use TextDrawSetString. But even when i strval i get an error on the TextDrawSetString line.

pawn Код:
CMD:countdown(playerid,params[])
{
    new string[4] = "4";
    new countdown = strval(string);
   
    CountTime = countdown;
       
    if(!IsAdmin(playerid, 1)) return ErrorMsg(playerid);
    if(sscanf(params, "i", countdown)) return Usage(playerid, "/countdown [time]");

    TextDrawSetString(AnnText, CountTime);
    TextDrawShowForAll(AnnText);
    CountTimer = SetTimer("CountDown",1000,true);
    return 1;
}
i dont know how to use strval so its probably wrong... I just want the textdrawsetstring to be the number you type in for countdown..
y are you using string?

Use this instead
pawn Код:
CMD:countdown(playerid,params[])
{
    new string[4];
    new countdown = 4;

    if(!IsAdmin(playerid, 1)) return ErrorMsg(playerid);
    if(sscanf(params, "i", countdown)) return Usage(playerid, "/countdown [time]");

    format(string,sizeof(string),"%d",countdown);
    TextDrawSetString(AnnText, string);
    TextDrawShowForAll(AnnText);
    CountTimer = SetTimer("CountDown",1000,true);
    return 1;
}
Reply


Messages In This Thread
strval - by SnG.Scot_MisCuDI - 07.07.2012, 05:35
Re: strval - by Finn - 07.07.2012, 06:04
Re: strval - by [MM]RoXoR[FS] - 07.07.2012, 06:34
Re: strval - by SnG.Scot_MisCuDI - 07.07.2012, 17:19
Re: strval - by ReneG - 07.07.2012, 18:27
Re: strval - by SnG.Scot_MisCuDI - 07.07.2012, 19:16
Re: strval - by ReneG - 07.07.2012, 22:05

Forum Jump:


Users browsing this thread: 1 Guest(s)