Help plaese
#1

Hey guys. Ive got something weird.
This is from my /deposit command:
pawn Код:
if(dialogid == 101){
new ammount = strval(inputtext);
if(response){

if(GetPlayerMoney(playerid >= ammount))
{
bank[playerid] += ammount;
GivePlayerMoney(playerid, -ammount);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Je hebt niet genoeg geld!");
}
}
}
But when I have 150 money I can just deposit 10000. money. My money will just go down to red.

Please help
Reply
#2

Try it now.

pawn Код:
if(dialogid == 101)
{
    new ammount = strval(inputtext);
    if(response)
    {
        if(GetPlayerMoney(playerid) >= ammount)
        {
            bank[playerid] += ammount;
            GivePlayerMoney(playerid, -ammount);
            return 1;
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"Je hebt niet genoeg geld!");
            return 1;
        }
    }
}
Reply
#3

Yea thanks. Lol I see what I've done wrong. I didn't stop the command with return 1; xD
Reply
#4

No, that wasn't it. The return 1's didn't really do anything except make it not check past that for more code. The problem was this line.

pawn Код:
if(GetPlayerMoney(playerid >= ammount))
pawn Код:
if(GetPlayerMoney(playerid) >= ammount))
See?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)