Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Function Bugs.

$
0
0
Cheers,

I have a Cooldown and Interest Timer in my Server.
Its Timer Works well but when function executes and when there are more than 10 players in server.
It starts spamming..

Here is the codes:
PHP Code:

public CooldownTimer(playerid)
{
    new 
msg[120];
    if(
Player[playerid][playerWanted] > )
    {
        
Player[playerid][playerWanted]--;
        
format(msg,sizeof(msg),"Your wanted level has been reduced to %d.",Player[playerid][playerWanted]);
        
SendClientMessage(playerid,COLOR_YELLOW,msg);
        
setWanted(playerid,Player[playerid][playerWanted]);
        return 
1;
    }
    else
    {
        
TextDrawHideForPlayer(playeridGM[loadObjectTD][0]);
    }
    return 
1;


and here is the interest timer code:
PHP Code:

public InterestTimer(playerid)
{
    new 
giveintr,deduction,msg3[100];
    
Player[playerid][interestTimer]++;
    
//SendClientMessage(playerid,COLOR_YELLOW,"DEBUG: ID 1");
    
if(Player[playerid][interestTimer] >= 10)
    {
         
deduction 10000;
         
giveintr Player[playerid][moneyBank]/deduction;
         
Player[playerid][interest] = Player[playerid][interest] + giveintr;
         
format(msg3,sizeof(msg3),"You have recieved your interest payment of $%s. Head to nearest local bank to collect it.",FormatNumber(giveintr));
         
SendClientMessage(playerid,COLOR_YELLOW,msg3);
         
Player[playerid][interestTimer] = 0;
         return 
1;
    }
    return 
1;


Thnx..

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>