01.04.2012, 21:16
well it can be used like that just what your doing i not correct,
look at this line
format expects :
string
int
float
float
int
and your passing:
string (old mystring var) read below
string (tname)
float (hp)
float (armor)
int (GetPlayerMoney(Target))
as far as mystring goes it contains "You are now spectating %s! Type /specoff to stop!"
already, and enless you want that included in your TD string....
this is why it was questioned.
but I have used it like this also in my code looks something like
hope this clears it up
look at this line
pawn Код:
format(MyString, 256, "~w~- %s(%d) -~n~~n~~y~Health: ~w~%0.1f ~l~- ~y~Armour: ~w~%0.1f ~l~- ~y~Money: ~w~$%d~n~~n~~r~< Sprint - Jump >", MyString,tname,hp,ar,GetPlayerMoney(Target));
string
int
float
float
int
and your passing:
string (old mystring var) read below
string (tname)
float (hp)
float (armor)
int (GetPlayerMoney(Target))
as far as mystring goes it contains "You are now spectating %s! Type /specoff to stop!"
already, and enless you want that included in your TD string....
this is why it was questioned.
but I have used it like this also in my code looks something like
pawn Код:
new i,aSize,strDialog[1024];
aSize = sizeof(aWeaponNames);
for (i=0;i<aSize;i++){
if (i==0) format(strDialog, sizeof (strDialog), "%s", aWeaponNames[i][eWeaponN_Name]);
else format(strDialog, sizeof (strDialog), "%s\n%s",strDialog, aWeaponNames[i][eWeaponN_Name]);
}
hope this clears it up