Timer doesnt work
#1

in onfilterscriptinut()

SetTimer("Chkmoney", 30000, true);

outside it..
new money[MAX_PLAYERS];
forward Chkmoney();
public Chkmoney()
{
new pname[MAX_PLAYER_NAME],astring[MAX_PLAYER_NAME+128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerMoney(i) > money[i])
{
GetPlayerName(i,pname,sizeof(pname));
format(astring,sizeof(astring),"%s(%i) has a cash imbalence, please investigate!");
SendClientMessageToAdmins(0xFF0000FF,astring);
}
}
}
}
Reply
#2

What is not working? Is it the message? Because you forgot to add the pname and id at the end of your format code.
pawn Код:
format(astring,sizeof(astring),"%s(%i) has a cash imbalence, please investigate!", pname,i);
Reply
#3

Hmm didn't notice that :fp I'll try that.
Reply
#4

pawn Код:
//top
new money[MAX_PLAYERS];
forward Chkmoney();

//GameModeInit
SetTimer("Chkmoney", 30000, true);

//Anywhere
public Chkmoney()
{
    new pname[MAX_PLAYER_NAME],astring[MAX_PLAYER_NAME+128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerMoney(i) > money[i])
            {
                GetPlayerName(i,pname,sizeof(pname));
                format(astring,sizeof(astring),"%s(%i) has a cash imbalence, please investigate!", pname,i);
                SendClientMessageToAdmins(0xFF0000FF,astring);
            }
        }
    }
}
Reply
#5

Still doesn't work. I give myself a cash imbalence and nothing happens no message nothing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)