[POMOC] Trafike

Započeo Xladen, Februar 12, 2017, 01:00:11 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: ARP
Detaljan opis problema: Kada kucam /trafika bilo gde na mapi mi pokaze dialog ali kada pokusam da kupim nece,i kada sam blizu trafike isto nista ne kaze.Proverio sam vise puta da li ima proizvoda i ima.Molim vas pomozite.I ako mozete mi reci kako da definisem trafiku.U smislu da dodam pickup i ako nije u blizini da ne moze da koristi /trafika.
Dio skripte:

CMD:trafika(playerid, params[])
{
    if(UlogovanProvera[playerid] == 0) return Ulogovan(playerid);
    SPD(playerid, DIALOG_TRAFIKA, DIALOG_STYLE_LIST, ""BELA"Trafika", ""ORANGE"- "BELA"Dopuna (20$)\n1"ORANGE"- "BELA"Dopuna (50$)\n2"ORANGE"- "BELA"Dopuna (100$)\n3"ORANGE"- "BELA"Sok (10$)\n4"ORANGE"- "BELA"Cigare (20$)\n5"ORANGE"- "BELA"Upaljac (10$)\n6"ORANGE"- "BELA"Cokoladica (10$)\n7"ORANGE"- "BELA"Kondom (5$)\n8"ORANGE"- "BELA"Kalkulator (50$)\n9"ORANGE"- "BELA"Mp3 (100$)\n10", "Odaberi", "Izlaz");
return 1;
}


Evo i dialog

    if(dialogid == DIALOG_TRAFIKA)
{
if(!response) return 1;
if(FirmaInfo[KioskKupovina[playerid]][fProizvodi] <= 0) return SCM(playerid,-1,""ZPLAVA"[Trafika]: "BELA"Nemamo vise proizvoda!");
FirmaInfo[KioskKupovina[playerid]][fProizvodi]--;
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""ORANGE"[ARPARP] "SIVA"Nemate mobilni telefon!");
    if(PlayerInfo[playerid][pNovacDzep] < 20) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 20$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste 20 kredita za 20$!");
PlayerInfo[playerid][pMobKredit] += 20;
g_NovacMinus(playerid,20);
FirmaNovac(KioskKupovina[playerid],20);
SavePlayer(playerid);
}
case 1:
{
if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate mobilni telefon!");
    if(PlayerInfo[playerid][pNovacDzep] < 50) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste 50 kredita za 50$!");
PlayerInfo[playerid][pMobKredit] += 50;
g_NovacMinus(playerid,50);
FirmaNovac(KioskKupovina[playerid],50);
SavePlayer(playerid);
}
case 2:
{
    if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate mobilni telefon!");
    if(PlayerInfo[playerid][pNovacDzep] < 100) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 100$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste 100 kredita za 100$!");
PlayerInfo[playerid][pMobKredit] += 100;
g_NovacMinus(playerid,100);
FirmaNovac(KioskKupovina[playerid],100);
SavePlayer(playerid);
}
case 3:
{
    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""ORANGE"[ARP]"SIVA"Nemate dovoljno novca 10$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste sok za 10$!");
                SetPlayerSpecialAction( playerid, SPECIAL_ACTION_DRINK_SPRUNK);
g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
}
case 4:
{
if(PlayerInfo[playerid][pCigare] != 0) return SCMF(playerid,-1,""ORANGE"[ARP] "SIVA"Vec imas %d cigara prvo ih popusi!",PlayerInfo[playerid][pCigare]);
    if(PlayerInfo[playerid][pNovacDzep] < 20) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 20$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste cigare | Sada mozete zapliti cigaru (/zapalicigaru | /ugasicigaru)!");
PlayerInfo[playerid][pCigare] = 20;
g_NovacMinus(playerid,20);
FirmaNovac(KioskKupovina[playerid],20);
SavePlayer(playerid);
}
case 5:
{
if(PlayerInfo[playerid][pUpaljac] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes upaljac!");
    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 10$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste upaljac za 10$!");
PlayerInfo[playerid][pUpaljac] = 10;
g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
SavePlayer(playerid);
}
case 6:
{
    new string[128];
    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 10$!");
    new Float:hp, Float:nhp; GetPlayerHealth(playerid, hp);
nhp = floatadd(hp, 10.0); g_AC_BS_SetPlayerHealth(playerid, nhp);
if(nhp > 99.0) g_AC_BS_SetPlayerHealth(playerid, 99.0);
if(nhp >= 99.0) return SCM(playerid,-1,"[ARP] "ORANGE"Niste gladni!");
format(string, sizeof(string), "* %s jede cokoladicu.", GetName(playerid));
    ProxDetector(15.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
    OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
    g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
}
case 7:
{
    if(PlayerInfo[playerid][pSex] == 2) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vi ste znesko, ovo vama nije potrebno!");
if(PlayerInfo[playerid][pKondom] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes kondom!");
    if(PlayerInfo[playerid][pNovacDzep] < 5) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 5$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste kondom za 5$ | koriscenje:/kondom!");
PlayerInfo[playerid][pKondom] = 1;
g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
SavePlayer(playerid);
}
case 8:
{
if(PlayerInfo[playerid][pKalkulator] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes kalkulator!");
    if(PlayerInfo[playerid][pNovacDzep] < 50) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste kalkulator za 50$ | koriscenje:/kalkulator(JOS NIJE U FUNKCIJI-U DORADI)!");
PlayerInfo[playerid][pKalkulator] = 1;
g_NovacMinus(playerid,50);
FirmaNovac(KioskKupovina[playerid],50);
SavePlayer(playerid);
}
case 9:
{
if(PlayerInfo[playerid][pMp3] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes mp3!");
    if(PlayerInfo[playerid][pNovacDzep] < 100) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste mp3 za 100$ | koriscenje : /mp3 !");
PlayerInfo[playerid][pMp3] = 1;
g_NovacMinus(playerid,100);
FirmaNovac(KioskKupovina[playerid],100);
SavePlayer(playerid);
}
}
}

Presto sam da skriptam(a i kad sam skripto nisam imo pojma :D) ali mislim da uradis provjeru ako igrac nije u blizini trafike da mu salje poruku da mora biti u blizini, odes kod svake trafike /save, nadjes kordinate stavis provjeru i stavis range npr 2.0
CitatElectric Power is everywhere present in unlimited quantities and can drive the world's machinery without the need of coal, oil, gas, or any other of the common fuels!



Ok znam kako da postavim pickup ali kako da pickup vezem za /trafika i da mu stavim range to ne znam.

[pawn]CMD:trafika(playerid, params[])
{
    if(UlogovanProvera[playerid] == 0) return Ulogovan(playerid);
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, x,y,z || x,y,z || x,y,z)) return Error(playerid, "Moras biti kod trafike!");
    SPD(playerid, DIALOG_TRAFIKA, DIALOG_STYLE_LIST, ""BELA"Trafika", ""ORANGE"- "BELA"Dopuna (20$)\n1"ORANGE"- "BELA"Dopuna (50$)\n2"ORANGE"- "BELA"Dopuna (100$)\n3"ORANGE"- "BELA"Sok (10$)\n4"ORANGE"- "BELA"Cigare (20$)\n5"ORANGE"- "BELA"Upaljac (10$)\n6"ORANGE"- "BELA"Cokoladica (10$)\n7"ORANGE"- "BELA"Kondom (5$)\n8"ORANGE"- "BELA"Kalkulator (50$)\n9"ORANGE"- "BELA"Mp3 (100$)\n10", "Odaberi", "Izlaz");
   return 1;
}[/pawn]

Javi da li radi
Poslednja Izmena: Februar 12, 2017, 03:41:02 PRE PODNE od ANDRIJEVIC
samo rejv i debele zene

C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19683) : error 017: undefined symbol "x"
C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19683) : error 017: undefined symbol "Error"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

2 Errors.

Izlazi mi ovaj error a ako mozes da mi kazes je li ja treba da dodam ispred trafike PickUp i kako ja njega da povezem sa trafikom msm da on sluzi za /trafika

[pawn]CMD:trafika(playerid, params[])
{
    if(UlogovanProvera[playerid] == 0) return Ulogovan(playerid);
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, x,y,z || x,y,z || x,y,z))
    SPD(playerid, DIALOG_TRAFIKA, DIALOG_STYLE_LIST, ""BELA"Trafika", ""ORANGE"- "BELA"Dopuna (20$)\n1"ORANGE"- "BELA"Dopuna (50$)\n2"ORANGE"- "BELA"Dopuna (100$)\n3"ORANGE"- "BELA"Sok (10$)\n4"ORANGE"- "BELA"Cigare (20$)\n5"ORANGE"- "BELA"Upaljac (10$)\n6"ORANGE"- "BELA"Cokoladica (10$)\n7"ORANGE"- "BELA"Kondom (5$)\n8"ORANGE"- "BELA"Kalkulator (50$)\n9"ORANGE"- "BELA"Mp3 (100$)\n10", "Odaberi", "Izlaz");
return 1;
}[/pawn]

Ovo x,y,z udji u igru i idi gde su ti trafike i ispred trafike kucaj /save i posle nadji tamo i promeni to :D
samo rejv i debele zene


C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19686) : warning 213: tag mismatch
C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19686) : warning 202: number of arguments does not match definition
C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19686) : warning 202: number of arguments does not match definition
C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19686) : warning 202: number of arguments does not match definition
C:\Users\korisnik\Desktop\Adamo Roleplay\gamemodes\ARP1.pwn(19686) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Warnings.



Sada samo Warnings izlazi za

if(!IsPlayerInRangeOfPoint(playerid, 2.0, -2540.8928,2291.6375,4.9844 || -2244.4719,2329.8694,4.9686 || -1472.6309,2641.1299,55.8359))

EDIT: I idalje ne radi
Poslednja Izmena: Februar 12, 2017, 04:07:31 PRE PODNE od Xladen

Samo da kazem popravio sam ovo sa trafikom da morate biti blizu,sada je problem sto se pojavi DIALOG_TRAFIKA i kada nesto kupim ne dobijem to.Evo vam dialogid za DIALOG_TRAFIKA


    if(dialogid == DIALOG_TRAFIKA)
{
if(!response) return 1;
if(FirmaInfo[KioskKupovina[playerid]][fProizvodi] <= 0) return SCM(playerid,-1,""ORANGE"[Trafika]: "BELA"Nemamo vise proizvoda!");
FirmaInfo[KioskKupovina[playerid]][fProizvodi]--;
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate mobilni telefon!");
    if(PlayerInfo[playerid][pNovacDzep] < 20) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 20$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste 20 kredita za 20$!");
PlayerInfo[playerid][pMobKredit] += 20;
g_NovacMinus(playerid,20);
FirmaNovac(KioskKupovina[playerid],20);
SavePlayer(playerid);
}
case 1:
{
if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate mobilni telefon!");
    if(PlayerInfo[playerid][pNovacDzep] < 50) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste 50 kredita za 50$!");
PlayerInfo[playerid][pMobKredit] += 50;
g_NovacMinus(playerid,50);
FirmaNovac(KioskKupovina[playerid],50);
SavePlayer(playerid);
}
case 2:
{
    if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate mobilni telefon!");
    if(PlayerInfo[playerid][pNovacDzep] < 100) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 100$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste 100 kredita za 100$!");
PlayerInfo[playerid][pMobKredit] += 100;
g_NovacMinus(playerid,100);
FirmaNovac(KioskKupovina[playerid],100);
SavePlayer(playerid);
}
case 3:
{
    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""ORANGE"[ARP]"SIVA"Nemate dovoljno novca 10$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste sok za 10$!");
                SetPlayerSpecialAction( playerid, SPECIAL_ACTION_DRINK_SPRUNK);
g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
}
case 4:
{
if(PlayerInfo[playerid][pCigare] != 0) return SCMF(playerid,-1,""ORANGE"[ARP] "SIVA"Vec imas %d cigara prvo ih popusi!",PlayerInfo[playerid][pCigare]);
    if(PlayerInfo[playerid][pNovacDzep] < 20) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 20$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste cigare | Sada mozete zapliti cigaru (/zapalicigaru | /ugasicigaru)!");
PlayerInfo[playerid][pCigare] = 20;
g_NovacMinus(playerid,20);
FirmaNovac(KioskKupovina[playerid],20);
SavePlayer(playerid);
}
case 5:
{
if(PlayerInfo[playerid][pUpaljac] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes upaljac!");
    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 10$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste upaljac za 10$!");
PlayerInfo[playerid][pUpaljac] = 10;
g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
SavePlayer(playerid);
}
case 6:
{
    new string[128];
    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 10$!");
    new Float:hp, Float:nhp; GetPlayerHealth(playerid, hp);
nhp = floatadd(hp, 10.0); g_AC_BS_SetPlayerHealth(playerid, nhp);
if(nhp > 99.0) g_AC_BS_SetPlayerHealth(playerid, 99.0);
if(nhp >= 99.0) return SCM(playerid,-1,"[ARP] "ORANGE"Niste gladni!");
format(string, sizeof(string), "* %s jede cokoladicu.", GetName(playerid));
    ProxDetector(15.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
    OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
    g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
}
case 7:
{
    if(PlayerInfo[playerid][pSex] == 2) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vi ste znesko, ovo vama nije potrebno!");
if(PlayerInfo[playerid][pKondom] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes kondom!");
    if(PlayerInfo[playerid][pNovacDzep] < 5) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 5$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste kondom za 5$ | koriscenje:/kondom!");
PlayerInfo[playerid][pKondom] = 1;
g_NovacMinus(playerid,10);
FirmaNovac(KioskKupovina[playerid],10);
SavePlayer(playerid);
}
case 8:
{
if(PlayerInfo[playerid][pKalkulator] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes kalkulator!");
    if(PlayerInfo[playerid][pNovacDzep] < 50) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste kalkulator za 50$ | koriscenje:/kalkulator(JOS NIJE U FUNKCIJI-U DORADI)!");
PlayerInfo[playerid][pKalkulator] = 1;
g_NovacMinus(playerid,50);
FirmaNovac(KioskKupovina[playerid],50);
SavePlayer(playerid);
}
case 9:
{
if(PlayerInfo[playerid][pMp3] == 1) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Vec posedujes mp3!");
    if(PlayerInfo[playerid][pNovacDzep] < 100) return SCM(playerid,-1, ""ORANGE"[ARP] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"INFO | "SIVA"Kupili ste mp3 za 100$ | koriscenje : /mp3 !");
PlayerInfo[playerid][pMp3] = 1;
g_NovacMinus(playerid,100);
FirmaNovac(KioskKupovina[playerid],100);
SavePlayer(playerid);
}
}
}

Zahvaljujem se na pomoci malo sam izmenio tvoje ono i sada radi puno hvala.
LOCK