01.06.2010, 01:26
Is there a way you can find out if 'inputtext' is bigger or smaller that a players cash (say PlayerInfo[playerid][pCash] represented players cash)
if(strval(inputtext) > PlayerInfo[playerid][pCash]) //The player is a poor mofo lol
if(dialogid==6)
{
if(!response)return 0;
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot depost more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - (strval)inputtext;
AntiHack(playerid, -(strval)inputtext);
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + (strval)inputtext;
}
Originally Posted by Antonio (eternalrp.webatu.com)
LOL major fail in my code..
pawn Код:
|
strval(STRING);
(strval)string
if(dialogid==6)
{
if(!response)return 0;
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot deposit more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - strval(inputtext);
AntiHack(playerid, -strval(inputtext));
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + strval(inputtext);
}