CMD:game(playerid, params[])
{
if(GetTickCount() - GetPVarInt(playerid, "LastGame") < 120000) return SendClientMessage(playerid, COLOR_WHITE, "You need to wait 2 game hours to play again this game.");
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1940.6553,981.7078,992.4688))
{
SendClientMessage(playerid, COLOR_WHITE, "You need to be in Four Dragons Casino to use this command.");
SetPlayerCheckpoint(playerid, 1940.6553,981.7078,992.4688, 2.0);
return 1;
}
new number, number2, price, msg[125];
if(sscanf(params, "ddd", number, number2, price)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE:/game [num1] [num2] [price]");
if(number < 1 || number > 6) return SendClientMessage(playerid, COLOR_WHITE, "First number must be 1-6");
if(number2 < 1 || number2 > 6) return SendClientMessage(playerid, COLOR_WHITE, "Secound number must be 1-6");
SendClientMessage(playerid, COLOR_YELLOW, "Remember that the price is automaticly multiplied with 10");
new dice = random(6)+1;
new dice2 = ~70% random(6)+1;
if(dice == number && dice2 == number2)
{
format(msg, sizeof(msg), "You won $%d, you can come again in 2 hours to play again this game.", price*10);
SendClientMessage(playerid, COLOR_GREEN, msg);
GivePlayerMoney(playerid, price*10);
}
else
{
format(msg, sizeof(msg), "You have lose $%d Have a nice day. Come back in 2 hours.", price);
SendClientMessage(playerid, COLOR_RED, msg);
GivePlayerMoney(playerid, - price);
}
SetPVarInt(playerid, "LastGame", GetTickCount());
return 1;
}
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
thanks but now need to make textdraws to show like dices and to changing the numbers 1 - 6 and to stop for 4 secounds it will be nice if some one helps me.
![]() |
// forward's
forward Start()
forward Stop()
forward Continue()
// lets start to count
SetTimer("Start", 3000,0); //somewhere in your script
// lets stop the timer
public Start()
{
SetTimer("Stop", 4000, 0);
}
// here we continue
public Stop()
{
SetTimer("Continue", 3000,0);
}
// here what will happen when the timer " Continue" will end to count
public Continue()
{
//script
}