06.09.2011, 12:46
guys i have made one game with dices now i need help with my checkpoint i have created it but i cant see in the game just on the map btw the checkpoint is in casino four dragons...
here is the code:
thanks.
here is the code:
pawn Код:
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;
}