Problem
#1

pawn Код:
DIALOG:144(playerid, response, listitem, inputtext[])
{
    if(response)
    {
        if(GetClosestVehicle(playerid) == INVALID_VEHICLE_ID) return 1;
        switch(listitem)
        {
            case 0:
            {
                if(vData[GetClosestVehicle(playerid)][vVehicleID] == 0) return 1;
                GetVehicleParamsEx(GetClosestVehicle(playerid), VehicleParams[0], VehicleParams[1], VehicleParams[2], VehicleParams[3], VehicleParams[4], VehicleParams[5], VehicleParams[6]);
                if(VehicleParams[5] == 0) return SendClientMessage(playerid, -1, "{FFFFFF}[ {FF0000}KLAIDA {FFFFFF}]: Bagaюinл privalo bыti atidaryta!");
                pData[playerid][pSlot] = listitem;
                new Tekstas[5][20];
                for(new slot; slot != 4; ++slot)
                {
                    if(vData[GetClosestVehicle(playerid)][vWeapon][slot] == 0) format(Tekstas[slot], 20, "%s", "{6EF83C}Tuриia vieta");
                    else
                    {
                        new Weapon[5][15];
                        GetWeaponName(vData[GetClosestVehicle(playerid)][vWeapon][pData[playerid][pSlot]], Weapon[slot], 15);
                        Tekstas[slot] = Weapon[slot];
                    }
                }
                new Stringas[84];
                format(Stringas, 84, "%s\n%s\n%s\n%s", Tekstas[0], Tekstas[1], Tekstas[2], Tekstas[3], Tekstas[4]);
                ShowPlayerDialog(playerid, 145, DIALOG_STYLE_LIST, "{FFFFFF}Bagaюinлs vidus", Stringas, "Iрimti", "Atgal");
            }
            case 1:
            {
                GetVehicleParamsEx(GetClosestVehicle(playerid), VehicleParams[0], VehicleParams[1], VehicleParams[2], VehicleParams[3], VehicleParams[4], VehicleParams[5], VehicleParams[6]);
                if(VehicleParams[5] == 0) SetVehicleParamsEx(GetClosestVehicle(playerid), VehicleParams[0], VehicleParams[1], VehicleParams[2], VehicleParams[3], VehicleParams[4], 1, VehicleParams[6]);
                else SetVehicleParamsEx(GetClosestVehicle(playerid), VehicleParams[0], VehicleParams[1], VehicleParams[2], VehicleParams[3], VehicleParams[4], 1, VehicleParams[6]);
            }
        }
    }
    return 1;
}
So, case 0 should show player ALL weapons which are in trunk, but if there isn't slot will be named as "{hex}Tuљčia vieta";

And case 1 should open/close trunk

In case 0 server doesnt show me dialog, it does "nothing"
Case 1 too o_O

So, maybe someone knows where is the problem?
Reply
#2

^^^^^^^^^^^^^, help
Reply
#3

can u make the script in english ?
caz i see this in first time..
and i want to get what did your script is about and how you build it
Reply
#4

Quote:
Originally Posted by xkirill
Посмотреть сообщение
can u make the script in english ?
caz i see this in first time..
and i want to get what did your script is about and how you build it
Its already in english, only texts in dialogs are in Lithuanian ^.^.
Reply
#5

thet what i mean >.<
i dont understand it... lol...
can u make it in english?
and post here if this script gave you any errors/warnings...
Reply
#6

Lol, why do you need to understand texts? The point is in script, I think? No, it doesnt give me any warnings/errors
Reply
#7

Show the GetClosestVehicle code, this is may the problem if it does "nothing" as you said.
Also, are you sure that this style of dialog scripting (DIALOG:144) is right? Didn't saw it anywhere else.
Reply
#8

Quote:
Originally Posted by Amit_B
Посмотреть сообщение
Show the GetClosestVehicle code, this is may the problem if it does "nothing" as you said.
Also, are you sure that this style of dialog scripting (DIALOG:144) is right? Didn't saw it anywhere else.
It looks like he #defined DIALOG:144 somewhere else unless I'm missing something.
Reply
#9

For dialogs: Yes, Im using gamer's include for making dialogs faster if you have > 100 those, at this moment I have +-200

For GetClosestVehicle:

pawn Код:
stock GetClosestVehicle(playerid)
{
    new Float:distance = 99980001, vehicleid = Cars, Float:pPos[3];
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    for(new vehid = 1; vehid != Cars; ++vehid)
    {
        new Float:vPos[3];
        GetVehiclePos(vehid, vPos[0], vPos[1], vPos[2]);
        if(vPos[0] == 0.000 && vPos[1] == 0.000 && vPos[2] == 0.000) continue;
        else
        {
            new Float:newdistance;
            vPos[0] -= pPos[0];
            vPos[1] -= pPos[1];
            vPos[2] -= vPos[2];
            newdistance = vPos[0] * vPos[0] + vPos[1] * vPos[1] + vPos[2] * vPos[2];
            if(newdistance < distance)
            {
                vehicleid = vehid;
                distance = newdistance;
                return vehicleid;
            }
        }
    }
    return INVALID_VEHICLE_ID;
}
I found ^ somewhere in this forum.
Reply
#10

vPos[2] -= vPos[2]; -> vPos[2] -= pPos[2];
First problem I found on this function. I guess that it isn't the right function to do this. Try this one:
pawn Код:
stock GetClosestVehicle(playerid)
{
    new Float:distance = 9999.0, vehicleid = INVALID_VEHICLE_ID, Float:pPos[3];
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    for(new vehid = 1; vehid != Cars; ++vehid) if(GetVehicleDistanceFromPoint(vehid,pPos[0],pPos[1],pPos[2]) < distance) vehicleid = vehid, distance = newdistance;
    return vehicleid;
}
Reply
#11

OK, I will test it tommorrow and will reply. Anyways, thanks for trying to help.
Reply
#12

lol? undefined symbol "GetVehicleDistanceFromPoint"

My current SAMP server version is R5, tried to update it once again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)