SA-MP Forums Archive
bool in format. - 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: bool in format. (/showthread.php?tid=602874)



bool in format. - FinStar - 14.03.2016

Hello, I was wondering if anyone knows how I do it to the format used function "If a player is in a vehicle," and in the format "string" would be announced "False" no car "True" in the vehicle.


Код:
format(CheckAmmoString,sizeof(CheckAmmoString),"{FFFF00}> Warning !  %s ( ID: %i ) possible ammo hack ( In Vehicle/DriveBy: True/False Weapon: (ID:%d) Ammo: %i ) ", 
ReturnPlayerName(playerid),
 playerid,
 GetPlayerWeapon(playerid), 
GetPlayerAmmo(playerid));



Re: bool in format. - Jefff - 14.03.2016

pawn Код:
format(CheckAmmoString,sizeof(CheckAmmoString),"%s",
(IsPlayerInAnyVehicle(playerid)) ? ("True") : ("False"));



Re: bool in format. - FinStar - 14.03.2016

Nice, it's work, thx.