CMD:getgift(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 1128.26636, -1450.60254, 14.66266)) { Random = random(3); switch(Random) { case 0: { GivePlayerMoney(playerid, 250000); SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 250,000$! Merry christmas!"); } case 1: { SetPlayerScore(playerid, GetPlayerScore(playerid)+1); SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 1 levelup! Merry christmas!"); } } } else { SendClientMessage(playerid, -1, "You are not at the christmas tree!"); } return 1; }
//on the top of your script
new GiftTimer[MAX_PLAYERS];
new GiftgTimer[MAX_PLAYERS];
CMD:getgift(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1128.26636, -1450.60254, 14.66266))
{
Random = random(3);
switch(Random)
{
case 0:
{
GivePlayerMoney(playerid, 250000);
SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 250,000$! Merry christmas!");
}
case 1:
{
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 1 levelup! Merry christmas!");
}
}
}
else
{
SendClientMessage(playerid, -1, "You are not at the christmas tree!");
}
GiftTimer[playerid] = 1;
GiftgTimer[playerid]= SetTimerEx("Giftg", 1000, false, "d", playerid);
return 1;
}
//place it on the buttom of your script
forward Giftg(playerid);
public Giftg(playerid)
{
GiftTimer[playerid] = 0;
SendClientMessage(playerid,0x42CC33C8, "You have to wait 1 minute to use /getgift again.");
return 1;
}
pawn Код:
pawn Код:
pawn Код:
|
//on the top of your script
new GiftTimer[MAX_PLAYERS];
new GiftgTimer[MAX_PLAYERS];
CMD:getgift(playerid, params[])
{
if(GiftTimer[playerid] == 1)
return SendClientMessage(playerid, COLOR_WHITE, "You can use this command after 1 minute again!"); //Sorry, i forgot to check the timer in it.
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1128.26636, -1450.60254, 14.66266))
{
Random = random(3);
switch(Random)
{
case 0:
{
GivePlayerMoney(playerid, 250000);
SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 250,000$! Merry christmas!");
}
case 1:
{
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 1 levelup! Merry christmas!");
}
}
}
else
{
SendClientMessage(playerid, -1, "You are not at the christmas tree!");
}
GiftTimer[playerid] = 1;
GiftgTimer[playerid]= SetTimerEx("Giftg", 1000, false, "d", playerid);
return 1;
}
//place it on the buttom of your script
forward Giftg(playerid);
public Giftg(playerid)
{
GiftTimer[playerid] = 0;
SendClientMessage(playerid,0x42CC33C8, "You have to wait 1 minute to use /getgift again.");
return 1;
}