Započeo Petrevski
•28. Jan. 2016.• Zaključano[Pomoc] FastFood
494
pregleda
10
postova
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)://
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)://
Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
1,858
Postovi:
63
Teme:
Pridružio se:Jun 2012
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 .
Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
9 / 250 XP
Početnik(1)
2,044
Postovi:
55
Teme:
Pridružio se:Sep. 2013
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 :)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 ^_^
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
1,332
Postovi:
71
Teme:
Pridružio se:Jun 2012
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);
}
}
}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
Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
9 / 250 XP
Početnik(1)
2,044
Postovi:
55
Teme:
Pridružio se:Sep. 2013
29. Jan. 2016.
pardon, ja sam masio GPH stora helt u neku varijablu u ovom primjeru Health
pa ide
Malo citaj wiki https://wiki.sa-mp.com/wiki/GetPlayerHealth
A da povezes ides jednostavno
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);
}
}
}Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
9 / 250 XP
Početnik(1)
2,044
Postovi:
55
Teme:
Pridružio se:Sep. 2013
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