AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   formatex or format [SOLVED] (https://forums.alliedmods.net/showthread.php?t=168184)

modernwarfare 09-25-2011 07:06

formatex or format [SOLVED]
 
Hey guys i have been reading the wiki

but i dont really really understand

like

do i use

Code:

    iPos += formatex(szMotd[iPos], 2047-iPos, "%L" , id , "HELP11", Health_PerLevel)
    iPos += formatex(szMotd[iPos], 2047-iPos, "%L" , id , "HELP12", Armor_PerLevel)
    iPos += formatex(szMotd[iPos], 2047-iPos, "%L" , id , "HELP13", Speed_PerLevel)
    iPos += formatex(szMotd[iPos], 2047-iPos, "%L" , id , "HELP14", Regeneration_PerLevel)
    iPos += formatex(szMotd[iPos], 2047-iPos, "%L" , id , "HELP15", floatround((Gravity_PerLevel * 100)))

or do i need

Code:

    iPos += format(szMotd[iPos], 2047-iPos, "%L" , id , "HELP11", Health_PerLevel)
    iPos += format(szMotd[iPos], 2047-iPos, "%L" , id , "HELP12", Armor_PerLevel)
    iPos += format(szMotd[iPos], 2047-iPos, "%L" , id , "HELP13", Speed_PerLevel)
    iPos += format(szMotd[iPos], 2047-iPos, "%L" , id , "HELP14", Regeneration_PerLevel)
    iPos += format(szMotd[iPos], 2047-iPos, "%L" , id , "HELP15", floatround((Gravity_PerLevel * 100)))

and onther question

what happend if i put the formatex in a code that needs format?

do it use the format or its just ignore that code?

and thx

explain more for me because the approver has unapproved my plugin

because of this thing and some more things

and thx

hleV 09-25-2011 07:10

Re: formatex or format
 
http://www.amxmodx.org/funcwiki.php?...atex&go=search

modernwarfare 09-25-2011 07:19

Re: formatex or format
 
i have readed that

like if i save with nvault and its format

cant i use formatex?

Xellath 09-25-2011 07:24

Re: formatex or format
 
Quote:

Originally Posted by AMX Mod X Function Reference Search - formatex()
Same as format(), except does not perform a "copy back" check.
This means formatex() is faster, but DOES NOT ALLOW this type of call:
formatex(buffer, len, "%s", buffer)
formatex(buffer, len, buffer, buffer)
formatex(buffer, len, "%s", buffer[5])
This is because the output is directly stored into "buffer", rather than copied back at the end.


modernwarfare 09-25-2011 07:42

Re: formatex or format
 
thx guys now i understand

but the approver said that i need to use cvar pointers

is that right:

Code:

          SAVEXP = register_cvar("SaveXP", "1")
          WELCOMEMSG = register_cvar("welcomemsg", "1")
          LVLUPMSG = register_cvar("lvlupmsg", "1")
          DEATHMATCH = register_cvar("Deathmatch", "1")
          UNLIMITEDAMMO = register_cvar("unlimitedammo", "1")
          SOUNDS = register_cvar("sounds", "1")
          NOBUY = register_cvar("nobuy", "1")
          UPGRADESSHOP = register_cvar("upgradesshop", "1")
          GUNSMENU = register_cvar("gunsmenu", "1")


Arkshine 09-25-2011 08:42

Re: formatex or format
 
register_cvar returns a pointer, something to be used with get_pcvar_*() functions.

modernwarfare 09-25-2011 10:22

Re: formatex or format
 
Quote:

Originally Posted by Arkshine (Post 1562915)
register_cvar returns a pointer, something to be used with get_pcvar_*() functions.


thx fixed

please lock

learned everything needed

Arkshine 09-25-2011 10:31

Re: formatex or format
 
There is nothing to lock.

modernwarfare 09-25-2011 10:48

Re: formatex or format
 
Quote:

Originally Posted by Arkshine (Post 1562964)
There is nothing to lock.


i mean lock the thread

because its solved

hleV 09-25-2011 10:54

Re: formatex or format [SOLVED]
 
Threads aren't locked because they were solved. People may find additional questions regarding the matter.


All times are GMT -4. The time now is 19:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.