Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Incluides
- #include <a_samp>
- #include <progress>
- #include <cpstream>
- #include <dini>
- #include <zcmd>
- // Defines
- #define minutos(%0) (1000 * %0 * 60)
- #define checknome CPS_GetPlayerCheckpoint(playerid)
- #define cardapio 6661
- #define PASTA_FOMESEDESONO "/FomeSedeSono/%s.ini"
- // News
- new checkareavip;
- new checkcluckinbell;
- new checkbar;
- new checkburger;
- new checkrestaurante;
- new checkrosquinha;
- new checkbar2;
- new checkpizzaria;
- new Text:TextoFome;
- new Text:TextoSede;
- new Text:TextoSono;
- new Text:TelaSono;
- new dormindo[MAX_PLAYERS];
- new file[256];
- new StatusOn[MAX_PLAYERS];
- new timerfome[MAX_PLAYERS];
- new timersede[MAX_PLAYERS];
- new timersono[MAX_PLAYERS];
- new Bar:BarraFome;
- new Bar:BarraSede;
- new Bar:BarraSono;
- // Forwards
- forward Fome(playerid);
- forward Sede(playerid);
- forward Sono(playerid);
- forward Acordar(playerid);
- // Publics
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(checknome == checkareavip || checknome == checkcluckinbell || checknome == checkbar || checknome == checkburger || checknome == checkbar2 || checknome == checkrosquinha || checknome == checkrestaurante || checknome == checkpizzaria){
- return mostrarcardapio(playerid);
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- // Checkpoints
- checkpizzaria = CPS_AddCheckpoint(375.7330,-119.7702,1001.4995, 1.0, 50);
- checkbar2 = CPS_AddCheckpoint(495.6680,-75.6510,998.7578, 1.0, 50);
- checkrosquinha = CPS_AddCheckpoint(379.2641,-190.3609,1000.6328, 1.0, 50);
- checkrestaurante = CPS_AddCheckpoint(450.3708,-83.8357,999.5547, 1.0, 50);
- checkareavip = CPS_AddCheckpoint(-787.9170,500.7348,1371.7422, 1.0, 50);
- checkcluckinbell = CPS_AddCheckpoint(369.6572,-6.2929,1001.8589, 1.0, 50);
- checkbar = CPS_AddCheckpoint(-224.8297,1401.8036,27.7656, 1.0, 50);
- checkburger = CPS_AddCheckpoint(376.5179,-68.2242,1001.5151, 1.0, 50);
- // Texto de sono
- TextoFome = TextDrawCreate(562.111083, 278.257659, "Fome");
- TextDrawBackgroundColor(TextoFome, 255);
- TextDrawFont(TextoFome, 2);
- TextDrawLetterSize(TextoFome, 0.310000, 1.100000);
- TextDrawColor(TextoFome, -1);
- TextDrawSetOutline(TextoFome, 1);
- TextDrawSetProportional(TextoFome, 1);
- /// Texto de sede
- TextoSede = TextDrawCreate(562.222290, 307.626708, "Sede");
- TextDrawBackgroundColor(TextoSede, 255);
- TextDrawFont(TextoSede, 2);
- TextDrawLetterSize(TextoSede, 0.320000, 1.100000);
- TextDrawColor(TextoSede, -1);
- TextDrawSetOutline(TextoSede, 1);
- TextDrawSetProportional(TextoSede, 1);
- /// Texto de sono
- TextoSono = TextDrawCreate(562.222290, 339.982208, "Sono");
- TextDrawBackgroundColor(TextoSono, 255);
- TextDrawFont(TextoSono, 2);
- TextDrawLetterSize(TextoSono, 0.320000, 1.100000);
- TextDrawColor(TextoSono, -1);
- TextDrawSetOutline(TextoSono, 1);
- TextDrawSetProportional(TextoSono, 1);
- /// Barrinhas fome/sede/sono
- BarraFome = CreateProgressBar(553.00, 300.00, 55.50, 3.20, -16776961, 100.0);
- SetProgressBarMaxValue(BarraFome, 100);
- BarraSede = CreateProgressBar(553.00, 331.00, 55.50, 3.20, 16711935, 100.0);
- SetProgressBarMaxValue(BarraSede, 100);
- BarraSono = CreateProgressBar(553.00, 362.00, 55.50, 3.20, 7777255, 100.0);
- SetProgressBarMaxValue(BarraSono, 100);
- // TextDraw tela preta do sono //
- TelaSono = TextDrawCreate(-30.000000, -5.000000, "TelaPreta");
- TextDrawBackgroundColor(TelaSono, 255);
- TextDrawFont(TelaSono, 1);
- TextDrawLetterSize(TelaSono, 0.700000, 53.099998);
- TextDrawColor(TelaSono, -1);
- TextDrawSetOutline(TelaSono, 0);
- TextDrawSetProportional(TelaSono, 1);
- TextDrawSetShadow(TelaSono, 1);
- TextDrawUseBox(TelaSono, 1);
- TextDrawBoxColor(TelaSono, 255);
- TextDrawTextSize(TelaSono, 650.000000, 30.000000);
- return 1;
- }
- public OnFilterScriptExit()
- {
- HideProgressBarForAll(BarraFome);
- HideProgressBarForAll(BarraSede);
- HideProgressBarForAll(BarraSono);
- TextDrawDestroy(TextoFome);
- TextDrawDestroy(TextoSede);
- TextDrawDestroy(TextoSono);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new aname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aname, sizeof(aname));
- format(file, sizeof(file), PASTA_FOMESEDESONO, aname);
- if(!dini_Exists(file)){
- dini_Create(file);
- dini_Set(file, "Sede", "0");
- dini_Set(file, "Fome", "0");
- dini_Set(file, "Sono", "0");
- dini_Set(file, "StatusOn", "0");
- }
- if(dini_Exists(file)){
- SetProgressBarValue(BarraFome, dini_Int(file, "Fome"));
- SetProgressBarValue(BarraSede, dini_Int(file, "Sede"));
- SetProgressBarValue(BarraSono, dini_Int(file, "Sono"));
- SetPVarInt(playerid,"Fome", dini_Int(file, "Fome"));
- SetPVarInt(playerid,"Sede", dini_Int(file, "Sede"));
- SetPVarInt(playerid,"Sono", dini_Int(file, "Sono"));
- ShowProgressBarForPlayer(playerid, BarraFome);
- ShowProgressBarForPlayer(playerid, BarraSede);
- ShowProgressBarForPlayer(playerid, BarraSono);
- UpdateProgressBar(BarraFome, playerid);
- UpdateProgressBar(BarraSede, playerid);
- UpdateProgressBar(BarraSono, playerid);
- dormindo[playerid] = 0;
- StatusOn[playerid] = dini_Int(file, "StatusOn");
- TextDrawShowForPlayer(playerid, TextoFome);
- TextDrawShowForPlayer(playerid, TextoSede);
- TextDrawShowForPlayer(playerid, TextoSono);
- if(StatusOn[playerid] == 0){
- timerfome[playerid] = SetTimerEx("Fome", 420000, true, "i", playerid);
- timersede[playerid] = SetTimerEx("Sede", 300000, true, "i", playerid);
- timersono[playerid] = SetTimerEx("Sono", 600000, true, "i", playerid);
- StatusOn[playerid] = 1;
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(GetPVarInt(playerid,"Fome") >= 95){
- SetProgressBarValue(BarraFome,-10);
- UpdateProgressBar(BarraFome,playerid);
- SetPVarInt(playerid,"Fome",-10);
- UpdateProgressBar(BarraSono,playerid);
- }
- if(GetPVarInt(playerid,"Sede") >= 95){
- SetProgressBarValue(BarraSede,-10);
- UpdateProgressBar(BarraSede,playerid);
- SetPVarInt(playerid,"Sede",-10);
- UpdateProgressBar(BarraSono,playerid);
- }
- return 1;
- }
- public Fome(playerid)
- {
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- if(GetPVarInt(playerid,"Fome") == 75)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-15.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante comer ou você irá morrer de fome!");
- }
- if(GetPVarInt(playerid,"Fome") == 80)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-20.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante comer ou você irá morrer de fome!");
- }
- if(GetPVarInt(playerid,"Fome") == 85)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-25.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante comer ou você irá morrer de fome!");
- }
- if(GetPVarInt(playerid,"Fome") == 90)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-20.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante comer ou você irá morrer de fome!");
- }
- if(GetPVarInt(playerid,"Fome") == 100)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-20.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante comer ou você irá morrer de fome!");
- }
- return 1;
- }
- public Sede(playerid)
- {
- SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")+5);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- if(GetPVarInt(playerid,"Sede") == 75)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-15.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante beber ou você irá morrer de sede!");
- }
- if(GetPVarInt(playerid,"Sede") == 80)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-20.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante beber ou você irá morrer de sede!");
- }
- if(GetPVarInt(playerid,"Sede") == 85)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-25.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante beber ou você irá morrer de sede!");
- }
- if(GetPVarInt(playerid,"Sede") == 90)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-20.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante beber ou você irá morrer de sede!");
- }
- if(GetPVarInt(playerid,"Sede") >= 100)
- {
- new Float:Vida;
- GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-25.0);
- SendClientMessage(playerid,-1,"{AA3333}| INFO | Vá até um restaurante beber ou você irá morrer de sede!");
- }
- return 1;
- }
- public Sono(playerid)
- {
- SetPVarInt(playerid,"Sono",GetPVarInt(playerid,"Sono")+5);
- SetProgressBarValue(BarraSono, GetPVarInt(playerid,"Sono"));
- UpdateProgressBar(BarraSono,playerid);
- if(GetPVarInt(playerid,"Sono") == 90){
- if(dormindo[playerid] == 0){
- SendClientMessage(playerid,-1,"{00BFFF}| INFO | Você está com sono, durma ou irá desmaiar!");
- }
- }
- if(GetPVarInt(playerid,"Sono") == 95){
- if(dormindo[playerid] == 0){
- SendClientMessage(playerid,-1,"{00BFFF}| INFO | Você está com sono, durma ou irá desmaiar!");
- }
- }
- if(GetPVarInt(playerid,"Sono") == 100)
- {
- if(dormindo[playerid] == 0){
- SendClientMessage(playerid,-1,"{00BFFF}| INFO | Você desmaiou de sono!");
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- TogglePlayerControllable(playerid,0);
- TextDrawShowForPlayer(playerid, TelaSono);
- SetTimerEx("Acordar", 60000, false, "i", playerid);
- dormindo[playerid] = 1;
- }
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == cardapio)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- mostrarcardapio(playerid);
- }
- case 1:
- {
- if(GetPVarInt(playerid,"Fome") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está comendo um X-Bacon!");
- GivePlayerMoney(playerid, -10);
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")-25);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- SetPlayerHealth(playerid,100);
- UpdateProgressBar(BarraFome,playerid);
- ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com fome!");
- SetPVarInt(playerid,"Fome",0);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- }
- }
- case 2:
- {
- if(GetPVarInt(playerid,"Fome") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está comendo um X-Tudo!");
- GivePlayerMoney(playerid, -26);
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")-25);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- SetPlayerHealth(playerid,100);
- UpdateProgressBar(BarraFome,playerid);
- ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com fome!");
- SetPVarInt(playerid,"Fome",0);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- }
- }
- case 3:
- {
- if(GetPVarInt(playerid,"Fome") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está comendo um X-Salada!");
- GivePlayerMoney(playerid, -12);
- SetPlayerHealth(playerid,100);
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")-25);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com fome!");
- SetPVarInt(playerid,"Fome",0);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- }
- }
- case 4:
- {
- if(GetPVarInt(playerid,"Fome") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está comendo uma Pizza de brocólis!");
- GivePlayerMoney(playerid, -35);
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")-25);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- SetPlayerHealth(playerid,100);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com fome!");
- SetPVarInt(playerid,"Fome",0);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- }
- }
- case 5:
- {
- if(GetPVarInt(playerid,"Fome") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está comendo uma Pizza de bauru!");
- GivePlayerMoney(playerid, -32);
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")-25);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- SetPlayerHealth(playerid,100);
- UpdateProgressBar(BarraFome,playerid);
- ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com fome!");
- SetPVarInt(playerid,"Fome",0);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- }
- }
- case 6:
- {
- if(GetPVarInt(playerid,"Fome") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está comendo uma Pizza 4 queijos!");
- GivePlayerMoney(playerid, -44);
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")-25);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- SetPlayerHealth(playerid,100);
- UpdateProgressBar(BarraFome,playerid);
- ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com fome!");
- SetPVarInt(playerid,"Fome",0);
- SetProgressBarValue(BarraFome, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(BarraFome,playerid);
- }
- }
- case 7:
- {
- mostrarcardapio(playerid);
- }
- case 8:
- {
- if(GetPVarInt(playerid,"Sede") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está bebendo uma Cola-Cola!");
- GivePlayerMoney(playerid, -6);
- SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")-25);
- SetPlayerHealth(playerid,100);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- ApplyAnimation(playerid,"BAR","dnk_stndM_loop ",3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com sede!");
- SetPVarInt(playerid,"Sede",0);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- }
- }
- case 9:
- {
- if(GetPVarInt(playerid,"Sede") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está bebendo uma Fanta!");
- GivePlayerMoney(playerid, -6);
- SetPlayerHealth(playerid,100);
- SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")-25);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- ApplyAnimation(playerid,"BAR","dnk_stndM_loop ",3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com sede!");
- SetPVarInt(playerid,"Sede",0);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- }
- }
- case 10:
- {
- if(GetPVarInt(playerid,"Sede") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está bebendo uma Sprite!");
- GivePlayerMoney(playerid, -4);
- SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")-25);
- SetPlayerHealth(playerid,100);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- ApplyAnimation(playerid,"BAR","dnk_stndM_loop ",3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com sede!");
- SetPVarInt(playerid,"Sede",0);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- }
- }
- case 11:
- {
- if(GetPVarInt(playerid,"Sede") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está bebendo um Guaraná Jesus!");
- GivePlayerMoney(playerid, -9);
- SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")-25);
- SetPlayerHealth(playerid,100);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- ApplyAnimation(playerid,"BAR","dnk_stndM_loop ",3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com sede!");
- SetPVarInt(playerid,"Sede",0);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- }
- }
- case 12:
- {
- if(GetPVarInt(playerid,"Sede") >= 1){
- SendClientMessage(playerid,0xFFFF00AA,"| INFO | Você está bebendo uma Pepsi!");
- GivePlayerMoney(playerid, -5);
- SetPVarInt(playerid,"Sede",GetPVarInt(playerid,"Sede")-25);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- SetPlayerHealth(playerid,100);
- UpdateProgressBar(BarraSede,playerid);
- ApplyAnimation(playerid,"BAR","dnk_stndM_loop ",3.0, 0, 0, 0, 0, 0);
- mostrarcardapio(playerid);
- }else{
- SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com sede!");
- SetPVarInt(playerid,"Sede",0);
- SetProgressBarValue(BarraSede, GetPVarInt(playerid,"Sede"));
- UpdateProgressBar(BarraSede,playerid);
- }
- }
- }
- }
- }
- return 0;
- }
- public OnPlayerDisconnect(playerid)
- {
- new aname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aname, sizeof(aname));
- new conta [ 256 ];
- format(conta, sizeof(conta), PASTA_FOMESEDESONO, aname);
- StatusOn[playerid] = 0;
- dini_IntSet(conta,"Fome", GetPVarInt(playerid,"Fome"));
- dini_IntSet(conta,"Sede", GetPVarInt(playerid,"Sede"));
- dini_IntSet(conta,"Sono", GetPVarInt(playerid,"Sono"));
- dini_IntSet(conta,"StatusOn", 0);
- KillTimer(timerfome[playerid]);
- KillTimer(timersede[playerid]);
- KillTimer(timersono[playerid]);
- return 1;
- }
- CMD:dormir(playerid,params[])
- {
- if(GetPVarInt(playerid,"Sono") >= 85){
- if(dormindo[playerid] == 0){
- SendClientMessage(playerid,-1,"{00BFFF}| SONO | Dormindo...");
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- TogglePlayerControllable(playerid,0);
- TextDrawShowForPlayer(playerid, TelaSono);
- dormindo[playerid] = 1;
- SetTimerEx("Acordar", 60000, false, "i", playerid);
- GameTextForPlayer(playerid, "~b~Dormindo..." , 60000, 4);
- }else SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você já está dormindo");
- }else SendClientMessage(playerid,-1,"{FF0000}| ERRO | Você não está com sono");
- return 1;
- }
- stock mostrarcardapio(playerid)
- {
- new string[1700];
- strcat(string, "{FF0000} {FF0000} Alimento\tPreço\n"); // 0
- strcat(string, "{FF0000} {FF0000} Comidas\n"); // 0
- strcat(string, "{FF0000}-{FFFFFF} X-Bacon\t{0088FF}R$10,00\n"); // 1
- strcat(string, "{FF0000}-{FFFFFF} X-Tudo\t{0088FF}R$26,00\n"); // 2
- strcat(string, "{FF0000}-{FFFFFF} X-Salada\t{0088FF}R$12,00 \n"); // 3
- strcat(string, "{FF0000}-{FFFFFF} Pizza de brócolis\t{0088FF}R$35,00 \n"); // 4
- strcat(string, "{FF0000}-{FFFFFF} Pizza de bauru\t{0088FF}R$32,00\n"); // 5
- strcat(string, "{FF0000}-{FFFFFF} Pizza 4 queijos\t{0088FF}R$44,00 \n"); // 6
- strcat(string, "{FF0000}-{FF0000} Bebidas\n");// 7
- strcat(string, "{FF0000}-{FFFFFF} Coca-Cola\t{0088FF}R$06,00 \n");// 8
- strcat(string, "{FF0000}-{FFFFFF} Fanta\t{0088FF}R$06,00 \n");// 9
- strcat(string, "{FF0000}-{FFFFFF} Sprite\t{0088FF}R$04,00 \n");// 10
- strcat(string, "{FF0000}-{FFFFFF} Guaraná Jesus\t{0088FF}R$09,00 \n");// 11
- strcat(string, "{FF0000}-{FFFFFF} Pepsi\t{0088FF}R$05,00\n");// 12
- ShowPlayerDialog(playerid, cardapio, DIALOG_STYLE_TABLIST_HEADERS, "Cardápio", string, "Comprar", "Sair");
- return 1;
- }
- public Acordar(playerid)
- {
- TextDrawHideForPlayer(playerid, TelaSono);
- SendClientMessage(playerid,-1,"{00BFFF}| INFO | Você acordou!");
- dormindo[playerid] = 0;
- SetPVarInt(playerid,"Sono",GetPVarInt(playerid,"Sono")-100);
- SetProgressBarValue(BarraSono, GetPVarInt(playerid,"Sono"));
- UpdateProgressBar(BarraSono,playerid);
- TogglePlayerControllable(playerid,1);
- GameTextForPlayer(playerid, "~r~Acordado!" , 3000, 4);
- ClearAnimations(playerid);
- }
- //By GuiLopez_ - Fórum SA-MP
Advertisement
Add Comment
Please, Sign In to add comment