15.12.2018, 23:02
Hello, guys, this command is for a mini game but it does not work restricting the meeting point and the gifts anywhere. How do I fix it?
CMD:chest(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, -7.5863,-74.3160,3.1172)) return SendClientMessage(playerid,red,"ERROR:You must be near the Chest to use the command");
if(Minigame[playerid] == 0) return SendClientMessage(playerid,yellow,"* You are not in any New game !.");
if(Restringido(playerid,"cmd(GIFT")) return SendClientMessage(playerid, red, "You have to wait 60 seconds to use this command");
{
Restringir(playerid,"cmd(GIFT",60);
RandomGift = random(4);
switch(RandomGift)
{
case 0: // SCORE GIFT
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 2000);
SendClientMessage(playerid, COLOR_YELLOW, "Santa Claus gifted you +15 Score. Merry Christmas!");
}
case 1: // WEAPON GIFT
{
GivePlayerWeapon(playerid,35,25);
SendClientMessage(playerid, COLOR_YELLOW, "Santa Claus gifted you Weapon. Merry Christmas!");
}
case 2: // Santa Hat + Armor
{
SendClientMessage(playerid,COLOR_YELLOW,"You Got an armor + Santa Hat from santa! Wear it and enjoy, you got +100 Armor HP");
SetPlayerArmour(playerid,100.0);
}
case 3: //HEAVY ARMOR WITH 300 HP Health
{
SendClientMessage(playerid,COLOR_YELLOW,"You Got a Heavy Armor with +300 HP");
SetPlayerArmour(playerid,300.0);
}
}
}
return 1;
}
CMD:chest(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, -7.5863,-74.3160,3.1172)) return SendClientMessage(playerid,red,"ERROR:You must be near the Chest to use the command");
if(Minigame[playerid] == 0) return SendClientMessage(playerid,yellow,"* You are not in any New game !.");
if(Restringido(playerid,"cmd(GIFT")) return SendClientMessage(playerid, red, "You have to wait 60 seconds to use this command");
{
Restringir(playerid,"cmd(GIFT",60);
RandomGift = random(4);
switch(RandomGift)
{
case 0: // SCORE GIFT
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 2000);
SendClientMessage(playerid, COLOR_YELLOW, "Santa Claus gifted you +15 Score. Merry Christmas!");
}
case 1: // WEAPON GIFT
{
GivePlayerWeapon(playerid,35,25);
SendClientMessage(playerid, COLOR_YELLOW, "Santa Claus gifted you Weapon. Merry Christmas!");
}
case 2: // Santa Hat + Armor
{
SendClientMessage(playerid,COLOR_YELLOW,"You Got an armor + Santa Hat from santa! Wear it and enjoy, you got +100 Armor HP");
SetPlayerArmour(playerid,100.0);
}
case 3: //HEAVY ARMOR WITH 300 HP Health
{
SendClientMessage(playerid,COLOR_YELLOW,"You Got a Heavy Armor with +300 HP");
SetPlayerArmour(playerid,300.0);
}
}
}
return 1;
}