Jump to content
  • 0

pomoc 1 minuta = jiná funkce


H{3}nr{1}

Dotaz

Zdravím,

potřeboval by jsem help že např. první minutu se hráči přídá 120 $, druhou 200 atp.

 

Základ mám, takže sem nepište blbej základ, ale byl by jsem rád za code, zkusil jsem jednu věc, ale to dávalo random, a to moc nechci...

Díky za pomoc.

Link to comment
Share on other sites

9 odpovědí na tuto otázku

Recommended Posts

  • 0

nahoru

new level[MAX_PLAYERS];
do OnPlayerConnect

level[playerid] = 0;
a do timeru (jeho publicu)

for(new a; a < MAX_PLAYERS; a++{
	if(IsPlayerConnected(a){
		switch(level[a]){
			case 0:
				// poprvé
			break;
			case 1:
				// podruhé
			break;
			//case 3, 4 5...
			default:
				// max. úroveň
			break;
		}
		level[a]++;
	}
}
Link to comment
Share on other sites

  • 0

tady -> for(new a; a < MAX_PLAYERS; a++{

 

chybí ")" ->  for(new a; a < MAX_PLAYERS; a++) {

 

tady -> if(IsPlayerConnected(a){

 

chybí zase ")" -> if(IsPlayerConnected(a)) {

Link to comment
Share on other sites

  • 0

I tak mi to píše že pawno neodpovídá

a nebo

new Penize;

forward CasNaMoney();

 

public CasNaMoney()

   Penize += 80;

   for(new i = 0;i<MAX_PLAYERS;i++)
   {

   if(Penize > 800)

   {

   GivePlayerMoney(i,Penize);

   }else{

   Penize = 0;

   }

   }

}

 

public OnGameModeInit()

{

  SetTimer("CasNaMoney",60000,1);

  return 1;

}

Link to comment
Share on other sites

  • 0
new AddMoneyCount[MAX_PLAYERS];
public AddPlayerMoney(playerid)
{
    switch(AddMoneyCount[playerid])
    {
        case 0: GivePlayerMoney(playerid,120);
        case 1: GivePlayerMoney(playerid,200);
    }
    AddMoneyCount[playerid]++;
    return 1;
}
SetTimer("AddPlayerMoney",60000,1,"i",playerid);

A kdyby jsi chtel pro vsechny hrace:

public MinuteTimer()
{
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i)) AddPlayerMoney(i);
    }
}
SetTimer("MinuteTimer",60000,1);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...