konamda /drink

Započeo | MARKO |, April 28, 2010, 10:48:56 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

bi mi mogao netko napisati komandu /drink  ??  u MTA sam uredio burg, pa bi stavio tu komandu tamo.
molim vasss

UNAPRIJED HVALA.
Poslednja Izmena: April 28, 2010, 10:56:13 PRE PODNE od filip_pnv



if(strcmp(cmd, "/drink", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
            if(PlayerToPoint(3.0, playerid,-1965.8351,114.3379,27.6875)) // ovo zamijeni sa svojim kordinatama
{
               new Float:health;
   SendClientMessage(playerid, COLOR_LIGHTBLUE, "   Soda Kupljena, kosta 4$");
   GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, sizeof(string), "* %s uzima casu i pije sodu.", sendername);
   ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
   GivePlayerCash(playerid, -4);
   GetPlayerHealth(playerid, health);
   SetPlayerHealth(playerid, health+10);
   return 1;
}
        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 Pica __________________|");
SendClientMessage(playerid, COLOR_WHITE, "HINT: /drink [drinkname]");
  SendClientMessage(playerid, COLOR_GREY, "Available names: Pivo ($6), Vodka ($10), Viski ($10), Voda ($2), Soda($2)");
SendClientMessage(playerid, COLOR_WHITE, "|________________________________________________|");
return 1;
}
    if(strcmp(x_nr,"Pivo",true) == 0)
{
    GivePlayerCash(playerid, - 6);
    PlayerDrunk[playerid] += 1;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Vi ste~n~~p~Pijani", 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,"vodka",true) == 0)
{
    GivePlayerCash(playerid, - 10);
    PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Vi ste~n~~p~Pijani", 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)
{
    GivePlayerCash(playerid, - 10);
    PlayerDrunk[playerid] += 3;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Vi ste ~n~~p~Pijani", 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)
{
    GivePlayerCash(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,"soda",true) == 0)
{
    GivePlayerCash(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: Neznam to pice.");
    return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s pije %s.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Nemozete vise piti, povracati cete !");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste u Baru !");
            return 1;
        }
    }
    return 1;
}



Evo   :D :D

nastoe

Moras nam dati kordinate gdje se samo moze koristiti komanda /drink

e puno hvala. 

samo mi recite molim vas zasto mi izbaci ovih 6 errora. i jedo upozorenje.
gdje trebam jos ubactiti to GIVEPLAYERCASH da bi mi radilo

C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(12463) : error 017: undefined symbol "GivePlayerCash"
C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(12484) : error 017: undefined symbol "GivePlayerCash"
C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(12495) : error 017: undefined symbol "GivePlayerCash"
C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(12506) : error 017: undefined symbol "GivePlayerCash"
C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(12517) : error 017: undefined symbol "GivePlayerCash"
C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(12526) : error 017: undefined symbol "GivePlayerCash"
C:\Users\FILIP\Desktop\GTARP\GTARP\GTARP\gamemodes\gtarp.pwn(44787) : warning 203: symbol is never used: "giveplayercash"
Poslednja Izmena: April 28, 2010, 11:14:31 PRE PODNE od filip_pnv

virtuozo

Umjesto GivePlayerCash stavi GivePlayerMoney