AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A simple question (https://forums.alliedmods.net/showthread.php?t=62655)

elpouletorange 11-01-2007 16:48

A simple question
 
when i do client_print or anything else what is the letter after the % and is it correct ???


Example: ("You have % HP, % AP......."get_user_health(id), get_user_armor(id)

Arkshine 11-01-2007 17:03

Re: A simple question
 
%d = decimal number
%i = integer
%f = float
%s = string

kp_uparrow 11-01-2007 18:11

Re: A simple question
 
client_print(id,print_chat,"You have %d HP and %d AP",get_user_health(id),get_user_armor(id))

somehow i use %d for integers instead of %i

elpouletorange 11-02-2007 18:53

Re: A simple question
 
There is an error but i don't know what is it...

PHP Code:

public kmod_myskill(id)
{
    
client_print(idprint_chat"[KillMod]Strenght: %d - Defence: %d - Dexterity: %d - Agility: %d"str[id], def[id], dex[id], agi[id]);


/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : error 001: expected token: ",", but found "-identifier-"
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpqPrDs5.sma(52) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors

Arkshine 11-02-2007 19:02

Re: A simple question
 
Quote:

%d",str[id]
-_-'


All times are GMT -4. The time now is 01:24.

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