whats wrong with my money thing?
#1

heres an example of what im doing

if (GetPlayerMoney =< 1000)
{
GivePlayerWeapon(playerid,24,200);
GivePlayerMoney(playerid,-1000);
return 1;
}

What is wrong?
Reply
#2

Are you sure you wanna remove 1000 from the player
even if he has less then 1000?

Otherwise do;
pawn Код:
if(GetPlayerMoney(playerid)==1000) // Exactly 1000
or
pawn Код:
if(GetPlayerMoney(playerid)>=1000) // 1000 or more
Fixed code;
pawn Код:
if (GetPlayerMoney(playerid) =< 1000) // Maybe It's <= and not =< not sure I'm tired.
{
    GivePlayerWeapon(playerid,24,200);
    GivePlayerMoney(playerid,-1000);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
Are you sure you wanna remove 1000 from the player
even if he has less then 1000?

Otherwise do;
pawn Код:
if(GetPlayerMoney(playerid)==1000) // Exactly 1000
or
pawn Код:
if(GetPlayerMoney(playerid)>=1000) // 1000 or more
Fixed code;
pawn Код:
if (GetPlayerMoney(playerid) =< 1000) // Maybe It's <= and not =< not sure I'm tired.
{
    GivePlayerWeapon(playerid,24,200);
    GivePlayerMoney(playerid,-1000);
    return 1;
}
No difference at all.

pawn Код:
if (GetPlayerMoney(playerid) >= 1000)
{
    GivePlayerWeapon(playerid,24,200);
    GivePlayerMoney(playerid,-1000);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)