Ovako: Moze mi neko napraviti komandu /kupi u dialogu sa sledecim: Pivo,Coca Cola,Vodka,Vino,Pepsi...
Molim nekog da mi napravi ovo!! PLS Vi lupite tamo neke kordinate a ja cu staviti moje korde...
nadji tut za dialoge i onda skontaj malo kako se pravi ovo je previse lako napraviti
new kafana;
if(strcmp(cmd, "/kupi", true) == 0)
{
if(PlayerToPoint(10.0,playerid,376.6681,-67.4362,1001.5078))
{
ShowPlayerDialog(playerid, kafana, DIALOG_STYLE_LIST, "Kafana", "CocaCola\nPivo\nStock ", "U redu", "Odustani");// dodaj sebi koliko hoces jos :)
}
return 1;
}
pa onda ovo dodajes
if(dialogid == kafana)
{
if(response)
{
new Float:health;
if(listitem == 0)
{
GivePlayerMoney(playerid, - 50);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije CocaColu.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(listitem == 1)
{
GivePlayerMoney(playerid, - 60);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Pivo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(listitem == 2)
{
GivePlayerMoney(playerid, - 40);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Stock.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}
Ovo sam sad nabrzinu pisao..pa ako ima neka greska..vjerovatno je u zagradi... pogledaj samo ,da li sam sve zagrade zatvorio...
if(dialogid == kafana)
{
if(response)
{
new Float:health;
if(listitem == 0)
{
GivePlayerMoney(playerid, - 50);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije CocaColu.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(listitem == 1)
{
GivePlayerMoney(playerid, - 60);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Pivo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(listitem == 2)
{
GivePlayerMoney(playerid, - 40);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Stock.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}
Ovo dodam pod OnDialogResponse?
Ovako:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == kafana)
{
if(response)
{
new Float:health;
if(listitem == 0)
{
GivePlayerMoney(playerid, - 50);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije CocaColu.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(listitem == 1)
{
GivePlayerMoney(playerid, - 60);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Pivo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(listitem == 2)
{
GivePlayerMoney(playerid, - 40);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Stock.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}
aha..samo pazi na zagrade..ja bas nisam pazio :D..
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10133) : error 017: undefined symbol "Caffe"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10133) : error 017: undefined symbol "bar"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10133) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10133) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Pomagaj... xD :P
jel ti nista nemozes sam?
reci koji ti je koji red sta ti je u redu 10133
ajde postaj taj red gdje su ti errori..da vidim
evo ga
if(dialogid == Caffe bar)
umjesto onog mog
new kafana; stavi ovako ----------------new CaffeBar;
i umjesto ovog if(dialogid == Caffe bar) stavi ---------if(dialogid == CaffeBar)
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10133) : error 017: undefined symbol "CaffeBar"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10142) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10142) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10142) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10142) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
Uradio sve tako kako kazes! I opet mi se pojavi ovih 5 errora! :(
Evo linije:
10133: if(dialogid == CaffeBar)
10142: GetPlayerName(playerid, sendername, sizeof(sendername));
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new sendername[MAX_PLAYER_NAME];
jel imas ovo new sendername?? ako nemas to dodaj....
Ubicu se :'(
Dodao sam new sendername[MAX_PLAYER_NAME];
I sad mi izbacuje ovih 5errora :o
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10134) : error 017: undefined symbol "CaffeBar"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10144) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10144) : error 017: undefined symbol "string"
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10144) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\GAMEMOD\Server MoD 1.1 KOJI RADI\Server MoD 1.1\gamemodes\mod.pwn(10144) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
Ne mogu da verujemmmmm!!!!! :-[
cek ti drzis server a ne znas tako jednostavnje probleme resit omg
new string[128];
evo ti kod radi sta oces..mogli ste mu jednostavno poslati ovo iz .pwn jbt
if(strcmp(cmd, "/drink", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtBar(playerid))
{
if(PlayerDrunk[playerid] < 10)
{
new Float:health;
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Bar Drinks __________________|");
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drink [drinkname]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Pivo ($6), Votka ($10), Viski ($10), Voda ($2), Sok($2)");
SendClientMessage(playerid, COLOR_WHITE, "|________________________________________________|");
return 1;
}
if(strcmp(x_nr,"pivo",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 16)
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemas 16 godina.");
return 1;
}
GivePlayerMoney(playerid, - 6);
PlayerDrunk[playerid] += 1;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Ti si~n~~p~pijan", 3500, 1); }
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 15; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 15.0); }
}
}
else if(strcmp(x_nr,"votka",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemas 16 godina.");
return 1;
}
GivePlayerMoney(playerid, - 10);
PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Ti si~n~~p~pijan", 3500, 1); }
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 25; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 25.0); }
}
}
else if(strcmp(x_nr,"viski",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemas 16 godina.");
return 1;
}
GivePlayerMoney(playerid, - 10);
PlayerDrunk[playerid] += 3;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Ti si~n~~p~pijan", 3500, 1); }
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 27; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 27.0); }
}
}
else if(strcmp(x_nr,"voda",true) == 0)
{
GivePlayerMoney(playerid, - 2);
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 5.0); }
}
}
else if(strcmp(x_nr,"sok",true) == 0)
{
GivePlayerMoney(playerid, - 2);
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 5.0); }
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemamo to pice.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s drinks a %s.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ne osjecas se dobro i ne mozes vise piti !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi kod bara !");
return 1;
}
}
return 1;
}
Imam i ja problem s dialogom isto s picima, evo jedan jedini error me zeza:
C:\Users\Matteo\Desktop\CRO Extreme\gamemodes\extremeserver.pwn(530) : error 017: undefined symbol "PlayerToPoint"
Linija:
if(PlayerToPoint(5.0,playerid,362.4298,173.5758,1008.3828))
Citat: Sub Zero poslato Septembar 25, 2010, 17:11:06 POSLE PODNE
evo ti kod radi sta oces..mogli ste mu jednostavno poslati ovo iz .pwn jbt
if(strcmp(cmd, "/drink", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtBar(playerid))
{
if(PlayerDrunk[playerid] < 10)
{
new Float:health;
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Bar Drinks __________________|");
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drink [drinkname]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Pivo ($6), Votka ($10), Viski ($10), Voda ($2), Sok($2)");
SendClientMessage(playerid, COLOR_WHITE, "|________________________________________________|");
return 1;
}
if(strcmp(x_nr,"pivo",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 16)
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemas 16 godina.");
return 1;
}
GivePlayerMoney(playerid, - 6);
PlayerDrunk[playerid] += 1;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Ti si~n~~p~pijan", 3500, 1); }
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 15; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 15.0); }
}
}
else if(strcmp(x_nr,"votka",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemas 16 godina.");
return 1;
}
GivePlayerMoney(playerid, - 10);
PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Ti si~n~~p~pijan", 3500, 1); }
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 25; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 25.0); }
}
}
else if(strcmp(x_nr,"viski",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemas 16 godina.");
return 1;
}
GivePlayerMoney(playerid, - 10);
PlayerDrunk[playerid] += 3;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Ti si~n~~p~pijan", 3500, 1); }
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 27; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 27.0); }
}
}
else if(strcmp(x_nr,"voda",true) == 0)
{
GivePlayerMoney(playerid, - 2);
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 5.0); }
}
}
else if(strcmp(x_nr,"sok",true) == 0)
{
GivePlayerMoney(playerid, - 2);
if(GetPlayerHealth(playerid, health) < 100)
{
if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 5.0); }
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "KONOBAR:Nemamo to pice.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s drinks a %s.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ne osjecas se dobro i ne mozes vise piti !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi kod bara !");
return 1;
}
}
return 1;
}
pa da mogao sam mu to..ali on vjerovatno hoce dialog..to je vec zastarilo :D
pa zar nije isto sa dijalogom i ovako....imas tutorial kako napraviti dialog i samo dodajes ovo....malo truda :-* :-*
pa da zna napraviti u dialogu,mislis da bi trazio??? al opet..kako hoce on :D
ovako imam dialog za kupnju pizza... kako da stavim da dialog radi samo na odredenom mjestu trenutno imam ovako:
if(PlayerToPoint(5.0,playerid,-1981.1304,883.8078,45.2031))
i mogu bilegdje napisat /kupipizzu i dialog se pojavi... Molim vas pomagajte, kako da sredim da se pojavljuje samo na odredenom mjestu?
posalji mi tu komandu /kupipizzu da vidim i da kazm gdje sta da stavis
if (strcmp("/kupipizzu", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(5.0,playerid,-1981.1304,883.8078,45.2031))
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Pizzerija Matteo", "Slavonska pizza" "\nMjesana pizza", "U redu", "Odustani");
}
return 1;
}
Evo
if(strcmp(cmd, "/kupipizzu", true) == 0)
{
if(PlayerToPoint(10.0,playerid,-1981.1304,883.8078,45.2031))
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Pizzerija Matteo", "Slavonska pizza \nMjesana pizza ", "U redu", "Odustani");
}
return 1;
}
ovakobi ti trebalo radit,ne znam kako je moguce da mozes bilo gdje
Umjesto If(PlazerToPoint pokusaj ubaciti If(PlayerInRangeOfPoint
Sta znaci ovo:
C:\Users\Matteo\Desktop\CRO Extreme\gamemodes\extremeserver.pwn(552) : warning 206: redundant test: constant expression is non-zero
to mi se pojavi za onaj red di je PlayerToPoint,a imam na vrhu #define PlayerToPoint zna li ko kako da ispravim ovo...