[Pomoc] /drink

Započeo zubic, Februar 13, 2011, 13:12:27 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:svoju vlastitu
Detaljan opis problema:Vako trazio sam negde da nadjem komandu drink ali nigde nisam nasao ukucavao sam i na trazilicu pa ako neko moze da mi da.
Dio skripte:/
Neke slike/video za lakse dobivanje pomoci(neobavezno):/

ovo ti je default komanda iz gtarp moda:


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, "Non-Alcoholic: Water ($1), Sprunk($2)");
  SendClientMessage(playerid, COLOR_GREY, "Cheap Booze: Pissh ($6), Bourbon($8), Champagne($12)");
  SendClientMessage(playerid, COLOR_GREY, "Expensive Drinks: Vodka ($16), Cristal($20)");
  SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Warning! Excessive Drinking Causes Liver Damage");
SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________________|");
return 1;
}
    if(strcmp(x_nr,"pissh",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 16)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 16 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 6);
    PlayerDrunk[playerid] += 1;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 10; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 10.0); }
}
}
else if(strcmp(x_nr,"bourbon",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 8);
    PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(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,"champagne",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 12);
    PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 20; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 20.0); }
}
}
                    else if(strcmp(x_nr,"vodka",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 16);
    PlayerDrunk[playerid] += 3;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(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,"cristal",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 20);
    PlayerDrunk[playerid] += 4;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 40; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 40.0); }
}
}
else if(strcmp(x_nr,"water",true) == 0)
{
    SafeGivePlayerMoney(playerid, - 1);
GetPlayerHealth(playerid, health);
    if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 50.0); }
}
else if(health > 100)
{
    SetPlayerHealth(playerid, 100);
}
}
else if(strcmp(x_nr,"sprunk",true) == 0)
{
    SafeGivePlayerMoney(playerid, - 2);
GetPlayerHealth(playerid, health);
    if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 50.0); }
}
else if(health > 100)
{
    SetPlayerHealth(playerid, 100);
}
}
else
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: I don't know that Drink Name.");
    return 1;
}
GetPlayerHealth(playerid, health);
if (health > 100) SetPlayerHealth(playerid, 100);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s drinks some %s from the bottle.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You can't drink anymore, you will throw up!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not at a Bar!");
            return 1;
        }
    }
    return 1;
}



poznaticovik

Citat: [BU] Gigi_Falcone poslato Februar 13, 2011, 23:11:37 POSLE PODNE
ovo ti je default komanda iz gtarp moda:


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, "Non-Alcoholic: Water ($1), Sprunk($2)");
  SendClientMessage(playerid, COLOR_GREY, "Cheap Booze: Pissh ($6), Bourbon($8), Champagne($12)");
  SendClientMessage(playerid, COLOR_GREY, "Expensive Drinks: Vodka ($16), Cristal($20)");
  SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Warning! Excessive Drinking Causes Liver Damage");
SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________________|");
return 1;
}
    if(strcmp(x_nr,"pissh",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 16)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 16 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 6);
    PlayerDrunk[playerid] += 1;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 10; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 10.0); }
}
}
else if(strcmp(x_nr,"bourbon",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 8);
    PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(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,"champagne",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 12);
    PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 20; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 20.0); }
}
}
                    else if(strcmp(x_nr,"vodka",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 16);
    PlayerDrunk[playerid] += 3;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(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,"cristal",true) == 0)
{
    if(PlayerInfo[playerid][pAge] < 18)
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
    return 1;
}
    SafeGivePlayerMoney(playerid, - 20);
    PlayerDrunk[playerid] += 4;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }
GetPlayerHealth(playerid, health);
if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 40; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 40.0); }
}
}
else if(strcmp(x_nr,"water",true) == 0)
{
    SafeGivePlayerMoney(playerid, - 1);
GetPlayerHealth(playerid, health);
    if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 50.0); }
}
else if(health > 100)
{
    SetPlayerHealth(playerid, 100);
}
}
else if(strcmp(x_nr,"sprunk",true) == 0)
{
    SafeGivePlayerMoney(playerid, - 2);
GetPlayerHealth(playerid, health);
    if(health < 100)
{
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
else { SetPlayerHealth(playerid, health + 50.0); }
}
else if(health > 100)
{
    SetPlayerHealth(playerid, 100);
}
}
else
{
    SendClientMessage(playerid, COLOR_WHITE, "Bartender: I don't know that Drink Name.");
    return 1;
}
GetPlayerHealth(playerid, health);
if (health > 100) SetPlayerHealth(playerid, 100);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s drinks some %s from the bottle.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You can't drink anymore, you will throw up!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not at a Bar!");
            return 1;
        }
    }
    return 1;
}


Da , ali bi bilo bolje i jednostavnije da je u Dialogu

on je trazio default komandu, a sad je na njemu da je sredi kako zeli da mu bude, dal u dialogu ili ne  ;)



#define CRVENA 0xAA3333AA
#define LJUBICASTA 0xC2A2DAAA


CMD:pica(playerid, params[])
{
if(!ZaSankom(playerid)) return SendClientMessage(playerid, CRVENA, "Nisi za sankom!");
ShowPlayerDialog(playerid, 32, DIALOG_STYLE_LIST, "Lista pica", "Bezalkoholna Pica \nAlkoholna pica", "U redu", "Odustani");
return 1;
}


ili ako koristis strcmp

if(strcmp(cmd, "/pica", true) == 0)
{
if(!ZaSankom(playerid)) return SendClientMessage(playerid, CRVENA, "Nisi za sankom!");
ShowPlayerDialog(playerid, 32, DIALOG_STYLE_LIST, "Lista pica", "Bezalkoholna Pica \nAlkoholna pica", "U redu", "Odustani");
return 1;
}


OnDialogResponse

if(dialogid == 32)
{
if(response)
{
  if(listitem == 0)
{
ShowPlayerDialog(playerid, 33, DIALOG_STYLE_LIST, "PICA", "Voda \nKisela voda \nLaVita \nFanta \nPepsi \nCocaCola", "U redu", "Odustani");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 34, DIALOG_STYLE_LIST, "ALKOHOLNA PICA", "Lav Pivo \nJelen Pivo \nPinja Kolada \nSangrija \nPelinkovac \nVotka \nVinjak \nDzin \nMartini \nTekila \nVino \nRakija", "U redu", "Odustani");
}
return 1;
       }
   }


if(dialogid == 33)
{
if(response)
{
           new Float:pheal; GetPlayerHealth(playerid, pheal);
  if(listitem == 0)
{
JB_GivePlayerMoney(playerid, - 5);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerHealth(playerid, pheal+30);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Vodu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 1)
{
JB_GivePlayerMoney(playerid, - 5);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerHealth(playerid, pheal+30);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Kiselu vodu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 2)
{
JB_GivePlayerMoney(playerid, - 6);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerHealth(playerid, pheal+30);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije LaVitu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 3)
{
JB_GivePlayerMoney(playerid, - 7);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerHealth(playerid, pheal+30);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Fantu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 4)
{
JB_GivePlayerMoney(playerid, - 8);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerHealth(playerid, pheal+30);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Pepsi.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 5)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerHealth(playerid, pheal+30);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije CocaColu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
}
return 1;
}


if(dialogid == 34)
{
if(response)
{
           new Float:pheal; GetPlayerHealth(playerid, pheal);
  if(listitem == 0)
{
JB_GivePlayerMoney(playerid, - 5);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Lav Pivo.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 1)
{
JB_GivePlayerMoney(playerid, - 5);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Jelen Pivo.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 2)
{
JB_GivePlayerMoney(playerid, - 6);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Pinja Koladu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 3)
{
JB_GivePlayerMoney(playerid, - 7);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Sangriju.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 4)
{
JB_GivePlayerMoney(playerid, - 8);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Pelinkovac.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 5)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Vodku.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 6)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Vinjak.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 7)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Dzin.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 8)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Martini.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 9)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Tekilu.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 10)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Vino.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
if(listitem == 11)
{
JB_GivePlayerMoney(playerid, - 10);
               SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, pheal+8);
               GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije Rakiju.", sendername);
ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
}
}
return 1;
}


Sada da napravimo public ZaSankom (gde igrac mora biti da bi kucao tu komandu)

forward ZaSankom(playerid);
public ZaSankom(playerid)
{
   if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(50.0,playerid,1199.2426,-911.9024,48.0625)) //1
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1188.8829,-897.3304,48.0625)) //2
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1190.4003,-907.6694,52.4764)) //3
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1180.8784,-912.3026,50.3143)) //4
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1197.1107,-970.6483,50.6628)) //5
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1290.6133,-1343.8955,18.8606)) //6
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1374.8914,-1040.0184,34.6846)) //7
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,1293.2112,-1310.4132,18.8606)) //8
{
   return 1;
}
else if(PlayerToPoint(50.0,playerid,-786.9373,500.8163,1371.7422)) //9
{
   return 1;
}
}
return 0;
}


To sam ja stavio moje kordinate,to ti sam izmeni gde tebi treba.
Poslednja Izmena: Februar 13, 2011, 23:21:14 POSLE PODNE od joXy