05.07.2017, 15:47
PHP Code:
stock Cash_Give(playerid, amount)
{
P[playerid][p_cash] = P[playerid][p_cash]+amount;
GivePlayerMoney(playerid, amount);
printf("amount %i",amount);
}
CMD:money(playerid, params[]){
new user, money,cent;
if(sscanf(params,"p<.>uiI(0)",user,money,cent)) return SendClientMessage(playerid, -1, "Use /money [ID] [cash]");
Cash_Give(playerid, money+cent);
return true;
}
Я не знаю как сделать так что бы всё совпадало с тем что есть в бд.
//update
Сделал так:
PHP Code:
stock Cash_Give(playerid, amount)
{
P[playerid][p_cash] = P[playerid][p_cash]+amount;
if(amount%100 > 0) {
GivePlayerMoney(playerid, amount/100);
printf("2amount %i.%i",amount/100,amount%100);
}
else if(amount/100 == 0){
GivePlayerMoney(playerid, (amount%100)/100);
printf("1amount %i.%i",amount/100,amount%100);
}
}