26.12.2009, 12:26
Heey guys
Im using my own money on my server. but i want to make a /checkcash command so the player can see how much cash he has.
On the top i have:
got the following command to show cash in the bank and in pocket
But when i try to show the player his ammount ofmoney in pocket and bank it shows at the place where the money must be a @ or wird numberor % or a ^.
Im I tryed a lot
Im using my own money on my server. but i want to make a /checkcash command so the player can see how much cash he has.
On the top i have:
pawn Код:
new Cash[MAX_PLAYERS];<< The variable where the cash is stored in..
new CashOnBank[MAX_PLAYERS]; << The variable where the cash on the bank is stored in.
pawn Код:
dcmd_checkcash(playerid, params[])
{
#pragma unused params
new cashstring[48];
new bankstring[48];
format(cashstring, sizeof(cashstring), "[!] You now have %i cash in your pocket", Cash[playerid]);
format(bankstring, sizeof(bankstring), "[!] You now have %i cash in you bank", CashOnBank[playerid]);
SendClientMessage(playerid, COLOR_BLUE, cashstring);
SendClientMessage(playerid, COLOR_BLUE, bankstring);
return 1;
}
pawn Код:
stock SetPlayerCash(playerid, value)
{
Cash[playerid] = 0;
Cash[playerid] = Cash[playerid] + value;
return Cash[playerid];
}
stock GivePlayerCash(playerid, value)
{
Cash[playerid] = Cash[playerid] + value;
return Cash[playerid];
}
stock GetPlayerCash(playerid)
{
return Cash[playerid];
}
Im I tryed a lot