[Pomoc] FastFood

Započeo Petrevski
28. Jan. 2016. Zaključano
473
pregleda
10
postova
Petrevski
2
Rookie
28. Jan. 2016.
Skripta koju koristim: moja
Detaljan opis problema😛a nez kako stavit na primer ako je igracu health full da se ne moze koristit fastfood menu, da pise "Niste gladni" i tako nes...
Dio skripte: http://pastebin.com/FxPMcCKa
Neke slike/video za lakse dobivanje pomoci(neobavezno)://
Nitro
5
Godfather
28. Jan. 2016.
Stavis samo proveru kada kuca komandu ako mu je heatlh na 100 da ne moze koristiti komandu.Samo nadji koju varijablu koristis za health verovatno pHealth .
Rax_King
5
Godfather
28. Jan. 2016.
Maxwellâ„¢ wrote on January 28, 2016, 9:18 pm:
Stavis samo proveru kada kuca komandu ako mu je heatlh na 100 da ne moze koristiti komandu.Samo nadji koju varijablu koristis za health verovatno pHealth .


Zasto bi koristio varijablu za health lol

Napravis ovako
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) /*Ako je helt 100*/ return 0 /*ne dogadja se nista*/; // ili return SendClientMessage ili sta vec koristis :)
Petrevski
2
Rookie
28. Jan. 2016.
sa_!XundeR wrote on January 28, 2016, 9:18 pm:
Stavis samo proveru kada kuca komandu ako mu je heatlh na 100 da ne moze koristiti komandu.Samo nadji koju varijablu koristis za health verovatno pHealth .


Zasto bi koristio varijablu za health lol

Napravis ovako
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) /*Ako je helt 100*/ return 0 /*ne dogadja se nista*/; // ili return SendClientMessage ili sta vec koristis :)


Mozes mi to nekako spojit sa ovim http://pastebin.com/FxPMcCKa pls ^_^
STREETBOY
5
Kingpin
28. Jan. 2016.
Izvoli..
//====================================================fastfood jadenje====
if(dialogid == FASTFOODJADENJE)
    {
        if(response)
        {
            if(listitem == 0) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete pomfrit ! ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+20);
                GivePlayerMoney(playerid, -20);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s Jadete kromid.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 1) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete tost !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+25);
                GivePlayerMoney(playerid, -25);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade peceno pile.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 2) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete hotdog !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+30);
                GivePlayerMoney(playerid, -30);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade peceni kompiri.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 3) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete cheese burger !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+35);
                GivePlayerMoney(playerid, -40);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade sopska salata.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 4) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete hamburger !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+40);
                GivePlayerMoney(playerid, -50);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade tost.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
        }
    }
Petrevski
2
Rookie
29. Jan. 2016.
Streetboy wrote on January 28, 2016, 10:46 pm:
Izvoli..
//====================================================fastfood jadenje====
if(dialogid == FASTFOODJADENJE)
    {
        if(response)
        {
            if(listitem == 0) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete pomfrit ! ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+20);
                GivePlayerMoney(playerid, -20);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s Jadete kromid.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 1) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete tost !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+25);
                GivePlayerMoney(playerid, -25);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade peceno pile.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 2) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete hotdog !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+30);
                GivePlayerMoney(playerid, -30);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade peceni kompiri.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 3) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete cheese burger !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+35);
                GivePlayerMoney(playerid, -40);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade sopska salata.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 4) //
            {
new Float:Health;
if(GetPlayerHealth(playerid, Health) == 100) return SendClientMessage(playerid, COLOR_GREEN, "Ne mozete jesti,vec ste siti.");
                SendClientMessage(playerid, COLOR_GREEN, "Jadete hamburger !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+40);
                GivePlayerMoney(playerid, -50);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade tost.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
        }
    }

ne radi... takodze izlazi ovaj warrning warning 219: local variable "Health" shadows a variable at a preceding level
Rax_King
5
Godfather
29. Jan. 2016.
pardon, ja sam masio GPH stora helt u neku varijablu u ovom primjeru Health
pa ide
new Float:Health;
GetPlayerHealth(playerid, Health);
if(Health >= 99) return SendClientMessage(playerid, -1, "Ne mozete jesti, vec ste siti.");


Malo citaj wiki https://wiki.sa-mp.com/wiki/GetPlayerHealth

A da povezes ides jednostavno

//====================================================fastfood jadenje====
if(dialogid == FASTFOODJADENJE)
    {
        if(response)
        {
new Float:playerhelt;
GetPlayerHealth(playerid, playerhelt);
if(playerhelt >= 99) return SendClientMessage(playerid, -1, "Ne mozete jesti, vec ste siti.");
            if(listitem == 0) //
            {
                SendClientMessage(playerid, COLOR_GREEN, "Jadete pomfrit ! ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+20);
                GivePlayerMoney(playerid, -20);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s Jadete kromid.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 1) //
            {
                SendClientMessage(playerid, COLOR_GREEN, "Jadete tost !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+25);
                GivePlayerMoney(playerid, -25);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade peceno pile.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 2) //
            {
                SendClientMessage(playerid, COLOR_GREEN, "Jadete hotdog !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+30);
                GivePlayerMoney(playerid, -30);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade peceni kompiri.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 3) //
            {
                SendClientMessage(playerid, COLOR_GREEN, "Jadete cheese burger !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+35);
                GivePlayerMoney(playerid, -40);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade sopska salata.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
            if(listitem == 4) //
            {
                SendClientMessage(playerid, COLOR_GREEN, "Jadete hamburger !  ");
                new Float:health;
                GetPlayerHealth(playerid, health);
                SetPlayerHealth(playerid, health+40);
                GivePlayerMoney(playerid, -50);
                ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,0,0,0,0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "%s jade tost.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                //SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 100.0, 5000);
            }
        }
    }
Petrevski
2
Rookie
29. Jan. 2016.
Ok je hvala, moze lock.
STREETBOY
5
Kingpin
29. Jan. 2016.
@sa_!XundeR  Ma idi bre,prejeba me,ja mu samo prilijepio ovo sto si ti stavio nisam provjeravao kod 😄
Rax_King
5
Godfather
30. Jan. 2016.
Streetboy wrote on January 29, 2016, 10:54 pm:
@sa_!XundeR  Ma idi bre,prejeba me,ja mu samo prilijepio ovo sto si ti stavio nisam provjeravao kod 😄


Lol sta cu kad sam glup ☹️

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha