public payday(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
GameTextForPlayer(i, "~p~PAY~w~DAY", 1000, 1);
GivePlayerCash(playerid, 1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
SendClientMessage(playerid, COLOR_GREENYELLOW,"~~~~~~~~~~PayDay~~~~~~~~~~");
SendClientMessage(playerid, COLOR_WHITE,"You have recived a check of 1,000$!");
SendClientMessage(playerid, COLOR_WHITE,"You also got level up!");
SendClientMessage(playerid, COLOR_GREENYELLOW,"~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
return 1;
}
SetTimer( "Payday", 60000, true );
public payday(playerid)
{
new hh, mm, ss;
gettime( hh, mm, ss );
if( mm == 0 )
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
GameTextForPlayer(i, "~p~PAY~w~DAY", 1000, 1);
GivePlayerCash(playerid, 1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
SendClientMessage(playerid, COLOR_GREENYELLOW,"~~~~~~~~~~PayDay~~~~~~~~~~");
SendClientMessage(playerid, COLOR_WHITE,"You have recived a check of 1,000$!");
SendClientMessage(playerid, COLOR_WHITE,"You also got level up!");
SendClientMessage(playerid, COLOR_GREENYELLOW,"~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
}
return 1;
}
|
You need to set your timer to
Код:
SetTimer( "Payday", 60000, true ); Код:
public payday(playerid)
{
new hh, mm, ss;
gettime( hh, mm, ss );
if( mm == 0 )
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
GameTextForPlayer(i, "~p~PAY~w~DAY", 1000, 1);
GivePlayerCash(playerid, 1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
SendClientMessage(playerid, COLOR_GREENYELLOW,"~~~~~~~~~~PayDay~~~~~~~~~~");
SendClientMessage(playerid, COLOR_WHITE,"You have recived a check of 1,000$!");
SendClientMessage(playerid, COLOR_WHITE,"You also got level up!");
SendClientMessage(playerid, COLOR_GREENYELLOW,"~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
}
return 1;
}
|
new RandomPay = random(50000); //change the value to your cash value you want
GivePlayerMoney(playerid, random); //this will give random money 0 to 50000
SendClientMessage(playerid, COLOR_WHITE,"You have recived a check of 1,000$!");
new string[128];
format(string, sizeof(string), "You have recieve a check of $%i", RandomPay);
SendClientMessage(i, COLOR_WHITE, string);
|
change playerid to i, it will give you many errors.
and here is about the random cash you talking about pawn Код:
pawn Код:
pawn Код:
|
new RandomPay = random( 50000 - 10000 ) + 10000; //change the value to your cash value you want [ ( Max - Min ) + Min ]
GivePlayerMoney( playerid, RandomPay ); //this will give random money 10000 to 50000
GivePlayerMoney(playerid, random); //this will give random money 0 to 50000
GivePlayerMoney(playerid, RandomPay); //this will give random money 0 to 50000