#1

What's wrong with this script. It makes me laggy and this as you can see in pic.


PHP код:
#define CHANCES 50
new LOTTO_AMOUNT;
#define LOTTO_TIME_IN_MINUTES 10// Ten minutes
#define LOTTO_MIN_RAND 20000
#define LOTTO_MAX_RAND 70000
#define COLOR_INDIGO 0x33CCFFAA
#include <a_samp>
new tplayers=0;
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Blank Filterscript by your name here");
    print(
"--------------------------------------\n");
    
SetTimer("Lotto",LOTTO_TIME_IN_MINUTES/6000,1);
    
LOTTO_AMOUNT randomnumber(100000,200000);
    for(new 
ii<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
tplayers++;
        }
    }
    new 
st[128];
    
format(st128"There are currently %d players connected.",tplayers);
    
SendClientMessageToAll(COLOR_INDIGOst);
    return 
1;
}
forward Lotto();
public 
Lotto()
{
    new 
randoms[CHANCES];
    
#pragma unused randoms
    
new rand random(sizeof(randoms));
    if(!
IsPlayerConnected(rand))
    {
    
SendClientMessageToAll(COLOR_C"Alas! There was no winner for the lotto today.");
    new 
st[128];
    
format(st,128,"The current lotto: $%d. The random player this time was: %d. Better luck next time!",LOTTO_AMOUNT,rand);
    
SendClientMessageToAll(COLOR_INDIGOst);
    new 
randomnumber(LOTTO_MIN_RAND,LOTTO_MAX_RAND);
    new 
newamount LOTTO_AMOUNT +d;
    
LOTTO_AMOUNT newamount;
    }
    else
    {
    new 
name[24],
         
st[128];
    
GetPlayerName(randname24);
    
GivePlayerMoney(randLOTTO_AMOUNT);
    
SendClientMessage(randCOLOR_INDIGO"You have won the lotto!");
    
format(st,128,"%s (%d) has won the lotto! Congratulations to him! Lotto amount: $%d. Go rob him!",namerandLOTTO_AMOUNT);
    
SendClientMessageToAll(COLOR_INDIGO,st);
    
format(st,128,"You have won ~g~$ %d~n~~r~Congrats!",LOTTO_AMOUNT);
    
GameTextForPlayer(randst60005);
    
LOTTO_AMOUNT=50000;
    }
    return 
1;
}
stock randomnumber(minmax// ******
{
    new 
rand random(max-min)+min;
    return 
rand;
}
public 
OnPlayerConnect(playerid)
{
    
tplayers++;
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    
tplayers--;
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;

Reply
#2

i think it's from this : SetTimer("Lotto",LOTTO_TIME_IN_MINUTES/6000,1);

i don't understand what you want to do , because you are doing now a timer = 10/6000 , it will done 0.SOMETHING and the timer will be repeat too fast
Reply
#3

This is my GameClock. How to set on clock 18?

PHP код:
forward GameModeClock(); ///clock start
public GameModeClock()
{
    new 
string[256],string2[128];

    if (
GameMinute == 0)
    {
    
format(stringsizeof(string), "%s",string);
    
//printf(string);

    
format(string2sizeof(string2), "worldtime %s",string);
    
SendRconCommand(string2);

    
format(stringsizeof(string), "{FFFFFF}Game Time: {BDBDBD}%s",string);
    
SendClientMessageToAll(ROJOstring);
    }

Reply
#4

Why you want to set it to 18 ? it will change nothing to the LOTTO system.

to set the clock to 18 do this

PHP код:
SendRconCommand("worldtime 18"); 
adapt this to a command or something like that i will not give you everything.
Reply
#5

I don't want to set Time. I want to set Lotto release on Clock 18
PHP код:
forward GameModeClock(); ///clock start
public GameModeClock()
{
    new 
string[256],string2[128];
    if (
GameMinute == 18)
    {
    
SetTimer("lotto" 300
    }

something like thi ^^
Reply
#6

you need to know the basics of the pawn ...

PHP код:
#define CHANCES 50
new LOTTO_AMOUNT;
#define LOTTO_TIME_IN_MINUTES 10// Ten minutes
#define LOTTO_MIN_RAND 20000
#define LOTTO_MAX_RAND 70000
#define COLOR_INDIGO 0x33CCFFAA
#include <a_samp>
new tplayers=0;
public 
OnFilterScriptInit()
{
    return 
1;
}
forward Lotto();
public 
Lotto()
{
    new 
randoms[CHANCES];
    
#pragma unused randoms
    
new rand random(sizeof(randoms));
    if(!
IsPlayerConnected(rand))
    {
    
SendClientMessageToAll(COLOR_C"Alas! There was no winner for the lotto today.");
    new 
st[128];
    
format(st,128,"The current lotto: $%d. The random player this time was: %d. Better luck next time!",LOTTO_AMOUNT,rand);
    
SendClientMessageToAll(COLOR_INDIGOst);
    new 
randomnumber(LOTTO_MIN_RAND,LOTTO_MAX_RAND);
    new 
newamount LOTTO_AMOUNT +d;
    
LOTTO_AMOUNT newamount;
    }
    else
    {
    new 
name[24],
         
st[128];
    
GetPlayerName(randname24);
    
GivePlayerMoney(randLOTTO_AMOUNT);
    
SendClientMessage(randCOLOR_INDIGO"You have won the lotto!");
    
format(st,128,"%s (%d) has won the lotto! Congratulations to him! Lotto amount: $%d. Go rob him!",namerandLOTTO_AMOUNT);
    
SendClientMessageToAll(COLOR_INDIGO,st);
    
format(st,128,"You have won ~g~$ %d~n~~r~Congrats!",LOTTO_AMOUNT);
    
GameTextForPlayer(randst60005);
    
LOTTO_AMOUNT=50000;
    }
    return 
1;
}
stock randomnumber(minmax// ******
{
    new 
rand random(max-min)+min;
    return 
rand;
}
public 
OnPlayerConnect(playerid)
{
    
tplayers++;
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    
tplayers--;
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;

PHP код:
forward LunchLotto()
public 
LunchLotto()
{
    
SetTimer("Lotto"1000,false);
    
LOTTO_AMOUNT randomnumber(100000,200000);
    for(new 
ii<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
tplayers++;
        }
    }
    new 
st[128];
    
format(st128"There are currently %d players connected.",tplayers);
    
SendClientMessageToAll(COLOR_INDIGOst);
    return 
1;

Now you need to script a condition when the time is 18 you execute this function : LunchLotto();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)