Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Vojinxt125x poslato Jul 17, 2017, 20:17:17 POSLE PODNE

Naslov: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 17, 2017, 20:17:17 POSLE PODNE
Skripta koju koristim: Athlone
Detaljan opis problema: Kada ubacim neku filterscriptu  nmg se logovati npr, ne mogu kliknut na login dugme i tako nesto se izgubi.
Dio skripte: Evo FS: https://pastebin.com/XG8LhWBH
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Naslov: Odg: FS mi zbuga GM
Poruka od: Bašovski poslato Jul 17, 2017, 20:40:19 POSLE PODNE
Ubaci fs u gamemode, prilagodi skripti maksimalno i onda pokreni, npr. u fs pod enumeratorom su dialozi a u gm su definisu id-om.
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 17, 2017, 22:11:31 POSLE PODNE
Pa veoma ga unistim tada XD Dobijam errore i to, jel moze ovo da se konvertuje nekako u fs da mi loaduje glavni gm bez problema ?
Naslov: Odg: FS mi zbuga GM
Poruka od: Tosic ツ poslato Jul 19, 2017, 13:00:44 POSLE PODNE
Mesaju ti se dialozi verovatno tako da promeni id dialoga u FS.. stavi id neki sto ne koristis u modu i tjt
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 19, 2017, 17:57:31 POSLE PODNE
Gde se nalazi ? [pawn]
/*

This is Camp Trailer System.
Credits: Pachino ( www.facebook.com/ErvinSnoopy )

Dont delete credits. Enjoy :-)

Maded 25.1.2016
*/

#include <a_samp>
#include < YSI\y_ini >
#include < YSI\y_amx >
#include < YSI\y_commands >
#include < sscanf2 >
#include < streamer >
#include < foreach >

//BOJE
#define RED         "{F81414}"
#define WHITE            "{FFFFFF}"
#define YELLOW            "{F3FF02}"
#define GREEN          "{6EF83C}"

enum
{
    DIALOG_CAMPBUY,
    DIALOG_CAMP,
    DIALOG_CAMPSELL,
    DIALOG_CAMPINFO,
    INFOBUY_DIALOG
}

new LocateCamp[MAX_PLAYERS];
new TowedCamp[MAX_PLAYERS];
new freeze[MAX_PLAYERS];
new EnteredInCamp[MAX_PLAYERS];
new objekt;
////////////////////////////////////////////////////////////////////////////////
#define MAX_KAMP        900
#define CAMP_FILE       "Trailers/%d.ini"
enum kInfo
{
    Float:cPosition[4],
    cOwner[MAX_PLAYER_NAME],
    cID,
    cLocked,
    cVW
}
new CampInfo[MAX_KAMP][kInfo];
////////////////////////////////////////////////////////////////////////////////
new Float:RandomKampSpawn[4][4] =
{
    {257.0985,-1397.4440,13.7161,209.1387},
    {266.8461,-1392.3018,13.8020,194.2435},
    {276.3607,-1384.3616,13.8890,206.1503},
    {285.1536,-1378.3163,13.9568,201.7636}
};
////////////////////////////////////////////////////////////////////////////////
#define CAMPUSERS "Campusers/%s.ini"
enum pInfo
{
    pCampTrailer
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnFilterScriptInit()
{
    CreateObject(14385, 2511.64355, -1725.43652, 779.20868,   0.00000, 0.00000, 0.00000);
    CreateObject(14386, 2511.68457, -1726.33496, 779.07117,   0.00000, 0.00000, 0.00000);
    CreateObject(6959, 2509.99023, -1725.06543, 777.64142,   0.00000, 0.00000, 0.00000);
    CreateObject(5856, 2509.32813, -1728.60352, 779.61633,   0.00000, 0.00000, 0.00000);
    CreateObject(5856, 2508.47363, -1723.26367, 780.11633,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2511.74902, -1732.35547, 780.64136,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2512.50391, -1718.44824, 780.11633,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2508.47168, -1720.57617, 780.11633,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2513.87891, -1726.26563, 777.88574,   0.00000, 0.00000, 0.00000);
    CreateObject(1535, 2513.88281, -1729.93542, 777.63409,   0.00000, 0.00000, 90.51917);
    CreateObject(1506, 2513.99487, -1728.44849, 779.47076,   0.00000, 0.00000, 270.26917);
    CreateObject(970, 2511.74805, -1732.07617, 778.16162,   90.00000, 179.99451, 0.00000);
    CreateObject(970, 2509.78320, -1732.34277, 778.18854,   90.00000, 168.45886, 281.53564);
    CreateObject(970, 2513.58301, -1732.32410, 778.08844,   90.00000, 165.52246, 104.47751);
    CreateObject(970, 2513.65479, -1725.87256, 778.06342,   90.00000, 191.09619, 78.89282);
    CreateObject(970, 2513.97803, -1726.01221, 778.08276,   90.00000, 179.99451, 359.00000);
    CreateObject(970, 2513.85938, -1725.26660, 778.63898,   90.00000, 179.99451, 0.00000);
    CreateObject(970, 2513.40234, -1723.74805, 778.63898,   90.00000, 179.99451, 90.00000);
    CreateObject(970, 2513.82715, -1725.81848, 778.18854,   0.00000, 0.00000, 0.00000);
    CreateObject(1271, 2509.66895, -1727.24316, 779.76306,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2509.91040, -1729.96411, 779.80548,   0.00000, 0.00000, 0.00000);
    CreateObject(970, 2510.55396, -1720.80042, 778.18854,   0.00000, 90.00000, 269.98901);
    CreateObject(970, 2510.74414, -1719.35400, 778.06342,   90.00000, 180.00549, 178.74170);
    CreateObject(2238, 2513.51245, -1724.43384, 779.59894,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.54004, -1723.88220, 779.57098,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.49609, -1722.42236, 779.68225,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.49609, -1721.91296, 779.62988,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.51782, -1723.09290, 779.81281,   0.00000, 90.00000, 89.99994);
    CreateObject(2238, 2509.82715, -1726.54150, 780.41589,   0.00000, 1.24695, 0.00000);
    CreateObject(2238, 2510.29443, -1726.65588, 778.85077,   0.00000, 0.00000, 18.00000);
    CreateObject(14811, 2503.91211, -1725.65723, 780.97998,   0.00000, 0.00000, 179.99451);
    CreateObject(14792, 2524.25366, -1730.83765, 770.23480,   0.00000, 270.00000, 84.74207);
    CreateObject(3882, 2507.34399, -1730.58899, 778.89697,   0.00000, 0.00000, 270.00000);
    CreateObject(3882, 2515.62158, -1727.21484, 778.73315,   0.00000, 0.00000, 173.50000);
    CreateObject(14792, 2499.67480, -1731.37695, 777.90527,   0.00000, 179.99451, 0.24719);
    CreateObject(3882, 2507.34375, -1730.58594, 779.45837,   0.00000, 0.00000, 270.00000);
    CreateObject(3882, 2507.34180, -1729.19165, 780.48315,   0.00000, 270.00000, 272.00000);
    CreateObject(3882, 2507.34302, -1728.20898, 776.28320,   0.00330, 89.74979, 266.49097);
    CreateObject(3119, 2511.17334, -1731.36597, 778.46405,   0.00000, 0.00000, 279.99756);
    CreateObject(14633, 2498.01660, -1727.52539, 780.12848,   0.00000, 0.00000, 229.49890);
    CreateObject(2801, 2512.41235, -1725.27368, 778.33301,   0.00000, 0.00000, 160.00000);
    CreateObject(18059, 2503.31372, -1726.64905, 779.76477,   270.79053, 341.55078, 341.55261);
    CreateObject(14399, 2502.31055, -1729.33398, 782.71124,   0.00000, 179.99451, 0.00000);
    CreateObject(14399, 2507.34692, -1723.35071, 777.56036,   359.97723, 90.24921, 359.99988);
    CreateObject(14827, 2506.91602, -1715.21484, 778.83691,   0.00000, 0.00000, 270.00000);
    CreateObject(951, 2514.33398, -1729.16504, 778.62836,   0.00000, 0.00000, 90.00000);
    CreateObject(14515, 2480.00684, -1686.86035, 778.87195,   0.00000, 0.00000, 91.99402);
    CreateObject(14515, 2510.33594, -1711.49023, 778.10120,   0.00000, 0.00000, 0.48889);
    CreateObject(14515, 2542.93457, -1703.63281, 777.85095,   0.00000, 179.49463, 269.98901);
    CreateObject(14515, 2542.21289, -1768.89941, 779.00488,   0.00000, 0.00000, 270.24719);
    CreateObject(18105, 2513.10962, -1738.30774, 781.04999,   0.00000, 0.00000, 89.75000);
    CreateObject(18109, 2518.55176, -1718.56738, 779.46002,   0.00000, 0.00000, 359.74731);
    CreateObject(2074, 2512.24878, -1727.47363, 779.84137,   0.00000, 0.00000, 338.25000);
    CreateObject(2342, 2512.08130, -1730.60217, 778.27698,   0.00000, 0.00000, 90.50000);
    CreateObject(2213, 2512.46143, -1727.53589, 778.55298,   334.64355, 23.07678, 342.83923);
    CreateObject(2212, 2514.13452, -1724.98169, 778.72101,   334.41833, 23.12863, 77.69974);
    CreateObject(14651, 2514.03516, -1729.05273, 782.37476,   0.00000, 179.99451, 89.99451);
    CreateObject(2486, 2513.62598, -1728.41602, 780.11041,   0.00000, 0.00000, 354.99573);
    CreateObject(2542, 2509.67285, -1727.23926, 780.11279,   7.24548, 0.00000, 90.48889);
    CreateObject(14863, 2514.41626, -1721.61475, 777.73029,   358.25043, 1.25058, 100.03818);
    CreateObject(14521, 2516.21582, -1719.97852, 777.89374,   359.00024, 355.74829, 56.92566);
    CreateObject(14521, 2512.98560, -1717.36743, 777.76862,   0.00000, 0.00000, 356.99609);
    CreateObject(2846, 2509.38184, -1725.77344, 779.51123,   0.98877, 72.27356, 274.89990);
    CreateObject(15027, 2515.75171, -1721.22876, 778.91803,   358.75031, 1.25030, 316.02731);
    CreateObject(15028, 2508.43262, -1728.42773, 778.88507,   5.49316, 1.50513, 137.85095);
    CreateObject(8251, 2501.36523, -1720.72363, 779.16528,   0.00000, 179.99451, 0.24719);
    CreateObject(3069, 2509.57324, -1716.11426, 778.48383,   0.00000, 269.74182, 173.73779);
    CreateObject(2768, 2512.41431, -1727.64221, 778.57001,   0.00000, 0.00000, 90.00000);
    CreateObject(2215, 2513.61768, -1725.02319, 778.71051,   334.46390, 23.40106, 10.56726);
    CreateObject(1510, 2511.97144, -1727.27576, 778.53699,   0.00000, 0.00000, 0.00000);
    CreateObject(1485, 2511.78125, -1727.24219, 778.56299,   0.00000, 4.25000, 0.00000);
    CreateObject(3503, 2512.20288, -1727.49988, 777.14349,   0.00000, 0.00000, 179.99719);
    CreateObject(1897, 2510.34766, -1723.40527, 777.56226,   0.00000, 179.99451, 270.00000);
    CreateObject(14482, 2517.00391, -1733.34473, 778.15485,   0.00000, 0.00000, 270.00000);
    CreateObject(2006, 2510.07617, -1726.57227, 779.75000,   90.00000, 0.00000, 5.50000);
    CreateObject(1933, 2512.23779, -1727.38184, 778.43787,   0.00000, 0.00000, 0.00000);
    CreateObject(1916, 2512.12622, -1727.17908, 778.51294,   0.00000, 0.00000, 0.00000);
    CreateObject(2141, 2513.40967, -1721.14746, 777.66742,   0.00000, 0.00000, 269.74731);
    CreateObject(14802, 2516.44873, -1716.70764, 778.92389,   0.00000, 0.00000, 182.50000);
    CreateObject(2372, 2510.67285, -1725.29980, 777.46191,   0.00000, 0.00000, 0.24719);
    CreateObject(11353, 2509.90430, -1706.01855, 781.41321,   0.00000, 270.00000, 0.00000);
    CreateObject(3002, 2510.08984, -1726.57910, 779.82001,   0.00000, 0.00000, 249.99939);
    CreateObject(11292, 2507.32617, -1722.26172, 779.37451,   0.00000, 0.00000, 269.74731);
    CreateObject(11292, 2505.13867, -1730.87988, 780.05017,   0.00000, 0.00000, 179.99451);
    CreateObject(5856, 2510.47266, -1718.52710, 780.11633,   0.00000, 0.00000, 180.00000);
    CreateObject(2225, 2511.54834, -1730.32129, 778.16162,   0.00000, 180.00000, 0.25000);
    CreateObject(2812, 2509.82324, -1723.68848, 778.48224,   0.00000, 0.00000, 340.75000);
    CreateObject(2816, 2510.21362, -1731.61340, 778.29999,   357.50092, 1.50143, 332.81543);
    CreateObject(2813, 2509.28662, -1729.17590, 779.66187,   275.53827, 263.26288, 82.82956);
    CreateObject(2813, 2509.34277, -1729.13794, 779.52472,   70.22913, 87.48904, 356.76605);
    CreateObject(2831, 2510.16040, -1724.59290, 778.70001,   0.00000, 0.00000, 156.00000);
    CreateObject(2827, 2509.64233, -1727.96570, 778.78723,   0.00000, 359.50000, 25.75000);
    CreateObject(2827, 2509.54468, -1727.57922, 778.67438,   43.50488, 90.23724, 266.40210);
    CreateObject(2824, 2513.54150, -1726.11646, 778.28772,   359.08655, 1.00000, 89.42963);
    CreateObject(2853, 2509.61719, -1727.18042, 778.94037,   0.74985, 180.25049, 70.24658);
    CreateObject(14830, 2498.98999, -1721.88245, 779.26385,   0.00000, 0.00000, 270.25000);
    CreateObject(2247, 2510.05200, -1723.52014, 780.00183,   334.13693, 349.43109, 160.84692);
    CreateObject(2684, 2511.98950, -1727.61658, 778.54401,   271.03418, 299.16052, 219.31554);
    CreateObject(1324, 2511.34741, -1720.61023, 779.22156,   0.00000, 0.50000, 269.50000);
    CreateObject(7313, 2509.38794, -1728.04419, 776.30499,   359.75122, 269.97278, 90.50012);
    CreateObject(7313, 2509.39185, -1728.04468, 776.06177,   359.74731, 269.97253, 90.24695);
    CreateObject(12954, 2509.72559, -1735.59570, 772.49335,   338.10974, 269.99451, 179.93958);
    CreateObject(1897, 2510.03979, -1729.11389, 778.63708,   89.73633, 72.40540, 287.50391);
    CreateObject(2860, 2513.73828, -1721.21521, 780.16400,   0.00000, 0.00000, 164.00000);
    CreateObject(1209, 2513.19287, -1721.95972, 778.08490,   0.00000, 270.00000, 90.00000);
    CreateObject(2558, 2514.14819, -1727.60510, 778.66211,   0.00000, 0.00000, 90.00000);
    CreateObject(2872, 2509.50293, -1727.84033, 777.83728,   344.75000, 0.00000, 106.50000);
    CreateObject(18866, 2511.70630, -1730.56201, 778.14502,   0.00000, 0.00000, 40.00000);
    CreateObject(18644, 2513.01465, -1724.63196, 778.70099,   90.00000, 0.00000, 250.00000);
    CreateObject(18635, 2513.01611, -1725.57214, 778.66998,   90.00000, 111.00000, 0.00000);
    CreateObject(2673, 2509.37109, -1728.60034, 779.81000,   0.00000, 0.00000, 239.00000);
    //==========================================================================
    for(new i = 0; i < sizeof(CampInfo); i++)
    {
        new kFile[50];
        format(kFile, sizeof(kFile), CAMP_FILE, i);
        if(fexist(kFile))
        {
            INI_ParseFile(kFile, "UcitajKamp", .bExtra = true, .extra = i);
            CampInfo[cID] = CreateVehicle(607, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2], CampInfo[cPosition][3], 0, 0, -1);
            objekt = CreateObject(3171, 0,0,0,0,0,0);
            AttachObjectToVehicle(objekt, CampInfo[cID], 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090);
        }
    }
    CreateDynamicPickup(19132, 1, 257.0985,-1397.4440,13.7161);
    CreateDynamic3DTextLabel(""WHITE"[ "GREEN"/buycamp "WHITE"]",-1,257.0985,-1397.4440,13.7161, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
    return 1;
}
public OnFilterScriptExit()
{
    foreach(Player, i)
    {
        KillTimer(freeze);
    }
    return 1;
}
public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][pCampTrailer] = -1; TowedCamp[playerid] = 0;
    EnteredInCamp[playerid] = 0;
    if(fexist(Campusers(playerid)))
    {
        INI_ParseFile(Campusers(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    }
    return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_NO)
    {
        for(new i; i < MAX_KAMP; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 4.0, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2]))
            {
                if(EnteredInCamp[playerid] == 0)
                {
                    GameTextForPlayer(playerid, "~y~Objects loading...", 5000, 4);
                    freeze[playerid] = SetTimerEx("Freeze",3000, false, "i", playerid);
                    TogglePlayerControllable(playerid, 0);
                    SetPlayerPos(playerid, 2513.19897, -1729.12073, 778.67657);
                    SetPlayerVirtualWorld(playerid, CampInfo[cVW]);
                    EnteredInCamp[playerid] = 1;
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2513.19897, -1729.12073, 778.67657))
            {
                if(EnteredInCamp[playerid] == 1)
                {
                    SetPlayerPos(playerid, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2]);
                    SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0);
                    EnteredInCamp[playerid] = 0;
                }
            }
        }
    }
    if(newkeys & KEY_YES)
    {
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new i = PlayerInfo[playerid][pCampTrailer];
            new Float:Poz[3];
            GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
            if(IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2]))
            {
                if(TowedCamp[playerid] == 0)
                {
                    objekt = CreateObject(3171, 0,0,0,0,0,0);
                    new vehicleid = GetPlayerVehicleID(playerid);
                    AttachObjectToVehicle(objekt, CampInfo[cID], 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090);
                    AttachTrailerToVehicle(CampInfo[cID], vehicleid); TowedCamp[playerid] = 1;
                    SendClientMessage(playerid,-1,""GREEN"You are sucessfuly towed Camp Trailer!");
                }
                else if(TowedCamp[playerid] == 1)
                {
                    new newcartr = GetPlayerVehicleID(playerid);
                    if(IsTrailerAttachedToVehicle(newcartr))
                    {
                        new vehicleid = GetPlayerVehicleID(playerid);
                        DetachTrailerFromVehicle(vehicleid);
                        TowedCamp[playerid] = 0;
                        SendClientMessage(playerid,-1,""GREEN"You are sucessfuly untowed Camp Trailer!");
                    }
                }
            }
        }
    }
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    if(EnteredInCamp[playerid] == 1)
    {
        EnteredInCamp[playerid] = 0; SetPlayerVirtualWorld(playerid, 0);
    }
    if(TowedCamp[playerid] == 1)
    {
        TowedCamp[playerid] = 0;
    }
    return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
    for(new i; i < MAX_KAMP; i++)
    {
        if(vehicleid == CampInfo[cID])
        {
            DestroyObject(objekt);
        }
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_CAMPBUY)
    {
        if(!response) return SendClientMessage(playerid,-1,""WHITE"You are exit from Camp Trailer Buy Menu!");
        if(response)
        {
            if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You dont have money!");
            for(new i = 0; i < sizeof(CampInfo); i++)
            {
                new Fajl[64];
                format(Fajl, sizeof(Fajl), CAMP_FILE, i);
                if(!fexist(Fajl))
                {
                    new poz = random(sizeof(RandomKampSpawn));
                    CampInfo[cPosition][0] = RandomKampSpawn[poz][0];
                    CampInfo[cPosition][1] = RandomKampSpawn[poz][1];
                    CampInfo[cPosition][2] = RandomKampSpawn[poz][2];
                    CampInfo[cPosition][3] = RandomKampSpawn[poz][3];
                    CampInfo[cLocked] = 1; CampInfo[cVW] = i;
                    strmid(CampInfo[cOwner], GetName(playerid), 0, strlen(GetName(playerid)), 999);
                    CampInfo[cID] = CreateVehicle(607, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2], CampInfo[cPosition][3], 0, 0, 100);
                    objekt = CreateObject(3171, 0,0,0,0,0,0);
                    AttachObjectToVehicle(objekt, CampInfo[cID], 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090);
                    GivePlayerMoney(playerid,-10000); PlayerInfo[playerid][pCampTrailer] = i;
                    SaveCamp(i); SavePlayer(playerid);
                    ShowPlayerDialog(playerid,INFOBUY_DIALOG,DIALOG_STYLE_MSGBOX,""GREEN"Camp Trailer",""WHITE"You are sucessfuly buy Camp Trailer, use "GREEN"/camptrailer\n"WHITE"If you want to tow trailer use key "GREEN"'Y'"WHITE", for enter in trailer use key "GREEN"'N'","Okey","");
                    break;
                }
            }
        }
    }
    if(dialogid == DIALOG_CAMP)
    {
        if(!response) return 1;
        if(PlayerInfo[playerid][pCampTrailer] == -1) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"Vi ne posjedujete kamp prikolicu!");
        new i = PlayerInfo[playerid][pCampTrailer];
        switch(listitem)
        {
            case 0:
            {
                new kPrikolica[250];
                new z[5]; if(CampInfo[cLocked] == 1) z = "Da"; else z = "Ne";
                format(kPrikolica, sizeof(kPrikolica), ""GREEN"_______________________________\n\n\
                                                       "WHITE"Locked: "WHITE"%s | "WHITE"Owner: "WHITE"%s\n\n\
                                                       "GREEN"_______________________________", z, CampInfo[cOwner]);
                ShowPlayerDialog(playerid, DIALOG_CAMPINFO, DIALOG_STYLE_MSGBOX, ""GREEN"Camp Trailer Info", kPrikolica, "Okey", "");
            }
            case 1:
            {
                new Float:Poz[3];
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                if(!IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2])) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be near your Camp Trailer!");
                if(CampInfo[cLocked] == 0)
                {
                    CampInfo[cLocked] = 1; SaveCamp(i);
                    GameTextForPlayer(playerid, "~w~Camp trailer ~r~locked", 5000, 3);
                }
                else
                {
                    CampInfo[cLocked] = 0; SaveCamp(i);
                    GameTextForPlayer(playerid, "~w~Camp Trailer ~g~unlocked", 5000, 3);
                }
            }
            case 2:
            {
                new Float:Poz[4];
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                GetVehicleZAngle(CampInfo[cID], Poz[3]);
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!IsPlayerInVehicle(playerid,vehicleid)) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be in vehicle!");
                if(!IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2])) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be near your Camp Trailer!");
                if(TowedCamp[playerid] == 1)
                {
                    CampInfo[cPosition][0] = Poz[0]; CampInfo[cPosition][1] = Poz[1];
                    CampInfo[cPosition][2] = Poz[2]; CampInfo[cPosition][3] = Poz[3];
                    DestroyVehicle(CampInfo[cID]);
                    CampInfo[cID] = CreateVehicle(607, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2], CampInfo[cPosition][3], 0, 0, -1);
                    SendClientMessage(playerid,-1,""RED"[!] "WHITE"Camp Trailer sucessfuly parked!");
                    SaveCamp(i); SetVehicleToRespawn(CampInfo[cID]);
                }
                else return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to tow Camp Trailer on vehicle (Key: Y)!");
            }
            case 3:
            {
                new Float:Poz[3]; LocateCamp[playerid] = 1;
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                SetPlayerCheckpoint(playerid, Poz[0], Poz[1], Poz[2], 4.0);
                SendClientMessage(playerid,-1,""GREEN"Your Camp Trailer are marked on radar!");
            }
            case 4:
            {
                new Float:Poz[3];
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                if(!IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2])) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be near your Camp trailer!");
                ShowPlayerDialog(playerid,DIALOG_CAMPSELL,DIALOG_STYLE_MSGBOX,""GREEN"Sell Camp Trailer",""WHITE"Do you want sell your Camp Trailer for $5000?","Sell","Cancel");
            }
        }
    }
    if(dialogid == DIALOG_CAMPSELL)
    {
        if(!response) return SendClientMessage(playerid,-1,""GREEN"You have been withdrawn from the sale of Camp trailer!");
        if(response)
        {
            new i = PlayerInfo[playerid][pCampTrailer];
            DestroyVehicle(CampInfo[cID]); DestroyObject(objekt);
            IzbrisiKampPrikolicu(PlayerInfo[playerid][pCampTrailer]);
            PlayerInfo[playerid][pCampTrailer] = -1;
            GivePlayerMoney(playerid,5000); SavePlayer(playerid);
            SendClientMessage(playerid,-1,""GREEN"You are succesfuly sold your Camp Trailer!");
        }
    }
    return 1;
}
YCMD:camptrailer(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    if(PlayerInfo[playerid][pCampTrailer] == -1) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You are not own Camp Trailer!");
    ShowPlayerDialog(playerid,DIALOG_CAMP,DIALOG_STYLE_LIST,""GREEN"Manage Your Camp trailer",""WHITE"Information\n"RED"Lock"WHITE"/"GREEN"Unlock\n"WHITE"Park\nLocate\nSell","Continue","Cancel");
    return 1;
}
YCMD:buycamp(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 257.0985, -1397.4440, 13.7161)) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You have to be in place for the purchase of camp trailers!");
    if(PlayerInfo[playerid][pCampTrailer] != -1) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You already have Camp Trailer!");
    ShowPlayerDialog(playerid,DIALOG_CAMPBUY,DIALOG_STYLE_MSGBOX,""GREEN"Buy Camp Trailer",""WHITE"Do you want buy Camp Trailer for $10000?","Buy","Cancel");
    return 1;
}
stock IzbrisiKampPrikolicu(id)
{
    new kampFile[32];
    format(kampFile, sizeof(kampFile), CAMP_FILE, id);
    if(fexist(kampFile))
    {
        fremove(kampFile);
    }
    return 1;
}
stock GetName(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(pName == '_') pName = ' ';
    }
    return pName;
}
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("CampTrailer",PlayerInfo[playerid][pCampTrailer]);
    return 1;
}
forward UcitajKamp(id, name[], value[]);
public UcitajKamp(id, name[], value[])
{
    INI_Int("ID", CampInfo[id][cID]);
    INI_Float("X", CampInfo[id][cPosition][0]);
    INI_Float("Y", CampInfo[id][cPosition][1]);
    INI_Float("Z", CampInfo[id][cPosition][2]);
    INI_Float("A", CampInfo[id][cPosition][3]);
    INI_String("Owner", CampInfo[id][cOwner],MAX_PLAYER_NAME);
    INI_Int("Locked", CampInfo[id][cLocked]);
    INI_Int("VirtualWorld", CampInfo[id][cVW]);
    return 1;
}
forward Freeze(playerid);
public Freeze(playerid)
{
    TogglePlayerControllable(playerid, 1);
    GameTextForPlayer(playerid, "~b~Objects succesfuly loaded!", 5000, 4);
    return 1;
}
/////////////////////////////////////////////////////
stock SaveCamp(id)
{
    new kFile[80];
    format(kFile, sizeof(kFile), CAMP_FILE, id);
    new INI:File = INI_Open(kFile);
    INI_WriteInt(File,"ID", CampInfo[id][cID]);
    INI_WriteFloat(File,"X", CampInfo[id][cPosition][0]);
    INI_WriteFloat(File,"Y", CampInfo[id][cPosition][1]);
    INI_WriteFloat(File,"Z", CampInfo[id][cPosition][2]);
    INI_WriteFloat(File,"A", CampInfo[id][cPosition][3]);
    INI_WriteString(File,"Owner", CampInfo[id][cOwner]);
    INI_WriteInt(File,"Locked", CampInfo[id][cLocked]);
    INI_WriteInt(File,"VirtualWorld", CampInfo[id][cVW]);
    INI_Close(File);
    return 1;
}
////////////////////////////////////////////////
stock SavePlayer(playerid)
{
    new INI:File = INI_Open(Campusers(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"CampTrailer",PlayerInfo[playerid][pCampTrailer]);
    INI_Close(File);
    return 1;
}
stock Campusers(playerid)
{
    new string[128];
    format(string,sizeof(string),CAMPUSERS,GetName(playerid));
    return string;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(LocateCamp[playerid] == 1) return DisablePlayerCheckpoint(playerid), LocateCamp[playerid] = 0, GameTextForPlayer(playerid, "~y~CAMP TRAILER LOCATED", 5000, 3);
    return 1;
}[/pawn]
Naslov: Odg: FS mi zbuga GM
Poruka od: Tosic ツ poslato Jul 19, 2017, 19:00:54 POSLE PODNE
Umesto ovoga
[pawn]
enum
{
    DIALOG_CAMPBUY,
    DIALOG_CAMP,
    DIALOG_CAMPSELL,
    DIALOG_CAMPINFO,
    INFOBUY_DIALOG
}
[/pawn]

Ti stavi npr
[pawn]
#define DIALOG_CAMPBUY 13500
#define DIALOG_CAMP 13501
itd itd
[/pawn]
Vidi u skripti koji ti je id slobodan ;)
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 19, 2017, 19:25:46 POSLE PODNE
Ovo je u gamemodu ?
[pawn]//=============================[ Dialozi ]======================================

enum {
   dialog_OSTALO,
   dialog_REGISTER,
   dialog_COUNTRY,
   dialog_AGE,
   dialog_MAIL,
   dialog_ORGANIZACIJA,
   dialog_PHARMACY,
   dialog_ORGCREATE,
   dialog_ORGTIP,
   dialog_MARKETBUY,
   dialog_ORGRANK1,
   dialog_ORGRANK2,
   dialog_ORGRANK3,
   dialog_ORGRANK4,
   dialog_ORGRANK5,
   dialog_ORGRANK6,
   dialog_ORGINT1,
   dialog_ORGINT2,
   dialog_SERVERMI,
   dialog_ADMINI,
   dialog_TAGPROMENI,
   dialog_SUPPORTERI,
   dialog_AKCENAT,
   dialog_NAPRAVISVE,
   dialog_IZBRISISVE,
   dialog_LIDER,
   dialog_UBACIUORG,
   dialog_IZBACIIZORG,
   dialog_DODELIRANK,
   dialog_SVICLANOVI,
   dialog_ORGDELETE,
   dialog_IZMENISVE,
   dialog_ORGEDIT,
   dialog_ORGNAME,
   dialog_ORGRANKS,
   dialog_CLUCKIN,
   dialog_RESTORAN,
   dialog_PIZZA,
   dialog_DRINK,
   dialog_GUNSHOP,
   dialog_FNAME,
   dialog_FEDIT,
   dialog_FSELL,
   dialog_FOPEN,
   dialog_FCLOSE,
   dialog_APOENI,
   dialog_M_ISPIT,
   dialog_PCREATE,
   dialog_VCREATE,
   dialog_KUPIKARTICU,
   dialog_RADIO,
   dialog_A_ISPIT,
   dialog_K_ISPIT,
   dialog_RENTANJE,
   dialog_RVCREATE,
   dialog_PROPERTYWEPTAKE,
   dialog_JOBLIST,
   dialog_JOBLIST_1,
   dialog_EVENTSTART,
   dialog_CREATEEVENT,
   dialog_CREATEEVENT2,
   dialog_BUY_GPS,
   dialog_GPS,
   dialog_FCREATE,
   dialog_FIRMA,
   dialog_FOMONEY,
   dialog_FPMONEY,
   dialog_FINFO,
   dialog_FLOCK,
   dialog_FCNAME,
   dialog_HVCREATE,
   dialog_ORGSPISAK,
   dialog_BURGMENU,
   dialog_C2_ISPIT,
   dialog_C3_ISPIT,
   dialog_HELP,
   dialog_LOGIN,
   dialog_ORGLIST,
   dialog_IMCREATE,
   dialog_ORMAR,
   dialog_BUY_MOBILEPHONE,
   dialog_SEARCH_NAME,
   dialog_SEARCH_NUMBERPLATE,
   dialog_POSTAVIPOTERU,
   dialog_OCISTIDOSIJE,
   dialog_OPREMA,
   dialog_VEHICLEWEPTAKE,
   dialog_MUNIFORM,
   dialog_TAXIOFFER,
   dialog_KIOSK,
   dialog_SPAWNCHANGE,
   dialog_PAYDAY,
   dialog_KREDIT,
   dialog_INFOKREDIT,
   dialog_PROMENARATEKREDITA,
   dialog_BALANCE,
   dialog_RPTEST,
   dialog_BANSTATUS,
   dialog_FDELETE,
   dialog_IMDELETE,
   dialog_OVCREATE,
   dialog_CHANGEPASSWORD,
   dialog_GPS_FIND,
   dialog_VEDIT,
   dialog_VPRICE,
   dialog_ICPRICE,
   dialog_IOPEN,
   dialog_ICLOSE,
   dialog_ISELL,
   dialog_ORGSKINS,
   dialog_IEDIT,
   dialog_WAR,
   dialog_WAR_ZAKAZI_1,
   dialog_WAR_ZAKAZI_2,
   dialog_WAR_ZAKAZI_3,
   dialog_WAR_ZAKAZI_4,
   dialog_WAR_ZAKAZI_5,
   dialog_WAR_ZAKAZI_6,
   dialog_WAR_ZAKAZI_7,
   dialog_WAR_ZAKAZI_8,
   dialog_WARUBACI,
   dialog_WARIZBACI,
   dialog_VIP,
   dialog_IZMENABROJA,
   dialog_DOGLAS,
   dialog_ORGPREFIX,
   dialog_VCOLOR,
   dialog_OFFIZBACIIZORG,
   dialog_ORGDUTYP,
   dialog_ORGEQUIPP,
   dialog_PROPERTYLIST,
   dialog_PROPCHOSEN,
   dialog_PROPUNAPREDI,
   dialog_SAFEPUTDRUG,
   dialog_SAFETAKEDRUG,
   dialog_SAFECHANGEPASS,
   dialog_SAFEUNLOCK,
   dialog_SAFEALL,
   dialog_PROPSELLTP,
   dialog_ACCEPTPROP,
   dialog_ACCEPTFRIMA,
   dialog_FIRMASELLTP,
   dialog_ASMODEL,
   dialog_ASMAXMODEL,
   dialog_VEHCHOSEN,
   dialog_VEHLIST,
   dialog_VEHICLETAKEDRUG,
   dialog_VEHICLEPUTDRUG,
   dialog_GEPEKIZVADI,
   dialog_IVCREATE,
   dialog_PORTABLE,
   dialog_GIVEHIT,
   dialog_HORDER,
   dialog_RESETIRAJ,
   dialog_SELECTSPORT,
   dialog_CREATESPORT,
   dialog_AVCREATE,
   dialog_ANTICHEAT,
   dialog_ANTICHEAT_2,
   dialog_ANTICHEAT_3,
   dialog_PROPSELLDRZAVA,
   dialog_FIRMASELLDRZAVA,
   dialog_POLVCREATE,
   dialog_ORGPORTP,
   dialog_HOTEL,
   dialog_HOTELRENTP,
   dialog_HOTELIZBACI,
   dialog_HPMONEY,
   dialog_HOMONEY,
   dialog_HOTELLOCK,
   dialog_HOTELSELLDRZAVA,
   dialog_HOTELSELLTP,
   dialog_ACCEPTHOTEL,
   dialog_HEDIT,
   dialog_HEPRICE,
   dialog_HELEVEL,
   dialog_POREZ,
   dialog_POREZPAY,
   dialog_EMAIL,
   dialog_CREATEGATE,
   dialog_CREATEGATE_2,
   dialog_CREATEGATE_3,
   dialog_CREATEGATE_4,
   dialog_ORGZSKINS,
   dialog_CREATEVEH,
   dialog_GRCREATE,
   dialog_ORGMAXMEMB,
   dialog_PILOT,
   dialog_BUSVOZACI,
   dialog_CREATEIMANJE,
   dialog_IMANJE,
   dialog_POSADISJEMENKE,
   dialog_KUPOVINASJEMENA,
   dialog_IMANJEDRZAVASELL,
   dialog_IMANJESELLTO,
   dialog_ACCEPTIMANJE,
   dialog_IMEDIT,
   dialog_IMEPRICE,
   dialog_IMELEVEL,
   dialog_GEPEK,
   dialog_GEPEKOSTAVI,
   dialog_IZVADIGAJBICE,
   dialog_SERVERSTATS,
   dialog_SERVERSTATS_2,
   dialog_SERVERSTATS_3,
   dialog_SERVERSTATS_4,
   dialog_SERVERSTATS_5,
   dialog_CREATEGATE_5,
   dialog_CREATEGATE_6,
   dialog_CREATEGARAGE,
   dialog_GARAZA,
   dialog_GARAGELOCK,
   dialog_ACCEPTGARAGE,
   dialog_GARAGESELLDRZAVA,
   dialog_GARAGESELLTP,
   dialog_GEDIT,
   dialog_GEPRICE,
   dialog_GELEVEL,
   dialog_CREATEGPS,
   dialog_GPSEDIT,
   dialog_IZMENAIMENAGPS,
   dialog_IZMENAIMENAGPS2,
   dialog_IZMENAPOZGPS,
   dialog_CREATEAPORT,
   dialog_SELECTAPORT,
   dialog_APORTEDIT,
   dialog_IZMENAIMENAAPORT,
   dialog_IZMENAIMENAAPORT2,
   dialog_IZMENAPOZAPORT,
   dialog_SELECTVPORT,
   dialog_SPORTEDIT,
   dialog_IZMENAIMENASPORT,
   dialog_IZMENAIMENASPORT2,
   dialog_IZMENAPOZSPORT,
   dialog_CREATEJOBBUSSINES,
   dialog_INVENTORY,
   dialog_GIVEQUANTITY,
   dialog_GIVEITEM,
   dialog_ORGDRUGCHOSE,
   dialog_ORGDRUGCHOSE_2,
   dialog_PRCREATE,
   dialog_ASAMMOUNT,
   dialog_SELECTVGUN,
   dialog_TUNING,
   dialog_TUNING_2,
   dialog_VVCREATE,
   dialog_UBACIUORG_2,
   dialog_AUTOSEDIT,
   dialog_ASEDITAMMOUNT,
   dialog_BIRAJLOKACIJU,
   dialog_PROVERIACC,
   dialog_CCTV,
   dialog_RADIOPLAY,
   dialog_LIDER_2,
   dialog_WAR_ZAKAZI_9,
   dialog_SELECTPPORT,
   dialog_OBJEKTI,
   dialog_IZAZOVITRKA,
   dialog_ORGSAFE,
   dialog_ORGSAFEPUT,
   dialog_ORGSAFETAKE,
   dialog_ORGSAFETMONEY,
   dialog_ORGSAFETDRUG,
   dialog_ORGSAFEPMONEY,
   dialog_ORGSAFEPDRUG,
   dialog_VEHCOLOR,
   dialog_VEHSELLTP,
   dialog_ACCEPTVEH,
   dialog_ASKLISTA,
   dialog_ASKLISTA_2,
   dialog_RENTABLE,
   dialog_PROPTAKEMONEY,
   dialog_PROPPUTMONEY,
   dialog_ZAMENA_1,
   dialog_ZAMENA_2,
   dialog_ZAMENA_3,
   dialog_ZAMENA_4,
   dialog_RCONPROVERA,
   dialog_CREATERADAR,
   dialog_UPLATITIKET,
   dialog_UPLATITIKET_2,
   dialog_UPLATITIKET_3,
   dialog_UPLATITIKET_4,
   dialog_DONATORBOJA,
   dialog_GANGZCOLOR,
   dialog_ORGCOLOR,
   dialog_GANGZEDIT,
   dialog_GANGZCOLOREDIT,
   dialog_GANGZID,
   dialog_RULET_1,
   dialog_RULET_2,
   dialog_RULET_3,
   dialog_RULET_4,
   dialog_RULET_5,
   dialog_SAVEZ,
   dialog_VEHMONEYBUY,
   //dialog_VEHGOLDBUY,
   dialog_IZABERITABLICE,
   dialog_IZABERITABLICE_2,
   dialog_DONATE,
   dialog_DONATE_1,
   dialog_VEHICLETAKEMATS,
   dialog_VEHICLEPUTMATS,
   dialog_SAFEPUTMATS,
   dialog_SAFETAKEMATS,
   dialog_CREATEFSTATION,
   dialog_PUMPA,
   dialog_IMEPUMPE,
   dialog_DIZELCENA,
   dialog_BENZINCENA,
   dialog_PLINCENA,
   dialog_GASNOCENA,
   dialog_FCORDEXIT,
   dialog_FEDITTYPE,
   dialog_DELIVERCOCACOLA,
   dialog_DELIVERVILENJAK,
   dialog_NEONSHOP,
   dialog_PARKING,
   dialog_PARKING_2,
   dialog_PARKING_3,
   dialog_fixcar,
   dialog_fixcar2,
   dialog_ADMINVERIFI,
   dialog_STATSIGRACA,
   dialog_SERVERPOSLOVI,
   dialog_SERVERPPLATE,
   dialog_SERVEPLATAKOSAC,
   dialog_SERVERPLATARUDAR,
   dialog_SERVERPLATACCOLA,
   dialog_SERVERPLATAVOCA,
   dialog_SERVERPLATADRVA,
   dialog_SERVERPLATAPILOT,
   dialog_SERVERPLATAGRADJ,
   dialog_SERVERPLATAMEHANICAR,
   dialog_SERVERPLATAKCISTAC,
   dialog_SERVERPLATAKDJUBRE,
   dialog_SERVERPLATAPREVOZN,
   dialog_JOBTAKE_1,
   dialog_JOBTAKE_2,
   dialog_JOBTAKE_3,
   dialog_JOBTAKE_4,
   dialog_JOBTAKE_5,
   dialog_JOBTAKE_6,
   dialog_JOBTAKE_7,
   dialog_JOBTAKE_8,
   dialog_JOBTAKE_9,
   dialog_JOBTAKE_10,
   dialog_JOBTAKE_11,
   dialog_JOBTAKE_12,
   dialog_VEHOGLAS,
   dialog_UPDATE,
   dialog_LASTAB,
   dialog_ELECTRIC,
   dialog_CTRZITE
}
[/pawn]
Kako da znam koji mi je slobodan ? XD
Naslov: Odg: FS mi zbuga GM
Poruka od: Tosic ツ poslato Jul 19, 2017, 19:51:47 POSLE PODNE
Slobodno redjaj onako kao sto sam ti ja rekao ako ti je tako :) od 13500 pa na dalje
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 19, 2017, 20:39:54 POSLE PODNE
[pawn]enum
{
#define DIALOG_CAMBUY 13500
#define DIALOG_CAMP 13501
#define DIALOG_CAMPSELL 13502
#define DIALOG_CAMPINFO 13503
#define INFOBUY_DIALOG 13504
}[/pawn]
Jel treba jos negde nesto da se promeni ?

Dobijem ovaj error : [pawn]C:\Users\Novica\Desktop\Vojin\bckup bitchz\Server\filterscripts\camptrailer.pwn(304) : error 017: undefined symbol "DIALOG_CAMPBUY"
C:\Users\Novica\Desktop\Vojin\bckup bitchz\Server\filterscripts\camptrailer.pwn(430) : error 017: undefined symbol "DIALOG_CAMPBUY"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.[/pawn]
Da idem gore samp new DIALOG_CAMPBUY; ali nigde ne vidim new dialog_camp i to ?
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 19, 2017, 20:47:10 POSLE PODNE
Nasao sam, napisao sam cambuy umesto campbuy.. Nema errora idem da vidim hocel radit pa javim  :D

EDIT: I dalje nece.. :/ Kada idem na login promeni dugme boju, ali ne moze se kliknut.. :/
Aj proveri dal mora jos nesto da se promeni molim te..
[pawn]
/*

This is Camp Trailer System.
Credits: Pachino ( www.facebook.com/ErvinSnoopy )

Dont delete credits. Enjoy :-)

Maded 25.1.2016
*/

#include <a_samp>
#include < YSI\y_ini >
#include < YSI\y_amx >
#include < YSI\y_commands >
#include < sscanf2 >
#include < streamer >
#include < foreach >

//BOJE
#define RED         "{F81414}"
#define WHITE            "{FFFFFF}"
#define YELLOW            "{F3FF02}"
#define GREEN          "{6EF83C}"

enum
{
#define DIALOG_CAMPBUY 13500
#define DIALOG_CAMP 13501
#define DIALOG_CAMPSELL 13502
#define DIALOG_CAMPINFO 13503
#define INFOBUY_DIALOG 13504
}

new LocateCamp[MAX_PLAYERS];
new TowedCamp[MAX_PLAYERS];
new freeze[MAX_PLAYERS];
new EnteredInCamp[MAX_PLAYERS];
new objekt;
////////////////////////////////////////////////////////////////////////////////
#define MAX_KAMP        900
#define CAMP_FILE       "Trailers/%d.ini"
enum kInfo
{
    Float:cPosition[4],
    cOwner[MAX_PLAYER_NAME],
    cID,
    cLocked,
    cVW
}
new CampInfo[MAX_KAMP][kInfo];
////////////////////////////////////////////////////////////////////////////////
new Float:RandomKampSpawn[4][4] =
{
    {257.0985,-1397.4440,13.7161,209.1387},
    {266.8461,-1392.3018,13.8020,194.2435},
    {276.3607,-1384.3616,13.8890,206.1503},
    {285.1536,-1378.3163,13.9568,201.7636}
};
////////////////////////////////////////////////////////////////////////////////
#define CAMPUSERS "Campusers/%s.ini"
enum pInfo
{
    pCampTrailer
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnFilterScriptInit()
{
    CreateObject(14385, 2511.64355, -1725.43652, 779.20868,   0.00000, 0.00000, 0.00000);
    CreateObject(14386, 2511.68457, -1726.33496, 779.07117,   0.00000, 0.00000, 0.00000);
    CreateObject(6959, 2509.99023, -1725.06543, 777.64142,   0.00000, 0.00000, 0.00000);
    CreateObject(5856, 2509.32813, -1728.60352, 779.61633,   0.00000, 0.00000, 0.00000);
    CreateObject(5856, 2508.47363, -1723.26367, 780.11633,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2511.74902, -1732.35547, 780.64136,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2512.50391, -1718.44824, 780.11633,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2508.47168, -1720.57617, 780.11633,   0.00000, 0.00000, 90.00000);
    CreateObject(5856, 2513.87891, -1726.26563, 777.88574,   0.00000, 0.00000, 0.00000);
    CreateObject(1535, 2513.88281, -1729.93542, 777.63409,   0.00000, 0.00000, 90.51917);
    CreateObject(1506, 2513.99487, -1728.44849, 779.47076,   0.00000, 0.00000, 270.26917);
    CreateObject(970, 2511.74805, -1732.07617, 778.16162,   90.00000, 179.99451, 0.00000);
    CreateObject(970, 2509.78320, -1732.34277, 778.18854,   90.00000, 168.45886, 281.53564);
    CreateObject(970, 2513.58301, -1732.32410, 778.08844,   90.00000, 165.52246, 104.47751);
    CreateObject(970, 2513.65479, -1725.87256, 778.06342,   90.00000, 191.09619, 78.89282);
    CreateObject(970, 2513.97803, -1726.01221, 778.08276,   90.00000, 179.99451, 359.00000);
    CreateObject(970, 2513.85938, -1725.26660, 778.63898,   90.00000, 179.99451, 0.00000);
    CreateObject(970, 2513.40234, -1723.74805, 778.63898,   90.00000, 179.99451, 90.00000);
    CreateObject(970, 2513.82715, -1725.81848, 778.18854,   0.00000, 0.00000, 0.00000);
    CreateObject(1271, 2509.66895, -1727.24316, 779.76306,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2509.91040, -1729.96411, 779.80548,   0.00000, 0.00000, 0.00000);
    CreateObject(970, 2510.55396, -1720.80042, 778.18854,   0.00000, 90.00000, 269.98901);
    CreateObject(970, 2510.74414, -1719.35400, 778.06342,   90.00000, 180.00549, 178.74170);
    CreateObject(2238, 2513.51245, -1724.43384, 779.59894,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.54004, -1723.88220, 779.57098,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.49609, -1722.42236, 779.68225,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.49609, -1721.91296, 779.62988,   0.00000, 0.00000, 0.00000);
    CreateObject(2238, 2513.51782, -1723.09290, 779.81281,   0.00000, 90.00000, 89.99994);
    CreateObject(2238, 2509.82715, -1726.54150, 780.41589,   0.00000, 1.24695, 0.00000);
    CreateObject(2238, 2510.29443, -1726.65588, 778.85077,   0.00000, 0.00000, 18.00000);
    CreateObject(14811, 2503.91211, -1725.65723, 780.97998,   0.00000, 0.00000, 179.99451);
    CreateObject(14792, 2524.25366, -1730.83765, 770.23480,   0.00000, 270.00000, 84.74207);
    CreateObject(3882, 2507.34399, -1730.58899, 778.89697,   0.00000, 0.00000, 270.00000);
    CreateObject(3882, 2515.62158, -1727.21484, 778.73315,   0.00000, 0.00000, 173.50000);
    CreateObject(14792, 2499.67480, -1731.37695, 777.90527,   0.00000, 179.99451, 0.24719);
    CreateObject(3882, 2507.34375, -1730.58594, 779.45837,   0.00000, 0.00000, 270.00000);
    CreateObject(3882, 2507.34180, -1729.19165, 780.48315,   0.00000, 270.00000, 272.00000);
    CreateObject(3882, 2507.34302, -1728.20898, 776.28320,   0.00330, 89.74979, 266.49097);
    CreateObject(3119, 2511.17334, -1731.36597, 778.46405,   0.00000, 0.00000, 279.99756);
    CreateObject(14633, 2498.01660, -1727.52539, 780.12848,   0.00000, 0.00000, 229.49890);
    CreateObject(2801, 2512.41235, -1725.27368, 778.33301,   0.00000, 0.00000, 160.00000);
    CreateObject(18059, 2503.31372, -1726.64905, 779.76477,   270.79053, 341.55078, 341.55261);
    CreateObject(14399, 2502.31055, -1729.33398, 782.71124,   0.00000, 179.99451, 0.00000);
    CreateObject(14399, 2507.34692, -1723.35071, 777.56036,   359.97723, 90.24921, 359.99988);
    CreateObject(14827, 2506.91602, -1715.21484, 778.83691,   0.00000, 0.00000, 270.00000);
    CreateObject(951, 2514.33398, -1729.16504, 778.62836,   0.00000, 0.00000, 90.00000);
    CreateObject(14515, 2480.00684, -1686.86035, 778.87195,   0.00000, 0.00000, 91.99402);
    CreateObject(14515, 2510.33594, -1711.49023, 778.10120,   0.00000, 0.00000, 0.48889);
    CreateObject(14515, 2542.93457, -1703.63281, 777.85095,   0.00000, 179.49463, 269.98901);
    CreateObject(14515, 2542.21289, -1768.89941, 779.00488,   0.00000, 0.00000, 270.24719);
    CreateObject(18105, 2513.10962, -1738.30774, 781.04999,   0.00000, 0.00000, 89.75000);
    CreateObject(18109, 2518.55176, -1718.56738, 779.46002,   0.00000, 0.00000, 359.74731);
    CreateObject(2074, 2512.24878, -1727.47363, 779.84137,   0.00000, 0.00000, 338.25000);
    CreateObject(2342, 2512.08130, -1730.60217, 778.27698,   0.00000, 0.00000, 90.50000);
    CreateObject(2213, 2512.46143, -1727.53589, 778.55298,   334.64355, 23.07678, 342.83923);
    CreateObject(2212, 2514.13452, -1724.98169, 778.72101,   334.41833, 23.12863, 77.69974);
    CreateObject(14651, 2514.03516, -1729.05273, 782.37476,   0.00000, 179.99451, 89.99451);
    CreateObject(2486, 2513.62598, -1728.41602, 780.11041,   0.00000, 0.00000, 354.99573);
    CreateObject(2542, 2509.67285, -1727.23926, 780.11279,   7.24548, 0.00000, 90.48889);
    CreateObject(14863, 2514.41626, -1721.61475, 777.73029,   358.25043, 1.25058, 100.03818);
    CreateObject(14521, 2516.21582, -1719.97852, 777.89374,   359.00024, 355.74829, 56.92566);
    CreateObject(14521, 2512.98560, -1717.36743, 777.76862,   0.00000, 0.00000, 356.99609);
    CreateObject(2846, 2509.38184, -1725.77344, 779.51123,   0.98877, 72.27356, 274.89990);
    CreateObject(15027, 2515.75171, -1721.22876, 778.91803,   358.75031, 1.25030, 316.02731);
    CreateObject(15028, 2508.43262, -1728.42773, 778.88507,   5.49316, 1.50513, 137.85095);
    CreateObject(8251, 2501.36523, -1720.72363, 779.16528,   0.00000, 179.99451, 0.24719);
    CreateObject(3069, 2509.57324, -1716.11426, 778.48383,   0.00000, 269.74182, 173.73779);
    CreateObject(2768, 2512.41431, -1727.64221, 778.57001,   0.00000, 0.00000, 90.00000);
    CreateObject(2215, 2513.61768, -1725.02319, 778.71051,   334.46390, 23.40106, 10.56726);
    CreateObject(1510, 2511.97144, -1727.27576, 778.53699,   0.00000, 0.00000, 0.00000);
    CreateObject(1485, 2511.78125, -1727.24219, 778.56299,   0.00000, 4.25000, 0.00000);
    CreateObject(3503, 2512.20288, -1727.49988, 777.14349,   0.00000, 0.00000, 179.99719);
    CreateObject(1897, 2510.34766, -1723.40527, 777.56226,   0.00000, 179.99451, 270.00000);
    CreateObject(14482, 2517.00391, -1733.34473, 778.15485,   0.00000, 0.00000, 270.00000);
    CreateObject(2006, 2510.07617, -1726.57227, 779.75000,   90.00000, 0.00000, 5.50000);
    CreateObject(1933, 2512.23779, -1727.38184, 778.43787,   0.00000, 0.00000, 0.00000);
    CreateObject(1916, 2512.12622, -1727.17908, 778.51294,   0.00000, 0.00000, 0.00000);
    CreateObject(2141, 2513.40967, -1721.14746, 777.66742,   0.00000, 0.00000, 269.74731);
    CreateObject(14802, 2516.44873, -1716.70764, 778.92389,   0.00000, 0.00000, 182.50000);
    CreateObject(2372, 2510.67285, -1725.29980, 777.46191,   0.00000, 0.00000, 0.24719);
    CreateObject(11353, 2509.90430, -1706.01855, 781.41321,   0.00000, 270.00000, 0.00000);
    CreateObject(3002, 2510.08984, -1726.57910, 779.82001,   0.00000, 0.00000, 249.99939);
    CreateObject(11292, 2507.32617, -1722.26172, 779.37451,   0.00000, 0.00000, 269.74731);
    CreateObject(11292, 2505.13867, -1730.87988, 780.05017,   0.00000, 0.00000, 179.99451);
    CreateObject(5856, 2510.47266, -1718.52710, 780.11633,   0.00000, 0.00000, 180.00000);
    CreateObject(2225, 2511.54834, -1730.32129, 778.16162,   0.00000, 180.00000, 0.25000);
    CreateObject(2812, 2509.82324, -1723.68848, 778.48224,   0.00000, 0.00000, 340.75000);
    CreateObject(2816, 2510.21362, -1731.61340, 778.29999,   357.50092, 1.50143, 332.81543);
    CreateObject(2813, 2509.28662, -1729.17590, 779.66187,   275.53827, 263.26288, 82.82956);
    CreateObject(2813, 2509.34277, -1729.13794, 779.52472,   70.22913, 87.48904, 356.76605);
    CreateObject(2831, 2510.16040, -1724.59290, 778.70001,   0.00000, 0.00000, 156.00000);
    CreateObject(2827, 2509.64233, -1727.96570, 778.78723,   0.00000, 359.50000, 25.75000);
    CreateObject(2827, 2509.54468, -1727.57922, 778.67438,   43.50488, 90.23724, 266.40210);
    CreateObject(2824, 2513.54150, -1726.11646, 778.28772,   359.08655, 1.00000, 89.42963);
    CreateObject(2853, 2509.61719, -1727.18042, 778.94037,   0.74985, 180.25049, 70.24658);
    CreateObject(14830, 2498.98999, -1721.88245, 779.26385,   0.00000, 0.00000, 270.25000);
    CreateObject(2247, 2510.05200, -1723.52014, 780.00183,   334.13693, 349.43109, 160.84692);
    CreateObject(2684, 2511.98950, -1727.61658, 778.54401,   271.03418, 299.16052, 219.31554);
    CreateObject(1324, 2511.34741, -1720.61023, 779.22156,   0.00000, 0.50000, 269.50000);
    CreateObject(7313, 2509.38794, -1728.04419, 776.30499,   359.75122, 269.97278, 90.50012);
    CreateObject(7313, 2509.39185, -1728.04468, 776.06177,   359.74731, 269.97253, 90.24695);
    CreateObject(12954, 2509.72559, -1735.59570, 772.49335,   338.10974, 269.99451, 179.93958);
    CreateObject(1897, 2510.03979, -1729.11389, 778.63708,   89.73633, 72.40540, 287.50391);
    CreateObject(2860, 2513.73828, -1721.21521, 780.16400,   0.00000, 0.00000, 164.00000);
    CreateObject(1209, 2513.19287, -1721.95972, 778.08490,   0.00000, 270.00000, 90.00000);
    CreateObject(2558, 2514.14819, -1727.60510, 778.66211,   0.00000, 0.00000, 90.00000);
    CreateObject(2872, 2509.50293, -1727.84033, 777.83728,   344.75000, 0.00000, 106.50000);
    CreateObject(18866, 2511.70630, -1730.56201, 778.14502,   0.00000, 0.00000, 40.00000);
    CreateObject(18644, 2513.01465, -1724.63196, 778.70099,   90.00000, 0.00000, 250.00000);
    CreateObject(18635, 2513.01611, -1725.57214, 778.66998,   90.00000, 111.00000, 0.00000);
    CreateObject(2673, 2509.37109, -1728.60034, 779.81000,   0.00000, 0.00000, 239.00000);
    //==========================================================================
    for(new i = 0; i < sizeof(CampInfo); i++)
    {
        new kFile[50];
        format(kFile, sizeof(kFile), CAMP_FILE, i);
        if(fexist(kFile))
        {
            INI_ParseFile(kFile, "UcitajKamp", .bExtra = true, .extra = i);
            CampInfo[cID] = CreateVehicle(607, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2], CampInfo[cPosition][3], 0, 0, -1);
            objekt = CreateObject(3171, 0,0,0,0,0,0);
            AttachObjectToVehicle(objekt, CampInfo[cID], 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090);
        }
    }
    CreateDynamicPickup(19132, 1, 257.0985,-1397.4440,13.7161);
    CreateDynamic3DTextLabel(""WHITE"[ "GREEN"/buycamp "WHITE"]",-1,257.0985,-1397.4440,13.7161, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
    return 1;
}
public OnFilterScriptExit()
{
    foreach(Player, i)
    {
        KillTimer(freeze);
    }
    return 1;
}
public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][pCampTrailer] = -1; TowedCamp[playerid] = 0;
    EnteredInCamp[playerid] = 0;
    if(fexist(Campusers(playerid)))
    {
        INI_ParseFile(Campusers(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    }
    return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_NO)
    {
        for(new i; i < MAX_KAMP; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 4.0, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2]))
            {
                if(EnteredInCamp[playerid] == 0)
                {
                    GameTextForPlayer(playerid, "~y~Objects loading...", 5000, 4);
                    freeze[playerid] = SetTimerEx("Freeze",3000, false, "i", playerid);
                    TogglePlayerControllable(playerid, 0);
                    SetPlayerPos(playerid, 2513.19897, -1729.12073, 778.67657);
                    SetPlayerVirtualWorld(playerid, CampInfo[cVW]);
                    EnteredInCamp[playerid] = 1;
                }
            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2513.19897, -1729.12073, 778.67657))
            {
                if(EnteredInCamp[playerid] == 1)
                {
                    SetPlayerPos(playerid, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2]);
                    SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0);
                    EnteredInCamp[playerid] = 0;
                }
            }
        }
    }
    if(newkeys & KEY_YES)
    {
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new i = PlayerInfo[playerid][pCampTrailer];
            new Float:Poz[3];
            GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
            if(IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2]))
            {
                if(TowedCamp[playerid] == 0)
                {
                    objekt = CreateObject(3171, 0,0,0,0,0,0);
                    new vehicleid = GetPlayerVehicleID(playerid);
                    AttachObjectToVehicle(objekt, CampInfo[cID], 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090);
                    AttachTrailerToVehicle(CampInfo[cID], vehicleid); TowedCamp[playerid] = 1;
                    SendClientMessage(playerid,-1,""GREEN"You are sucessfuly towed Camp Trailer!");
                }
                else if(TowedCamp[playerid] == 1)
                {
                    new newcartr = GetPlayerVehicleID(playerid);
                    if(IsTrailerAttachedToVehicle(newcartr))
                    {
                        new vehicleid = GetPlayerVehicleID(playerid);
                        DetachTrailerFromVehicle(vehicleid);
                        TowedCamp[playerid] = 0;
                        SendClientMessage(playerid,-1,""GREEN"You are sucessfuly untowed Camp Trailer!");
                    }
                }
            }
        }
    }
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    if(EnteredInCamp[playerid] == 1)
    {
        EnteredInCamp[playerid] = 0; SetPlayerVirtualWorld(playerid, 0);
    }
    if(TowedCamp[playerid] == 1)
    {
        TowedCamp[playerid] = 0;
    }
    return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
    for(new i; i < MAX_KAMP; i++)
    {
        if(vehicleid == CampInfo[cID])
        {
            DestroyObject(objekt);
        }
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_CAMPBUY)
    {
        if(!response) return SendClientMessage(playerid,-1,""WHITE"You are exit from Camp Trailer Buy Menu!");
        if(response)
        {
            if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You dont have money!");
            for(new i = 0; i < sizeof(CampInfo); i++)
            {
                new Fajl[64];
                format(Fajl, sizeof(Fajl), CAMP_FILE, i);
                if(!fexist(Fajl))
                {
                    new poz = random(sizeof(RandomKampSpawn));
                    CampInfo[cPosition][0] = RandomKampSpawn[poz][0];
                    CampInfo[cPosition][1] = RandomKampSpawn[poz][1];
                    CampInfo[cPosition][2] = RandomKampSpawn[poz][2];
                    CampInfo[cPosition][3] = RandomKampSpawn[poz][3];
                    CampInfo[cLocked] = 1; CampInfo[cVW] = i;
                    strmid(CampInfo[cOwner], GetName(playerid), 0, strlen(GetName(playerid)), 999);
                    CampInfo[cID] = CreateVehicle(607, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2], CampInfo[cPosition][3], 0, 0, 100);
                    objekt = CreateObject(3171, 0,0,0,0,0,0);
                    AttachObjectToVehicle(objekt, CampInfo[cID], 0.084999, -2.125115, -1.144999, -3.014999, 0.000000, 178.890090);
                    GivePlayerMoney(playerid,-10000); PlayerInfo[playerid][pCampTrailer] = i;
                    SaveCamp(i); SavePlayer(playerid);
                    ShowPlayerDialog(playerid,INFOBUY_DIALOG,DIALOG_STYLE_MSGBOX,""GREEN"Camp Trailer",""WHITE"You are sucessfuly buy Camp Trailer, use "GREEN"/camptrailer\n"WHITE"If you want to tow trailer use key "GREEN"'Y'"WHITE", for enter in trailer use key "GREEN"'N'","Okey","");
                    break;
                }
            }
        }
    }
    if(dialogid == DIALOG_CAMP)
    {
        if(!response) return 1;
        if(PlayerInfo[playerid][pCampTrailer] == -1) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"Vi ne posjedujete kamp prikolicu!");
        new i = PlayerInfo[playerid][pCampTrailer];
        switch(listitem)
        {
            case 0:
            {
                new kPrikolica[250];
                new z[5]; if(CampInfo[cLocked] == 1) z = "Da"; else z = "Ne";
                format(kPrikolica, sizeof(kPrikolica), ""GREEN"_______________________________\n\n\
                                                       "WHITE"Locked: "WHITE"%s | "WHITE"Owner: "WHITE"%s\n\n\
                                                       "GREEN"_______________________________", z, CampInfo[cOwner]);
                ShowPlayerDialog(playerid, DIALOG_CAMPINFO, DIALOG_STYLE_MSGBOX, ""GREEN"Camp Trailer Info", kPrikolica, "Okey", "");
            }
            case 1:
            {
                new Float:Poz[3];
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                if(!IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2])) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be near your Camp Trailer!");
                if(CampInfo[cLocked] == 0)
                {
                    CampInfo[cLocked] = 1; SaveCamp(i);
                    GameTextForPlayer(playerid, "~w~Camp trailer ~r~locked", 5000, 3);
                }
                else
                {
                    CampInfo[cLocked] = 0; SaveCamp(i);
                    GameTextForPlayer(playerid, "~w~Camp Trailer ~g~unlocked", 5000, 3);
                }
            }
            case 2:
            {
                new Float:Poz[4];
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                GetVehicleZAngle(CampInfo[cID], Poz[3]);
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!IsPlayerInVehicle(playerid,vehicleid)) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be in vehicle!");
                if(!IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2])) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be near your Camp Trailer!");
                if(TowedCamp[playerid] == 1)
                {
                    CampInfo[cPosition][0] = Poz[0]; CampInfo[cPosition][1] = Poz[1];
                    CampInfo[cPosition][2] = Poz[2]; CampInfo[cPosition][3] = Poz[3];
                    DestroyVehicle(CampInfo[cID]);
                    CampInfo[cID] = CreateVehicle(607, CampInfo[cPosition][0], CampInfo[cPosition][1], CampInfo[cPosition][2], CampInfo[cPosition][3], 0, 0, -1);
                    SendClientMessage(playerid,-1,""RED"[!] "WHITE"Camp Trailer sucessfuly parked!");
                    SaveCamp(i); SetVehicleToRespawn(CampInfo[cID]);
                }
                else return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to tow Camp Trailer on vehicle (Key: Y)!");
            }
            case 3:
            {
                new Float:Poz[3]; LocateCamp[playerid] = 1;
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                SetPlayerCheckpoint(playerid, Poz[0], Poz[1], Poz[2], 4.0);
                SendClientMessage(playerid,-1,""GREEN"Your Camp Trailer are marked on radar!");
            }
            case 4:
            {
                new Float:Poz[3];
                GetVehiclePos(CampInfo[cID], Poz[0], Poz[1], Poz[2]);
                if(!IsPlayerInRangeOfPoint(playerid, 6.0, Poz[0], Poz[1], Poz[2])) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You need to be near your Camp trailer!");
                ShowPlayerDialog(playerid,DIALOG_CAMPSELL,DIALOG_STYLE_MSGBOX,""GREEN"Sell Camp Trailer",""WHITE"Do you want sell your Camp Trailer for $5000?","Sell","Cancel");
            }
        }
    }
    if(dialogid == DIALOG_CAMPSELL)
    {
        if(!response) return SendClientMessage(playerid,-1,""GREEN"You have been withdrawn from the sale of Camp trailer!");
        if(response)
        {
            new i = PlayerInfo[playerid][pCampTrailer];
            DestroyVehicle(CampInfo[cID]); DestroyObject(objekt);
            IzbrisiKampPrikolicu(PlayerInfo[playerid][pCampTrailer]);
            PlayerInfo[playerid][pCampTrailer] = -1;
            GivePlayerMoney(playerid,5000); SavePlayer(playerid);
            SendClientMessage(playerid,-1,""GREEN"You are succesfuly sold your Camp Trailer!");
        }
    }
    return 1;
}
YCMD:camptrailer(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    if(PlayerInfo[playerid][pCampTrailer] == -1) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You are not own Camp Trailer!");
    ShowPlayerDialog(playerid,DIALOG_CAMP,DIALOG_STYLE_LIST,""GREEN"Manage Your Camp trailer",""WHITE"Information\n"RED"Lock"WHITE"/"GREEN"Unlock\n"WHITE"Park\nLocate\nSell","Continue","Cancel");
    return 1;
}
YCMD:buycamp(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 257.0985, -1397.4440, 13.7161)) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You have to be in place for the purchase of camp trailers!");
    if(PlayerInfo[playerid][pCampTrailer] != -1) return SendClientMessage(playerid,-1,""RED"[!] "WHITE"You already have Camp Trailer!");
    ShowPlayerDialog(playerid,DIALOG_CAMPBUY,DIALOG_STYLE_MSGBOX,""GREEN"Buy Camp Trailer",""WHITE"Do you want buy Camp Trailer for $10000?","Buy","Cancel");
    return 1;
}
stock IzbrisiKampPrikolicu(id)
{
    new kampFile[32];
    format(kampFile, sizeof(kampFile), CAMP_FILE, id);
    if(fexist(kampFile))
    {
        fremove(kampFile);
    }
    return 1;
}
stock GetName(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(pName == '_') pName = ' ';
    }
    return pName;
}
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("CampTrailer",PlayerInfo[playerid][pCampTrailer]);
    return 1;
}
forward UcitajKamp(id, name[], value[]);
public UcitajKamp(id, name[], value[])
{
    INI_Int("ID", CampInfo[id][cID]);
    INI_Float("X", CampInfo[id][cPosition][0]);
    INI_Float("Y", CampInfo[id][cPosition][1]);
    INI_Float("Z", CampInfo[id][cPosition][2]);
    INI_Float("A", CampInfo[id][cPosition][3]);
    INI_String("Owner", CampInfo[id][cOwner],MAX_PLAYER_NAME);
    INI_Int("Locked", CampInfo[id][cLocked]);
    INI_Int("VirtualWorld", CampInfo[id][cVW]);
    return 1;
}
forward Freeze(playerid);
public Freeze(playerid)
{
    TogglePlayerControllable(playerid, 1);
    GameTextForPlayer(playerid, "~b~Objects succesfuly loaded!", 5000, 4);
    return 1;
}
/////////////////////////////////////////////////////
stock SaveCamp(id)
{
    new kFile[80];
    format(kFile, sizeof(kFile), CAMP_FILE, id);
    new INI:File = INI_Open(kFile);
    INI_WriteInt(File,"ID", CampInfo[id][cID]);
    INI_WriteFloat(File,"X", CampInfo[id][cPosition][0]);
    INI_WriteFloat(File,"Y", CampInfo[id][cPosition][1]);
    INI_WriteFloat(File,"Z", CampInfo[id][cPosition][2]);
    INI_WriteFloat(File,"A", CampInfo[id][cPosition][3]);
    INI_WriteString(File,"Owner", CampInfo[id][cOwner]);
    INI_WriteInt(File,"Locked", CampInfo[id][cLocked]);
    INI_WriteInt(File,"VirtualWorld", CampInfo[id][cVW]);
    INI_Close(File);
    return 1;
}
////////////////////////////////////////////////
stock SavePlayer(playerid)
{
    new INI:File = INI_Open(Campusers(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"CampTrailer",PlayerInfo[playerid][pCampTrailer]);
    INI_Close(File);
    return 1;
}
stock Campusers(playerid)
{
    new string[128];
    format(string,sizeof(string),CAMPUSERS,GetName(playerid));
    return string;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(LocateCamp[playerid] == 1) return DisablePlayerCheckpoint(playerid), LocateCamp[playerid] = 0, GameTextForPlayer(playerid, "~y~CAMP TRAILER LOCATED", 5000, 3);
    return 1;
}[/pawn]

Da nije do includa ovih na vrhu?
Naslov: Odg: FS mi zbuga GM
Poruka od: Tosic ツ poslato Jul 19, 2017, 20:56:54 POSLE PODNE
Bez enuma.. Enum ti tu ne treba
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 19, 2017, 21:03:44 POSLE PODNE
Nece opet.. Da nije do ovoga : [pawn]#include <a_samp>
#include < YSI\y_ini >
#include < YSI\y_amx >
#include < YSI\y_commands >
#include < sscanf2 >
#include < streamer >
#include < foreach >[/pawn]
Ove YSI? Posto moj mod koristi npr ne YCMD, vec CMD:
Naslov: Odg: FS mi zbuga GM
Poruka od: Tosic ツ poslato Jul 20, 2017, 12:11:36 POSLE PODNE
Ma nisi ti to dobro definisao sigurno.
Naslov: Odg: FS mi zbuga GM
Poruka od: Vojinxt125x poslato Jul 20, 2017, 18:28:01 POSLE PODNE
[pawn]#define DIALOG_CAMPBUY 13500
#define DIALOG_CAMP 13501
#define DIALOG_CAMPSELL 13502
#define DIALOG_CAMPINFO 13503
#define INFOBUY_DIALOG 13504[/pawn]
Ne znam da li treba jos nesto da definisem ?  :'(