Simple help
#7

Quote:
Originally Posted by whadez
Посмотреть сообщение
Under:
CMD:getbccash(playerid, params[])

new name[MAX_PLAYER_NAME];

You are missing this dear friend:
GetPlayerName(playerid, name, 26); // MAX_PLAYER_NAME has 24 characters, not 26 though.

Also just an advice, dont write this under your signature:
Scripting Systems/Commands In Money$

If you have no freaking clue how to fix your own code.
by the way i want to fix /savecash to
its saving the cash after doing /savecash but when i type and save another amount its not adding in old one its
cutting my all money and setting it to taht much in last u saved so pls help me and i want to make this cod ewith

MAX_CASH 20000
so please help me in this ok

PHP код:
CMD:savecash(playeridparams[])
{
    if (
playeritems[playerid][ITEM_TYPE_Breifcase] == 0) return SendClientMessage2(playeridCOLOR_RED"You don't have a breifcase buy it from nearest store!");
    new 
cash;
    if(
sscanf(params"d"cash)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /savecash [Amount]");
    new 
pcash GetPlayerMoney(playerid);
    if(
pcash cash) return SendClientMessage(playeridCOLOR_RED"Error: You don't have that amount!");
    new 
name[26];
    
GetPlayerName(playeridname26);
    
dini_IntSet(AddDirFile(dir_userfilesname), "Briefcasecash"cash);
    
GivePlayerMoney(playerid, -cash);
    new 
string[256];
    
format(stringsizeof(string), "You have deposited %d from your briefcase. You have now %d"cashdini_Int(AddDirFile(dir_userfilesname), "Briefcasecash"));
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    return 
1;
}
CMD:getbccash(playeridparams[])
{
    if (
playeritems[playerid][ITEM_TYPE_Breifcase] == 0) return SendClientMessage2(playeridCOLOR_RED"You don't have a breifcase buy it from nearest store!");
    new 
cash;
    new 
name[26];
    
GetPlayerName(playeridname26);
    if(
sscanf(params"d"cash)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /getbccash [Amount]");
    if(
dini_Int(AddDirFile(dir_userfilesname), "Briefcasecash") < cash) return SendClientMessage(playeridCOLOR_RED"Error: You don't have that amount!");
    
dini_IntSet(AddDirFile(dir_userfilesname), "Briefcasecash"dini_Int(AddDirFile(dir_userfilesname), "Briefcasecash") - cash);
    
GivePlayerMoney(playeridcash);
    new 
string[256];
    
format(stringsizeof(string), "You have Withdrawn %d from your briefcase. You have now %d"cashdini_Int(AddDirFile(dir_userfilesname), "Briefcasecash"));
    
SendClientMessage(playeridCOLOR_YELLOWstring);
    return 
1;

Reply


Messages In This Thread
Simple help - by GoldenMan - 23.09.2017, 06:19
Re: Simple help - by GoldenMan - 23.09.2017, 07:44
Re: Simple help - by AzaMx - 23.09.2017, 08:06
Re: Simple help - by GoldenMan - 23.09.2017, 08:22
Re: Simple help - by GoldenMan - 23.09.2017, 10:06
Re: Simple help - by whadez - 23.09.2017, 10:20
Re: Simple help - by GoldenMan - 23.09.2017, 11:47
Re: Simple help - by SyS - 23.09.2017, 14:57
Re: Simple help - by GoldenMan - 23.09.2017, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)