High interger crash server!
#1

I make this function:
PHP код:
stock GiveMoney(playeridmoney)
{
    new 
str[128];
    if(
money 0)
    {
        
format(strsizeof(str), "~g~+%s$"AddCommas(money));
        
GameTextForPlayer(playeridstr30001);
    }
    else if(
money 0)
    {
        
format(strsizeof(str), "~r~%s$"AddCommas(money));
        
GameTextForPlayer(playeridstr30001);
    }
    
PInfo[playerid][Cash] += money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridPInfo[playerid][money]);
    return 
0;

I try to use it in my cmd:

PHP код:
CMD:givemoney(playeridparams[])
{
    new 
str[128], playermoney;
    if(
sscanf(params"ud"playermoney)) return SendMessage(playeridCOLOR_LENH"/givemoney [ID] [Money]"SMLENH);
    
GiveMoney(playermoney);
    return 
1;

When i use this cmd with high negative value (ex: -100.000.000), it cause a crash -_- ! Someone help me pls, tks!

P/s: Sr for my bad English
Reply


Messages In This Thread
High interger crash server! - by dieuhanhphuc - 01.01.2015, 17:37
Re: High interger crash server! - by ball - 01.01.2015, 17:52
Re: High interger crash server! - by dieuhanhphuc - 01.01.2015, 18:09
Re: High interger crash server! - by ball - 01.01.2015, 18:12
Re: High interger crash server! - by dieuhanhphuc - 01.01.2015, 18:17
Re: High interger crash server! - by dieuhanhphuc - 01.01.2015, 18:31
Re: High interger crash server! - by dieuhanhphuc - 01.01.2015, 18:36
Re: High interger crash server! - by ball - 01.01.2015, 18:37
Re: High interger crash server! - by dieuhanhphuc - 01.01.2015, 18:40
Re: High interger crash server! - by ball - 01.01.2015, 18:43

Forum Jump:


Users browsing this thread: 1 Guest(s)