[Pomoc] oko drink

Započeo El Toni, Maj 24, 2011, 14:12:14 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:
Detaljan opis problema:

DogaÄ'aj: OnPlayerCommandText


if(strcmp(cmd, "/drink", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(IsAtBar(playerid))
        {
      if(GetPlayerDrunkLevel(playerid) <= 30000)
            {
new list[] = "Voda $1\nCoca-Cola $4\nPivo $5\nVino $8";
    ShowPlayerDialog(playerid, 150,DIALOG_STYLE_LIST,"Izaberite pice",list,"Izaberi","Izadji");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Ne mozete vise piti");
}
}
}
return 1;
}



DogaÄ'aj: OnDialogResponse



if(dialogid == 150)
{
    if(response)
    {
        new Float:health;
        format(string, sizeof(string), "* %s pije neko pice.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        if(listitem == 0)
        {
    SafeGivePlayerMoney(playerid, - 1);
GetPlayerHealth(playerid, health);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerDrunkLevel(playerid, -1000)
    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);
}
        }
if(listitem == 1)
        {
    SafeGivePlayerMoney(playerid, - 4);
GetPlayerHealth(playerid, health);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerDrunkLevel(playerid, -1000)
    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);
}
        }
if(listitem == 2)
        {
            if(PlayerInfo[playerid][pAge] < 16)
{
    SendClientMessage(playerid, COLOR_WHITE, "Nemate 16 godina");
    return 1;
}
SafeGivePlayerMoney(playerid, - 5);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
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); }
}
        }
if(listitem == 3)
        {
            if(PlayerInfo[playerid][pAge] < 16)
{
    SendClientMessage(playerid, COLOR_WHITE, "Nemate 16 godina");
    return 1;
}
SafeGivePlayerMoney(playerid, - 8);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
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); }
}
        }
}
}


Dio skripte: evo gore mi je objasneno de da stavim taj code a tu nema mozete mi rec de da stavim ovo dolje dek ? pr. gore je OnPlayerComands....a ovo dole de da stavim i jel je tocno ovo? hvala puno

if(!IsPlayerInRangeOfPoint(playerid, radius, x, y,z))
{
        SendClientMessage(playerid, COLOR_GRAD2, "Niste na odredjenom mestu");
        return 1;
}



Napr. ja sam koristio IsAtBar(playerid). Da to uradiš, gore staviš:

forward UBurgu(playerid);


i napr. na kraj skripte:

public UBurgu(playerid)
{
     if(IsPlayerInRangeOfPoint(playerid, rad, x, y, z) || IsPlayerInRangeOfPoint(playerid, rad, x, y, z) || IsPlayerInRangeOfPoint(playerid, rad, x, y, z))
    {
         return1;
    }
}

Ja tebe nista ne razumijem ?
Sta ti zelis tj. sta neznas di da stavis ?

Citat: $--L84S--$ poslato Maj 24, 2011, 14:32:08 POSLE PODNE
Ja tebe nista ne razumijem ?
Sta ti zelis tj. sta neznas di da stavis ?
jel ovo tu celo tocni jel one de treba da gi stavim? sta gde u pawn kako da pisem na ctrl+f za da stavim ?? ovo nerazumjem bas..

if(!IsPlayerInRangeOfPoint(playerid, radius, x, y,z))
{
        SendClientMessage(playerid, COLOR_GRAD2, "Niste na odredjenom mestu");
        return 1;
}



Napr. ja sam koristio IsAtBar(playerid). Da to uradiš, gore staviš:

Kod:
forward UBurgu(playerid);


i napr. na kraj skripte:

Kod:
public UBurgu(playerid)
{
     if(IsPlayerInRangeOfPoint(playerid, rad, x, y, z) || IsPlayerInRangeOfPoint(playerid, rad, x, y, z) || IsPlayerInRangeOfPoint(playerid, rad, x, y, z))
    {
         return1;
    }
}

pa IsPlayerRangeOfPoint ide u koamndu di to zelis :S
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √