How to use this ??
#1

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 
Reply
#2

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
Reply
#3

%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); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)