[Pomoc] Komanda /kupi

Započeo ceLL_, Septembar 25, 2010, 13:37:37 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

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...
Poslednja Izmena: Septembar 27, 2010, 17:17:49 POSLE PODNE od matteokov