SA-MP Forums Archive
How to use this ?? - 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: How to use this ?? (/showthread.php?tid=599480)



How to use this ?? - TheLegend1 - 26.01.2016

I am trying to get the max bets of a dealer but i dont know how to get if player has writen the Acceptable amount from dealer
i tried this btw idk if it works please help me out

Код HTML:
if(PlayerTemp[playerid][minbet] < "%s" || PlayerTemp[playerid][maxbet] > "%s") return SendClientError(playerid, "Invalid amount specified!");
gettin this error

PHP код:
error 001expected token"-string end-"but found "-identifier-"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 



Re: How to use this ?? - MicroKyrr - 26.01.2016

Quote:
Originally Posted by antonio112
Посмотреть сообщение
use:
%s - Strings. Like names, words, sentences and stuff ...
%i - for numbers (23, 43, 20, 2, etc etc) and player id (not name! Their ID)
%f - for floats, numbers with comma (34,23; 45,2450, etc etc)
%s is not for numbers , try to change the %s to %i


Re: How to use this ?? - AmigaBlizzard - 26.01.2016

%s, %i, %d and %f are only used while formatting strings.
They are placeholders for the contents of variables, which aren't in place as well.

They can't be used with if-instructions, so no reason to add them.
You must replace the "%s" with the variablenames themselves.
Example:
PHP код:
new CurrentBet 50;
new 
Message[144];
format(Messagesizeof(Message), "Invalid amount specified, you need values between %d and %d"PlayerTemp[playerid][minbet], PlayerTemp[playerid][maxbet]);
if(
PlayerTemp[playerid][minbet] < CurrentBet || PlayerTemp[playerid][maxbet] > CurrentBet) return SendClientError(playeridMessage);