if (strcmp("/getmilk", cmdtext, true, 10) == 0) { if (IsPlayerInRangeOfPoint(playerid,3,1382.0204,-1085.4540,27.3906)) { SendClientMessage(playerid, 0xFF8000FF, " *You have taken Bottle of Milk, Go and Deliver it at any 24/7 *"); SetPlayerCheckpoint(playerid, 1352.3014,-1755.9366,13.3520,3); } else { SendClientMessage(playerid, 0x33AA33AA, " You are not at Milk Factory "); } return 1; } if (strcmp("/dropmilk", cmdtext, true, 10) == 0) { if (IsPlayerInRangeOfPoint(playerid,3,1352.3014,-1755.9366,13.3520)) { SendClientMessage(playerid, 0xFF8000FF, " 24/7: Thank you sir for the Milk, we will give you $1500 for that "); SendClientMessage(playerid, 0xFF8000FF, " Gratz! The 24/7 gave you $1500 for the milk"); DisablePlayerCheckpoint(playerid); } else { SendClientMessage(playerid,0x33AA33AA, " You are not at any 24/7 "); } return 1; } |
//DECLARE A GLOBAL VARIABLE
new bool:HaveMilk[MAX_PLAYERS] = false;
if (strcmp("/getmilk", cmdtext, true, 10) == 0)
{
if(HaveMilk[playerid] == true) return SendClientMessage(playerid,-1,"You already have milk");
if (IsPlayerInRangeOfPoint(playerid,3,1382.0204,-1085.4540,27.3906))
{
SendClientMessage(playerid, 0xFF8000FF, " *You have taken Bottle of Milk, Go and Deliver it at any 24/7 *");
SetPlayerCheckpoint(playerid, 1352.3014,-1755.9366,13.3520,3);
HaveMilk[playerid] = true;
}
else
{
SendClientMessage(playerid, 0x33AA33AA, " You are not at Milk Factory ");
HaveMilk[playerid] = false;
}
return 1;
}
if (strcmp("/dropmilk", cmdtext, true, 10) == 0)
{
if(HaveMilk[playerid] == false) return SendClientMessage(playerid,-1,"You do not have milk");
if (IsPlayerInRangeOfPoint(playerid,3,1352.3014,-1755.9366,13.3520))
{
SendClientMessage(playerid, 0xFF8000FF, " 24/7: Thank you sir for the Milk, we will give you $1500 for that ");
SendClientMessage(playerid, 0xFF8000FF, " Gratz! The 24/7 gave you $1500 for the milk");
DisablePlayerCheckpoint(playerid);
HaveMilk[playerid] = false;
}
else
{
SendClientMessage(playerid,0x33AA33AA, " You are not at any 24/7 ");
}
return 1;
}