Whats The Problem With This..
#1

Hey guys, im not sure whats wrong with this:
pawn Код:
if(GetPlayerCash(playerid) > VehStats[vehicleid][vPrice])
            {
                SendClientMessage(playerid, COLOR_BLUE, "Congratz u bout a car nigga");
                VehStats[vehicleid][vOwnerID] = UserStats[playerid][pSQLid];
                GivePlayerCash(playerid, -VehStats[vehicleid][vPrice]);
                UpdateVehStats(vehicleid);
            }
            else
            {
                SendClientMessage(playerid, COLOR_BLUE, " Nigga, chu 2 pooooooooor!!");
            }
It keeps sending the "nigga chu 2 poor" message. I have 5000$ on me, i set car to 150$. Any ideas why code isn't working correctly.
Reply
#2

try to put GetPlayerMoney instead of GetPlayerCash and try with strval for VehStats[vehicleid][vPrice] (strval(VehStats[vehicleid][vPrice]))
Reply
#3

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
try to put GetPlayerMoney instead of GetPlayerCash and try with strval for VehStats[vehicleid][vPrice] (strval(VehStats[vehicleid][vPrice]))
You really need to work harder with your brain. He is using a custom GetPlayerMoney function.
Reply
#4

After insulting him, got any help? xD
Reply
#5

Show us your GetPlayerCash function.
Reply
#6

I use this:
pawn Код:
#define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
#define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
#define GetPlayerCash(%0) GetPVarInt(%0,"Money")
Reply
#7

Before the if statement, add this line:
pawn Код:
printf("Money: $%d", GetPlayerCash(playerid));
See what it prints.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)