Some kind like loose indentation
#1

PHP код:
public PayDay()
{
    new 
string[128];
    new 
account,interest;
    new 
rent 0;
    new 
randf random(sizeof(JailRandomSpawn));
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
                if(
PlayerInfo[i][pLevel] > 0)
                {
                    if(
MoneyMessage[i]==1)
                    {
                        
SendClientMessage(iCOLOR_LIGHTRED"You failed to pay your debt, Jail time.");
                        
GameTextForPlayer(i"~r~Busted!"20001);
                        
SetPlayerInterior(i6);
                           
SetPlayerPos(iJailRandomSpawn[randf][0], JailRandomSpawn[randf][1],JailRandomSpawn[randf][2]);
                        
SetPlayerFacingAngle(iJailRandomSpawn[randf][3]);
                        
PlayerInfo[i][pJailed] = 1;
                        
ResetPlayerWeapons(i);
                        
WantedPoints[i] = 0;
                        
PlayerInfo[i][pJailTime] = 240;
                        
TextDrawShowForPlayer(iJailTimeText[i]);
                        
format(stringsizeof(string), "You are jailed for %d seconds.   Bail: Unable"PlayerInfo[i][pJailTime]);
                        
SendClientMessage(iCOLOR_LIGHTBLUEstring);
                    }
                    new 
playername2[MAX_PLAYER_NAME];
                    
GetPlayerName(iplayername2sizeof(playername2));
                    
account PlayerInfo[i][pAccount];
                    new 
key PlayerInfo[i][pPhousekey];
                    if(
key != 255)
                    {
                        
rent HouseInfo[key][hRent];
                        if(
strcmp(playername2HouseInfo[key][hOwner], true) == 0)
                        {
                            
rent 0;
                        }
                        else if(
rent GetPlayerMoney(i))
                        {
                            
PlayerInfo[i][pPhousekey] = 255;
                            
SendClientMessage(iCOLOR_WHITE"You have been evicted.");
                            
rent 0;
                        }
                        
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
                    }
                    new 
tmpintrate;
                    if (
key != 255 && strcmp(playername2HouseInfo[key][hOwner], true) == 0)
                    {
                        if(
PlayerInfo[i][pDonateRank] >= 8) { tmpintrate intrate+4; }
                        else { 
tmpintrate intrate+2; }//HouseInfo[key][hLevel]
                    
}
                    else
                    {
                        if(
PlayerInfo[i][pDonateRank] > 6) { tmpintrate 3; }
                        else { 
tmpintrate 1; }
                    }
                    if(
PlayerInfo[i][pPayDay] >= 5)
                    {
                        
Tax += TaxValue;//Should work for every player online
                        
PlayerInfo[i][pAccount] -= TaxValue;
                        if(
PlayerInfo[i][pDonateRank] >= 4)
                        {
                            new 
bonus PlayerInfo[i][pPayCheck] / 2;
                            
PlayerInfo[i][pPayCheck] += bonus;
                        }
                        new 
checks PlayerInfo[i][pPayCheck];
                        new 
ebill = (PlayerInfo[i][pAccount]/100000)*(PlayerInfo[i][pLevel]);
                        
ConsumingMoney[i] = 1;
                        
GivePlayerMoney(ichecks);
                        if(
PlayerInfo[i][pAccount] > 0)
                        {
                            
PlayerInfo[i][pAccount] -= ebill;
                            
SBizzInfo[4][sbTill] += ebill;
                        }
                        else
                        {
                            
ebill 0;
                        }
                        new 
gbill = (PlayerInfo[i][pAccount]/100000)*(PlayerInfo[i][pLevel]);
                        
ConsumingMoney[i] = 1;
                        
GivePlayerMoney(ichecks);
                        if(
PlayerInfo[i][pAccount] > 0)
                        {
                            
PlayerInfo[i][pAccount] -= gbill;
                            
SBizzInfo[14][sbTill] += gbill;
                        }
                        else
                        {
                            
gbill 0;
                        }
                        new 
wbill = (PlayerInfo[i][pAccount]/100000)*(PlayerInfo[i][pLevel]);
                        
ConsumingMoney[i] = 1;
                        
GivePlayerMoney(ichecks);
                        if(
PlayerInfo[i][pAccount] > 0)
                        {
                            
PlayerInfo[i][pAccount] -= wbill;
                            
SBizzInfo[18][sbTill] += wbill;
                        }
                        else
                        {
                            
wbill 0;
                        }
                        
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
                        
PlayerInfo[i][pExp]++;
                        
PlayerPlayMusic(i);
                        
PlayerInfo[i][pAccount] = account+interest;
                        
SendClientMessage(iCOLOR_WHITE"|___ BANK STATMENT ___|");
                        
format(stringsizeof(string), "  Paycheck: $%d   Tax Money: -$%d"checksTaxValue);
                        
SendClientMessage(iCOLOR_GRAD1string);
                        if(
PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
                        {
                            
format(stringsizeof(string), "  Electricity Bill: -$%d || Gas Bill: -$%d || Weather Bill: -$%d",ebill,gbill,wbill);
                            
SendClientMessage(iCOLOR_GRAD1string);
                        }
                        
format(stringsizeof(string), "  Balance: $%d"account);
                        
SendClientMessage(iCOLOR_GRAD1string);
                        
format(stringsizeof(string), "  Interest Rate: 0.%d percent",tmpintrate);
                        
SendClientMessage(iCOLOR_GRAD2string);
                        
format(stringsizeof(string), "  Interest Gained $%d"interest);
                        
SendClientMessage(iCOLOR_GRAD3string);
                        
SendClientMessage(iCOLOR_GRAD4"|--------------------------------------|");
                        
format(stringsizeof(string), "  New Balance: $%d"PlayerInfo[i][pAccount]);
                        
SendClientMessage(iCOLOR_GRAD5string);
                        
format(stringsizeof(string), "  Rent: -$%d"rent);
                        
SendClientMessage(iCOLOR_GRAD5string);
                        
format(stringsizeof(string), "~y~PayDay~n~~w~Paycheck");
                        
GameTextForPlayer(istring50001);
                        
rent 0;
                        
PlayerInfo[i][pPayDay] = 0;
                        
PlayerInfo[i][pPayCheck] = 0;
                        
PlayerInfo[i][pConnectTime] += 1;
                        
PlayerInfo[i][pRob] += 1;
                        if(
PlayerInfo[i][pDonateRank] > 6)
                        {
                            
PlayerInfo[i][pPayDayHad] += 1;
                            if(
PlayerInfo[i][pPayDayHad] >= 5)
                            {
                                
PlayerInfo[i][pExp]++;
                                
PlayerInfo[i][pPayDayHad] = 0;
                            }
                        }
                        if(
PlayerInfo[i][pMember] == 14 || PlayerInfo[i][pLeader] == 14)
                        {
                            
PlayerInfo[i][pTow] += 5;
                        }
                        
Checkprop();
                    }
                }
                else
                {
                    
SendClientMessage(iCOLOR_LIGHTRED"* You haven't played long enough to obtain a PayDay.");
                }
        }
    }
    return 
1;

I have this command for payday, but when i try to give the payday not works. is not showing anything(or something like Unknown command). Command is not arranged good in pawno? or why not works? need some help
Reply
#2

That's a callback, not a command,

Did you mean when you type /payday for example, it says unknown cmd ?, if yes, show us your /payday code.
Reply
#3

That's not a command.
https://sampwiki.blast.hk/wiki/PAWN_tuto..._and_callbacks
Reply
#4

Yes is not a command, but i think that is wrong not the command.
Here is the command:
PHP код:
if(strcmp(cmd"/payday"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 1338)
            {
                
PayDay();
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   you are not authorized to use that command!");
            }
        }
        return 
1;
    } 
Reply
#5

pawn Код:
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
                        GameTextForPlayer(i, "~r~Busted!", 2000, 1);
                        SetPlayerInterior(i, 6);
                           SetPlayerPos(i, JailRandomSpawn[randf][0], JailRandomSpawn[randf][1],JailRandomSpawn[randf][2]);
                        SetPlayerFacingAngle(i, JailRandomSpawn[randf][3]);
                        PlayerInfo[i][pJailed] = 1;
What do you see wrong?
Reply
#6

nothing?
Reply
#7

pawn Код:
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
                        GameTextForPlayer(i, "~r~Busted!", 2000, 1);
                        SetPlayerInterior(i, 6);
                           SetPlayerPos(i, JailRandomSpawn[randf][0], JailRandomSpawn[randf][1],JailRandomSpawn[randf][2]);
                        SetPlayerFacingAngle(i, JailRandomSpawn[randf][3]);
                        PlayerInfo[i][pJailed] = 1;
Shouldn't it be?


pawn Код:
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
                        GameTextForPlayer(i, "~r~Busted!", 2000, 1);
                        SetPlayerInterior(i, 6);
                        SetPlayerPos(i, JailRandomSpawn[randf][0], JailRandomSpawn[randf][1],JailRandomSpawn[randf][2]);
                        SetPlayerFacingAngle(i, JailRandomSpawn[randf][3]);
                        PlayerInfo[i][pJailed] = 1;
Reply
#8

not working, again when i try /payday not showing anything like [___ BANK STATEMENT etc.
PS. not showing Unknown command.
Reply
#9

No warnings?
Reply
#10

No..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)