Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: [GU:RP] Ivica poslato Mart 26, 2013, 19:13:52 POSLE PODNE

Naslov: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 26, 2013, 19:13:52 POSLE PODNE
Skripta koju koristim:cyber
Detaljan opis problema:radio sam za stanove da se ude prek dialoga i sada napravim response i prebacim sve od stana iz /enter cmd u response za stan i ja dodem do stana i stisnem ulaz i propadam i onda se spawn na farmi a u cdm /enter sve lijepo radi.Hvala
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: xFORCERx poslato Mart 27, 2013, 00:22:24 PRE PODNE
Daj response
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 27, 2013, 00:44:03 PRE PODNE
if(dialogid == STAN_ULAZD)
{
if(response)
    {
        for(new i = 0; i < sizeof(StanInfo); i++)
{
    if(PlayerInfo[playerid][pStan] == i || StanInfo[i][stLock] == 0)
{
SetPlayerInterior(playerid,StanInfo[i][stInterier]);
SetPlayerPos(playerid, StanInfo[i][stiPozicijaX], StanInfo[i][stiPozicijaY], StanInfo[i][stiPozicijaZ]);
SetPlayerVirtualWorld(playerid,i);
ustanu[playerid]=i;
GameTextForPlayer(playerid, "~w~stan", 5000, 1);
}
else
{
GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
}
}
}
}


to je isto na /enter cmd i sve super radi a ovdje nece
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: xFORCERx poslato Mart 27, 2013, 00:54:01 PRE PODNE
Hmm, trebalo bi raditi... Probaj staviti jos ovo ovako, iako sumnjam da je do toga... Ili je do interijera ili do pozicije...


SetPlayerVirtualWorld( playerid, i+1 );
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 27, 2013, 01:10:32 PRE PODNE
opet nista
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 27, 2013, 20:01:42 POSLE PODNE
znali netko
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 12:21:59 POSLE PODNE
kako mislis timer. Hvala
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: xFORCERx poslato Mart 28, 2013, 12:29:11 POSLE PODNE
Da te zamrzne, kao da se ucitaju objekti... Ali ne mislim da je toga, jer ipak, stvori te na farmi jel?
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 12:39:20 POSLE PODNE
da propadam i onda budem na farmi a na cmd enter sve lijepo sve radi isti kodovi su
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: Rolex. poslato Mart 28, 2013, 12:40:10 POSLE PODNE
Do timera je sigurno,neucita mu server dovoljno brzo mapu i on propada,ovako kad mu stavis timer,on ce taman da ucita mapu i unfreeze.
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 13:02:41 POSLE PODNE
kako bi to mogao za timer. Hvala
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 13:52:48 POSLE PODNE
sad stojim negdje u zraku i nista samo tako stojim
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 14:04:05 POSLE PODNE
ali kako onda radi sve super na /enter :) to ne shvacam , a vamo padam
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 16:12:35 POSLE PODNE
sta  vrijedi sabo kda neznam ja samo znam da na enter hoce uci a na dialog nece, eto :P
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: FlasH poslato Mart 28, 2013, 18:50:06 POSLE PODNE
Citat: ivica158 poslato Mart 28, 2013, 16:12:35 POSLE PODNE
sta  vrijedi sabo kda neznam ja samo znam da na enter hoce uci a na dialog nece, eto :P

Daj dialog taj za enter i daj enter komandu
Naslov: Odg: [Pomoc] dialog stan hitno molim vas
Poruka od: [GU:RP] Ivica poslato Mart 28, 2013, 19:37:54 POSLE PODNE
evo cmd enter:

if(strcmp(cmd, "/enter", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~kuca", 5000, 1);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
HouseEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
}
}
}
//-----------------------kuca1-------------------//
for(new i = 0; i < sizeof(KucaInfo); i++)
{
if (PlayerToPoint(3, playerid,KucaInfo[i][hEntrancex], KucaInfo[i][hEntrancey], KucaInfo[i][hEntrancez]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPhousekey1] == i || KucaInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,KucaInfo[i][hInt]);
SetPlayerPos(playerid,KucaInfo[i][hExitx],KucaInfo[i][hExity],KucaInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~kuca", 5000, 1);
PlayerInfo[playerid][pInt] = KucaInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
HouseEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
}
}
}
//-----------------novo stan-------------------//
for(new i = 0; i < sizeof(StanInfo); i++)
{
if(PlayerToPoint(2.0, playerid, StanInfo[i][stPozicijaX], StanInfo[i][stPozicijaY], StanInfo[i][stPozicijaZ]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pStan] == i || StanInfo[i][stLock] == 0)
{
SetPlayerInterior(playerid,StanInfo[i][stInterier]);
SetPlayerVirtualWorld(playerid,i);
ustanu[playerid]=i;
SetPlayerPos(playerid, StanInfo[i][stiPozicijaX], StanInfo[i][stiPozicijaY], StanInfo[i][stiPozicijaZ]);
GameTextForPlayer(playerid, "~w~stan", 5000, 1);
}
else
{
GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
}
}
}
//------------novo vikendica---------------------------------
for(new i = 0; i < sizeof(VikendicaInfo); i++)
{
if(PlayerToPoint(2.0, playerid, VikendicaInfo[i][vPozicijaX], VikendicaInfo[i][vPozicijaY],VikendicaInfo[i][vPozicijaZ]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pVikendica] == i || VikendicaInfo[i][vLock] == 0)
{
SetPlayerInterior(playerid,VikendicaInfo[i][vInterier]);
SetPlayerVirtualWorld(playerid,i);
uvikendici[playerid]=i;
SetPlayerPos(playerid,VikendicaInfo[i][viPozicijaX],VikendicaInfo[i][viPozicijaY],VikendicaInfo[i][viPozicijaZ]);
GameTextForPlayer(playerid, "~w~vikendica", 5000, 1);
}
else
{
GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
}
}
}
//-------------------------
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
//format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
OnPropUpdate();
//GameTextForPlayer(playerid, string, 5000, 3);
}
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
//PlayerInfo[playerid][pLocal] = i;
}
else
{
GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
}
}
}
//--------[ FIRMA ULAZ 1 ]---------------------------------//
for(new i = 0; i < sizeof(BizInfo); i++)
{
if (PlayerToPoint(3, playerid,BizInfo[i][bzEntranceX], BizInfo[i][bzEntranceY], BizInfo[i][bzEntranceZ]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizInfo[i][bzEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizInfo[i][bzLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
return 1;
}
if(BizInfo[i][bzProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
//format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
BizInfo[i][bzTill] += BizInfo[i][bzEntranceCost];
ExtortionBiz(i, BizInfo[i][bzEntranceCost]);
BizInfo[i][bzProducts]--;
OnPropUpdate();
//GameTextForPlayer(playerid, string, 5000, 3);
}
SetPlayerInterior(playerid,BizInfo[i][bzInterior]);
SetPlayerPos(playerid,BizInfo[i][bzExitX],BizInfo[i][bzExitY],BizInfo[i][bzExitZ]);
PlayerInfo[playerid][pInt] = BizInfo[i][bzInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
//PlayerInfo[playerid][pLocal] = i;
}
else
{
GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
}
}
}
if (PlayerToPoint(4, playerid,1024.5957,-1024.5645,31.6625))
{ // Pay & Spray
    if(GetPlayerState(playerid) == 2)
    {
        if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
        {
            if(SBizzInfo[14][sbProducts] > 0)
            {
            new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1024.5957,-1024.5645,31.6625);
        SetVehicleZAngle(tmpcar, 90);
        GivePlayerMoney(playerid, - SBizzInfo[14][sbEntranceCost]);
        SBizzInfo[14][sbTill] += SBizzInfo[14][sbEntranceCost];
        SBizzInfo[14][sbProducts]--;
        SetTimerEx("AfterSpray1", 5000, false, "i", playerid);
}
else
{
    GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
    }
}
if (PlayerToPoint(4, playerid,1024.9756,-1030.7930,32.0257))
{ // Pay & Spray
    if(GetPlayerState(playerid) == 2)
    {
        if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
        {
            if(SBizzInfo[5][sbProducts] > 0)
            {
            new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1024.9763,-1021.8850,32.1016);
        SetVehicleZAngle(tmpcar, 0);
        GivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
        SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
        SBizzInfo[5][sbProducts]--;
        SetTimerEx("AfterSpray2", 5000, false, "i", playerid);
}
else
{
    GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
    }
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(SBizzInfo[i][sbLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
return 1;
}
if(SBizzInfo[i][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if(i == 10)
{
    PaintballPlayers ++;
    PlayerPaintballing[playerid] = 1;
    new rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
TogglePlayerControllable(playerid, 0);
}
else if(i == 11)
{
    PlayerKarting[playerid] = 1;
    SendClientMessage(playerid, ZELENA, "You can now parcipitate in a Karting Race, grab a Kart.");
}
else
{
    return 1;
}
GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
gSpentCash[playerid] = GetPlayerMoney(playerid);
SBizzInfo[i][sbProducts]--;
SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
printf("%s", string);
PayLog(string);
OnPropUpdate();
}
}
else
{
GameTextForPlayer(playerid, "~r~Nemate novaca", 5000, 1);
}
}
}
}
return 1;
}


evo ulaz dialog:

for(new i = 0; i < sizeof(StanInfo); i++)
{
if(PlayerToPoint(3.0, playerid, StanInfo[i][stPozicijaX], StanInfo[i][stPozicijaY], StanInfo[i][stPozicijaZ]))
{
if(StanInfo[i][stStanje] == 1)
{
new mesage1[1148];
new stan[1148];
format(mesage1, sizeof(mesage1), "Kliknite {00C0FF}Ulaz da udjete u stan {FFFFFF}da udjete ili {F3FF02}Odustani {FFFFFF}da odustanete!");
format(stan, 713," %s",mesage1);
ShowPlayerDialog(playerid,STAN_ULAZD,DIALOG_STYLE_MSGBOX,"{00C0FF}Ulaz",stan,"Ulaz","Odustani");
}
}
}