Special credits for Yonni Suarez "nice idea men"
Warning "sorry for my bad english"
[pawn]/*This food system is for all script,warchief-gups or fc-or from 0*/
#define COLOR_PINK 0xFFC0CBAA
#define COLOR_GREEN 0xE8941EFF
#define COLOR_YELLOW 0xFFFF00AA
new Cafe[MAX_PLAYERS];
new Pizza[MAX_PLAYERS];
new Bebida[MAX_PLAYERS];
//===============================================================================
public OnPlayerDisconnect(playerid, reason)
{
Cafe[playerid] = 0;
Pizza[playerid] = 0;
Bebida[playerid] = 0;
return 1;
}
//===============================================================================
public OnPlayerDeath(playerid,killerid,reason)
{
Cafe[playerid] = 0;
Pizza[playerid] = 0;
Bebida[playerid] = 0;
return 1;
}
[/pawn]
[pawn]//===============================================================================
/* This is for script from 0*/
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext, "Foods", true) == 0) {
SendClientMessage(playerid,COLOR_YELLOW ,"-----------Foods-----------");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyp for buy a pizza ");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyb for buy a drink");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyc for buy a coffee");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c eatp or /c drinkb or /c drinkc for eat or drink the foods");
return 1;
}
else if(strcmp(cmdtext, "buyp", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Pizza[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For eat a pizza type /c eatp");
}
if(Pizza[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You buy a pizza!");
Pizza[playerid] = 1;
SetPlayerMoney(playerid,GetPlayerMoney(playerid) - 150);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, you need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Need go to the pizzeria!");
}
return 1;
}
else if(strcmp(cmdtext, "buyb", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Bebida[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For drink a bebida type /c drinkb");
}
if(Bebida[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a drink");
Bebida[playerid] = 1;
SetPlayerMoney(playerid,GetPlayerMoney(playerid) - 10);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money,need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Need go to the pizzeria!");
}
return 1;
}
else if(strcmp(cmdtext, "buyc", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,-1169.71337, -616.97027, 11.82830) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Cafe[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"To drink coffee type /c drinkc");
}
if(Cafe[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a coffee!");
Cafe[playerid] = 1;
SetPlayerMoney(playerid,GetPlayerMoney(playerid) - 25);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money,need 150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Go to the cafeteria Robina or the pizza place!");
}
return 1;
}
else if(strcmp(cmdtext, "eatp", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Pizza[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Not have a pizza!");
}
if(Pizza[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~E~o~O~h~A~w~T~o~I~h~N~w~G ~h~.~w~.~o~.");
SendClientMessage(playerid,COLOR_PINK,"[PIZZA]:You eat a pizza and recovery you energy!");
SetTimer("comiendopizza", 5000, false);
Pizza[playerid] = 0;
}
return 1;
}
else if(strcmp(cmdtext, "drinkc", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Cafe[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"buy a coffee first!!");
}
if(Cafe[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~D~o~R~h~~I~h~N~w~K~h~I~w~N~o~G~w~.");
SendClientMessage(playerid,COLOR_RED,"[Drink]:You drink you coffee and recovery energy!");
SetTimer("tomandocafe", 5000, false);
Cafe[playerid] = 0;
}
return 1;
}
else if(strcmp(cmdtext, "drinkb", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Bebida[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Buy drink first!!");
}
if(Bebida[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~D~o~R~h~~I~h~N~w~K~h~I~w~N~o~G~w~.");
SendClientMessage(playerid,COLOR_RED,"[Drink]:You drink and recovery you energy!");
SetTimer("tomandobebida", 5000, false);
Bebida[playerid] = 0;
}
return 1;
} [/pawn]
[pawn] /* ------------- For script warchief ------------ */
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext, "Foods", true) == 0) {
SendClientMessage(playerid,COLOR_YELLOW ,"-----------Foods-----------");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyp for buy a pizza ");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyb for buy a drink");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyc for buy a coffee");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c eatp or /c drinkb or /c drinkc for eat or drink the foods");
return 1;
}
else if(strcmp(cmdtext, "buyp", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Pizza[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For eat a pizza type /c eatp");
}
if(Pizza[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a pizza");
Pizza[playerid] = 1;
DecPlayerCash(playerid,150);
}
if(cash < 150) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Go to the pizzeria for buy a pizza");
}
return 1;
}
else if(strcmp(cmdtext, "buyb", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Bebida[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For drink type /c drinkb");
}
if(Bebida[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a drink");
Bebida[playerid] = 1;
DecPlayerCash(playerid,150);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Go to the pizzeria");
}
return 1;
}
else if(strcmp(cmdtext, "buyc", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,-1169.71337, -616.97027, 11.82830) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Cafe[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For drink a coffee, type /c drinkc");
}
if(Cafe[playerid] == 0) {
if(cash >= 25) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a coffee");
Cafe[playerid] = 1;
DecPlayerCash(playerid,150);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Go to Cafeteria Robina or The pizzeria for buy a coffee!");
}
return 1;
}
else if(strcmp(cmdtext, "eatp", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Pizza[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"not have a pizza");
}
if(Pizza[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~E~o~O~h~A~w~T~o~I~h~N~w~G ~h~.~w~.~o~.");
SendClientMessage(playerid,COLOR_PINK,"[Eating]:Eating pizza!");
SetTimer("comiendopizza", 5000, false);
Pizza[playerid] = 0;
}
return 1;
}
else if(strcmp(cmdtext, "drinkc", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Cafe[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Need buy a coffee!!");
}
if(Cafe[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~D~o~R~h~~I~h~N~w~K~h~I~w~N~o~G~w~.");
SendClientMessage(playerid,COLOR_RED,"[Drink]:You drink a coffee and recovery energy!");
SetTimer("tomandocafe", 5000, false);
Cafe[playerid] = 0;
}
return 1;
}
else if(strcmp(cmdtext, "drinkb", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Bebida[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Not have a drink!!");
}
if(Bebida[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~D~o~R~h~~I~h~N~w~K~h~I~w~N~o~G~w~.");
SendClientMessage(playerid,COLOR_RED,"[Drink]:Drink and recovery energy!");
SetTimer("tomandobebida", 5000, false);
Bebida[playerid] = 0;
}
return 1;
} [/pawn]
[pawn] /* ------- For script gups or Fight City ------- */
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext, "Foods", true) == 0) {
SendClientMessage(playerid,COLOR_YELLOW ,"-----------Foods-----------");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyp for buy a pizza ");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyb for buy a drink");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c buyc for buy a coffee");
SendClientMessage(playerid,COLOR_YELLOW ,"Whrite /c eatp or /c drinkb or /c drinkc for eat or drink the foods");
return 1;
}
else if(strcmp(cmdtext, "buyp", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Pizza[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For eat a pizza type /c eatp");
}
if(Pizza[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a pizza");
Pizza[playerid] = 1;
DecPlayerHandCash(playerid,150);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Go to the pizzeria for buy a pizza");
}
return 1;
}
else if(strcmp(cmdtext, "buyb", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Bebida[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For drink type /c drinkb");
}
if(Bebida[playerid] == 0) {
if(cash >= 150) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a drink");
Bebida[playerid] = 1;
DecPlayerHandCash(playerid,150);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Go to the pizzeria");
}
return 1;
}
else if(strcmp(cmdtext, "buyc", true) == 0) {
if(PlayerToPoint(8, playerid,-1048.77099, 82.13945, 12.43262 ) || PlayerToPoint(8, playerid,-895.97473, 798.99871, 12.26343) || PlayerToPoint(8, playerid,-1169.71337, -616.97027, 11.82830) || PlayerToPoint(8, playerid,425.24963, 81.22541, 12.06054)) {
new cash = GetPlayerMoney(playerid);
if(Cafe[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"For drink a coffee, type /c drinkc");
}
if(Cafe[playerid] == 0) {
if(cash >= 25) {
SendClientMessage(playerid,COLOR_YELLOW,"You bought a coffee");
Cafe[playerid] = 1;
DecPlayerHandCash(playerid,150);
}
if(cash < 100) {
SendClientMessage(playerid,COLOR_YELLOW,"Need more money, need $150!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Go to Cafeteria Robina or The pizzeria for buy a coffee!");
}
return 1;
}
else if(strcmp(cmdtext, "eatp", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Pizza[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"not have a pizza");
}
if(Pizza[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~E~o~O~h~A~w~T~o~I~h~N~w~G ~h~.~w~.~o~.");
SendClientMessage(playerid,COLOR_PINK,"[Eating]:Eating pizza!");
SetTimer("comiendopizza", 5000, false);
Pizza[playerid] = 0;
}
return 1;
}
else if(strcmp(cmdtext, "drinkc", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Cafe[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Need buy a coffee!!");
}
if(Cafe[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~D~o~R~h~~I~h~N~w~K~h~I~w~N~o~G~w~.");
SendClientMessage(playerid,COLOR_RED,"[Drink]:You drink a coffee and recovery energy!");
SetTimer("tomandocafe", 5000, false);
Cafe[playerid] = 0;
}
return 1;
}
else if(strcmp(cmdtext, "drinkb", true) == 0) {
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Bebida[playerid] == 0) {
SendClientMessage(playerid,COLOR_GREEN,"Not have a drink!!");
}
if(Bebida[playerid] == 1) {
TogglePlayerControllable(playerid,0);
GameTextForPlayer(playerid,"~w~.~o~.~h~. ~w~D~o~R~h~~I~h~N~w~K~h~I~w~N~o~G~w~.");
SendClientMessage(playerid,COLOR_RED,"[Drink]:Drink and recovery energy!");
SetTimer("tomandobebida", 5000, false);
Bebida[playerid] = 0;
}
return 1;
}
[/pawn]
[pawn]
//===============================================================================
public comiendopizza(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if (IsPlayerConnected(i)) {
TogglePlayerControllable(i,1);
SetPlayerHealth(i,100);
SendClientMessage(playerid,COLOR_YELLOW,"You eating a pizza and recovery you energy");
}
}
}
//===============================================================================
public tomandocafe(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if (IsPlayerConnected(i)) {
TogglePlayerControllable(i,1);
SetPlayerHealth(i,100);
SendClientMessage(playerid,COLOR_YELLOW,"You drinking a coffee and recovery you energy");
}
}
}
//===============================================================================
public tomandobebida(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if (IsPlayerConnected(i)) {
TogglePlayerControllable(i,1);
SetPlayerHealth(i,100);
SendClientMessage(playerid,COLOR_YELLOW,"You drinking a drink and recovery you energy");
}
}
}
//==============================================================================
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
//==============================================================================
/* This commands is for food system, you need go to any pizzeria in the city for buy, and for eat or drink you type the command everywhere*/
/* BY ALEDARK24 FOR ROLEPLAY SCRIPTS , DO YOU LIKE THIS COMMANDS ¿¿?? GIVEME THANKS OR CREDITS IN YOU SERVER */[/pawn]