SA-MP Forums Archive
string doesn't get called - 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: string doesn't get called (/showthread.php?tid=618184)



string doesn't get called - Bondz - 02.10.2016

PHP код:
            new str2[228]; 
            new 
Float:armour
            new 
Float:health
            
GetPlayerArmour(damagedidarmour); 
            
GetPlayerHealth(damagedidhealth); 
            
format(str2,sizeof(str2),"~n~~n~~n~~n~~n~~n~~b~~h~~h~%s~n~~w~ARMOUR:%0.2f ~r~Health:%0.2f "pName[damagedid], armourhealth); 
            
GameTextForPlayer(playeridstr210003); 
if i shoot someone it should show the playername,health and also the armour of the damaged id
but in this case,it's only showing player's name


Re: string doesn't get called - Gotham - 02.10.2016

because u have only created pName[damagedid] which shows the player's name itself


Re: string doesn't get called - Bondz - 02.10.2016

you don't understand at all.
damagedid is the player who get damaged
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage


Re: string doesn't get called - Gotham - 02.10.2016

Sorry.Didn't read the code properly , try:
PHP код:
            new str2[128];  
            new 
Float:armour;  
            new 
Float:health;  
            
GetPlayerArmour(damagedidarmour);  
            
GetPlayerHealth(damagedidhealth);  
            
format(str2,sizeof(str2),"~n~~n~~n~~n~~n~~n~~b~~h~~h~%s~n~~w~ARMOUR:%f~r~Health:%f"pName[damagedid], armourhealth);  
            
GameTextForPlayer(playeridstr210003); 



Re: string doesn't get called - oMa37 - 02.10.2016

Have you noticed how many lines you made? (~n~).
Try removing some of them.
Also set health/armour as %.0f in the string.


Re: string doesn't get called - Bondz - 02.10.2016

I want to make it like this

is there any other way?


Re: string doesn't get called - Rdx - 02.10.2016

I think it's textdraw, not gametext.