Pomoc oko Kamp Kucice

Započeo inside
27. Nov. 2021. Zaključano
1,596
pregleda
27
postova
gottinho
4
Made Man
27. Nov. 2021.
Problem(error/warning): Kamp kucice, se nece sejvati u data bazu https://imgur.com/a/25pGCZw
Deo skripte:
Pawno Code:
CMD:kupiprikolicu(playerid)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 843.9586,1086.0125,1075.1802)) return SendErrorMessage( playerid , "Niste na mestu kupovine prikolica (u CAMP SHOP-u)!");
if( IsPlayerHaveAPrivateVehicle( playerid ) == -1) return SendErrorMessage(playerid,"Ne posedujete nijedno vozilo!");
if(PlayerInfo[ playerid ][ xCampKucicaID ] != -1) return SCM(playerid,-1,""col_white"Vec posedujete kamp kucicu!");
if( PlayerInfo[ playerid ][ xNovac ] < 500000 ) return SendErrorMessage( playerid, "Nemate dovoljno novca ( 500.000$ ) .");

KGEyes_GivePlayerMoney( playerid, -500000);
new IDCampTr = NextCampTr();
ctInformacije = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaID ] = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaSqlID ] = ctInformacije;
sql_user_update_intandmoney( playerid, "camptrailer_id", PlayerInfo[ playerid ][ xCampKucicaSqlID ] );

ctInformacije[ IDCampTr ][ ctVlasnik_SqlID ] = PlayerInfo[ playerid ][ xID ];

ctInformacije = 1;
ctInformacije = IDCampTr;
new poz = random(sizeof(RandomCampShopSpawn));
ctInformacije = RandomCampShopSpawn;
ctInformacije = RandomCampShopSpawn;
ctInformacije = RandomCampShopSpawn;
ctInformacije = RandomCampShopSpawn;

CampTrailerVehicle = KGEyes_CreateVehicle(607,ctInformacije,ctInformacije,ctInformacije,ctInformacije,1,1,2400);
CampTrailerObject = CreateDynamicObject(3171, 0,0,0,0,0,0,80 );
AttachDynamicObjectToVehicle(CampTrailerObject, CampTrailerVehicle, 0.084999, -1.900115, -1.144999, -3.014999, 0.000000, 178.890090);

new Float: xPos,
        Float: yPos,
        Float: zPos;

    GetVehicleRelativePos(CampTrailerVehicle, xPos, yPos, zPos, diff_x, diff_y);

    ctInformacije =  xPos;
ctInformacije =  yPos;
ctInformacije =  zPos + 0.37 ;

ctInformacije =  0.0;
ctInformacije =  0.0;
ctInformacije =  0.0;

ctInformacije = 2512.9333;
ctInformacije = -1729.1531;
ctInformacije =  778.6371;
ctInformacije[ IDCampTr ][ ctTypeTxt ] = 0;
ctInformacije[ IDCampTr ][ ctSecurity ] = 0;
ctInformacije[ IDCampTr ][ ctTypeInt ] = 0;
ctInformacije[ IDCampTr ][ ctTypeNeon ] = 0;
ctInformacije[ IDCampTr ][ ctSef ] = 0;
ctInformacije[ IDCampTr ][ ctFrizider ] = 0;
ctInformacije[ IDCampTr ][ ctNovac ] = 0;
ctInformacije[ IDCampTr ][ ctPice ] = 0;
ctInformacije[ IDCampTr ][ ctLocked ] = 0;
ctInformacije[ IDCampTr ][ ctTypeTrailer ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 0 ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 1 ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 2 ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 3 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 0 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 1 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 2 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 3 ] = 0;

strmid( ctInformacije[ IDCampTr ][ ctOwner ], ImeIgraca( playerid ), 0, strlen( ImeIgraca( playerid ) ), MAX_PLAYER_NAME );

  sql_create_camptrailer( playerid, IDCampTr);

  Camp_Refresh( IDCampTr, 1);
   
    SendInfoMessage(playerid, "Cestitamo, kupili ste kamp kucicu!");
return 1;
}
Garadooo
5
Forum Don
27. Nov. 2021.
sql_create_camptrailer( playerid, IDCampTr);
gottinho
4
Made Man
27. Nov. 2021.
Galardo wrote on November 27, 2021, 3:30 pm:
sql_create_camptrailer( playerid, IDCampTr);
tu je vec brt
 strmid( ctInformacije[ IDCampTr ][ ctOwner ], ImeIgraca( playerid ), 0, strlen( ImeIgraca( playerid ) ), MAX_PLAYER_NAME );

  sql_create_camptrailer( playerid, IDCampTr);

  Camp_Refresh( IDCampTr, 1);
Garadooo
5
Forum Don
27. Nov. 2021.
A L M E X wrote on November 27, 2021, 3:40 pm:
tu je vec brt
 strmid( ctInformacije[ IDCampTr ][ ctOwner ], ImeIgraca( playerid ), 0, strlen( ImeIgraca( playerid ) ), MAX_PLAYER_NAME );

  sql_create_camptrailer( playerid, IDCampTr);

  Camp_Refresh( IDCampTr, 1);

Jesi li pokusao da zavirsi u tu funkciju?  🙄
gottinho
4
Made Man
27. Nov. 2021.
Galardo wrote on November 27, 2021, 4:24 pm:
Jesi li pokusao da zavirsi u tu funkciju?  🙄
Da, ali ne shvatam u cemu je problem stvarno
Muma Rascall
6
Forum Don
27. Nov. 2021.
A L M E X wrote on November 27, 2021, 4:41 pm:
Da, ali ne shvatam u cemu je problem stvarno


Daj vamo code
gottinho
4
Made Man
27. Nov. 2021.
мυмα wrote on November 27, 2021, 4:57 pm:
Daj vamo code
gore ti je citav kod, mogu ti poslati modul pod nazivom campTrailers, pa da vidis cijeli kod, ali evo kod koji je u CMD:kupiprikolicu
CMD:kupiprikolicu(playerid)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 843.9586,1086.0125,1075.1802)) return SendErrorMessage( playerid , "Niste na mestu kupovine prikolica (u CAMP SHOP-u)!");
if( IsPlayerHaveAPrivateVehicle( playerid ) == -1) return SendErrorMessage(playerid,"Ne posedujete nijedno vozilo!");
if(PlayerInfo[ playerid ][ xCampKucicaID ] != -1) return SCM(playerid,-1,""col_white"Vec posedujete kamp kucicu!");
if( PlayerInfo[ playerid ][ xNovac ] < 500000 ) return SendErrorMessage( playerid, "Nemate dovoljno novca ( 500.000$ ) .");

KGEyes_GivePlayerMoney( playerid, -500000);
new IDCampTr = NextCampTr();
ctInformacije = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaID ] = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaSqlID ] = ctInformacije;
sql_user_update_intandmoney( playerid, "camptrailer_id", PlayerInfo[ playerid ][ xCampKucicaSqlID ] );

ctInformacije[ IDCampTr ][ ctVlasnik_SqlID ] = PlayerInfo[ playerid ][ xID ];

ctInformacije = 1;
ctInformacije = IDCampTr;
new poz = random(sizeof(RandomCampShopSpawn));
ctInformacije = RandomCampShopSpawn;
ctInformacije = RandomCampShopSpawn;
ctInformacije = RandomCampShopSpawn;
ctInformacije = RandomCampShopSpawn;

CampTrailerVehicle = KGEyes_CreateVehicle(607,ctInformacije,ctInformacije,ctInformacije,ctInformacije,1,1,2400);
CampTrailerObject = CreateDynamicObject(3171, 0,0,0,0,0,0,80 );
AttachDynamicObjectToVehicle(CampTrailerObject, CampTrailerVehicle, 0.084999, -1.900115, -1.144999, -3.014999, 0.000000, 178.890090);

new Float: xPos,
        Float: yPos,
        Float: zPos;

    GetVehicleRelativePos(CampTrailerVehicle, xPos, yPos, zPos, diff_x, diff_y);

    ctInformacije =  xPos;
ctInformacije =  yPos;
ctInformacije =  zPos + 0.37 ;

ctInformacije =  0.0;
ctInformacije =  0.0;
ctInformacije =  0.0;

ctInformacije = 2512.9333;
ctInformacije = -1729.1531;
ctInformacije =  778.6371;
ctInformacije[ IDCampTr ][ ctTypeTxt ] = 0;
ctInformacije[ IDCampTr ][ ctSecurity ] = 0;
ctInformacije[ IDCampTr ][ ctTypeInt ] = 0;
ctInformacije[ IDCampTr ][ ctTypeNeon ] = 0;
ctInformacije[ IDCampTr ][ ctSef ] = 0;
ctInformacije[ IDCampTr ][ ctFrizider ] = 0;
ctInformacije[ IDCampTr ][ ctNovac ] = 0;
ctInformacije[ IDCampTr ][ ctPice ] = 0;
ctInformacije[ IDCampTr ][ ctLocked ] = 0;
ctInformacije[ IDCampTr ][ ctTypeTrailer ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 0 ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 1 ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 2 ] = 0;
ctInformacije[ IDCampTr ][ ctGun ][ 3 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 0 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 1 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 2 ] = 0;
ctInformacije[ IDCampTr ][ ctAmmo ][ 3 ] = 0;

strmid( ctInformacije[ IDCampTr ][ ctOwner ], ImeIgraca( playerid ), 0, strlen( ImeIgraca( playerid ) ), MAX_PLAYER_NAME );

  sql_create_camptrailer( playerid, IDCampTr);

  Camp_Refresh( IDCampTr, 1);
   
    SendInfoMessage(playerid, "Cestitamo, kupili ste kamp kucicu!");
return 1;
}
gottinho
4
Made Man
27. Nov. 2021.
i poslije kupovine, se spawna kamp kucica i to sve radi, ja odem ponovno kupiti kaze da imam prikolicu, ugasim server i upalim i nestane prikolica, posto se ne sacuva u data bazi, a evo i ako treba sql  https://imgur.com/a/Czz3Szu ovo ja nisam kupio posto ne sejva, ova kamp kucica je dosla u databazi...
Muma Rascall
6
Forum Don
27. Nov. 2021.
Brt ono daj sql_create_camptrailer
Ako ti neće da sačuva daješ code gdje čuva, a ne komandu koju očigledno izvrši
gottinho
4
Made Man
27. Nov. 2021.
мυмα wrote on November 27, 2021, 6:01 pm:
Brt ono daj sql_create_camptrailer
Ako ti neće da sačuva daješ code gdje čuva, a ne komandu koju očigledno izvrši
stock sql_create_camptrailer( playerid, thisID ) { 

new query[ 3300 ];

mysql_format( _dbConnector, query, sizeof( query ), "INSERT INTO `camptrailers` (`ownerid`, `spawnx`, `spawny`, `spawnz`, `spawna`, `enterx`, `entery`, `enterz`, `exitx`, `exity`, `exitz`\
, `gunx`, `guny`, `gunz`, `int`, `vw`, `gun_1`, `gun_2`, `gun_3`, `gun_4`, `gun_ammo_1`, `gun_ammo_2`, `gun_ammo_3`, `gun_ammo_4`  \
, `typetxt`, `security`, `typeint`, `typeneon`, `sef`, `frizider`, `novac`, `pice`, `zakljucana`, `tipkucice` )");

mysql_format(_dbConnector, query, sizeof( query ), "%s VALUES( '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f'\
, '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d' )", query\
,ctInformacije[ thisID ][ ctVlasnik_SqlID ]\
,ctInformacije[ thisID ][ ctSpawnX ]\
,ctInformacije[ thisID ][ ctSpawnY ]\
,ctInformacije[ thisID ][ ctSpawnZ ]\
,ctInformacije[ thisID ][ ctSpawnA ]\
,ctInformacije[ thisID ][ ctEnterX ]\
,ctInformacije[ thisID ][ ctEnterY ]\
,ctInformacije[ thisID ][ ctEnterZ ]\
,ctInformacije[ thisID ][ ctExitX ]\
,ctInformacije[ thisID ][ ctExitY ]\
,ctInformacije[ thisID ][ ctExitZ ]\
,ctInformacije[ thisID ][ ctGunPickupX ]\
,ctInformacije[ thisID ][ ctGunPickupY ]\
,ctInformacije[ thisID ][ ctGunPickupZ ]\
,ctInformacije[ thisID ][ ctInt ]\
,ctInformacije[ thisID ][ ctVW ]\
,ctInformacije[ thisID ][ ctGun ][ 0 ]\
,ctInformacije[ thisID ][ ctGun ][ 1 ]\
,ctInformacije[ thisID ][ ctGun ][ 2 ]\
,ctInformacije[ thisID ][ ctGun ][ 3 ]\
,ctInformacije[ thisID ][ ctAmmo ][ 0 ]\
,ctInformacije[ thisID ][ ctAmmo ][ 1 ]\
,ctInformacije[ thisID ][ ctAmmo ][ 2 ]\
,ctInformacije[ thisID ][ ctAmmo ][ 3 ]\
,ctInformacije[ thisID ][ ctTypeTxt ]\
,ctInformacije[ thisID ][ ctSecurity ]\
,ctInformacije[ thisID ][ ctTypeInt ]\
,ctInformacije[ thisID ][ ctTypeNeon ]\
,ctInformacije[ thisID ][ ctSef ]\
,ctInformacije[ thisID ][ ctFrizider ]\
,ctInformacije[ thisID ][ ctNovac ]\
,ctInformacije[ thisID ][ ctPice ]\
,ctInformacije[ thisID ][ ctLocked ]\
,ctInformacije[ thisID ][ ctTypeTrailer ]);
mysql_pquery( _dbConnector, query, "OnCampTrailerCreated", "ii", playerid, thisID );

return (true);
}
Muma Rascall
6
Forum Don
27. Nov. 2021.
Mislim da ti fali jedan %d za integer u VALUES, probaj ovako zamijenit ili samo dodaj u skripti      , `%d`
"%s VALUES( `%d`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`\
, `%f`, `%f`, `%f`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d` )"
gottinho
4
Made Man
27. Nov. 2021.
мυмα wrote on November 27, 2021, 6:43 pm:
Mislim da ti fali jedan %d za integer u VALUES, probaj ovako zamijenit ili samo dodaj u skripti      , `%d`
"%s VALUES( `%d`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`, `%f`\
, `%f`, `%f`, `%f`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d` , `%d`, `%d` )"
pokusao sam , prekopirao sam ovo sto si stavio, nije radilo pokusao sam dodati jos jedan i opet nije radilo...
Muma Rascall
6
Forum Don
27. Nov. 2021.
Daj mysql i server log, i ovo gore sam preko mobitela gledao
gottinho
4
Made Man
28. Nov. 2021.
мυмα wrote on November 27, 2021, 10:31 pm:
Daj mysql i server log, i ovo gore sam preko mobitela gledao

MYSQL
--
-- Table structure for table `camptrailers`
--

CREATE TABLE `camptrailers` (
  `id` int(11) NOT NULL,
  `ownerid` int(11) NOT NULL DEFAULT 0,
  `spawnx` float NOT NULL DEFAULT 0,
  `spawny` float NOT NULL DEFAULT 0,
  `spawnz` float NOT NULL DEFAULT 0,
  `spawna` float NOT NULL DEFAULT 0,
  `enterx` float NOT NULL DEFAULT 0,
  `entery` float NOT NULL DEFAULT 0,
  `enterz` float NOT NULL DEFAULT 0,
  `exitx` float NOT NULL DEFAULT 0,
  `exity` float NOT NULL DEFAULT 0,
  `exitz` float NOT NULL DEFAULT 0,
  `gunx` float NOT NULL DEFAULT 0,
  `guny` float NOT NULL DEFAULT 0,
  `gunz` float NOT NULL DEFAULT 0,
  `gun_1` int(11) NOT NULL DEFAULT 0,
  `gun_2` int(11) NOT NULL DEFAULT 0,
  `gun_3` int(11) NOT NULL DEFAULT 0,
  `gun_4` int(11) NOT NULL DEFAULT 0,
  `gun_ammo_1` int(11) NOT NULL DEFAULT 0,
  `gun_ammo_2` int(11) NOT NULL DEFAULT 0,
  `gun_ammo_3` int(11) NOT NULL DEFAULT 0,
  `gun_ammo_4` int(11) NOT NULL DEFAULT 0,
  `int` int(11) NOT NULL DEFAULT 0,
  `vw` int(11) NOT NULL DEFAULT 0,
  `typetxt` int(11) NOT NULL DEFAULT 0,
  `security` int(11) NOT NULL DEFAULT 0,
  `typeint` int(11) NOT NULL DEFAULT 0,
  `typeneon` int(11) NOT NULL DEFAULT 0,
  `sef` int(11) NOT NULL DEFAULT 0,
  `frizider` int(11) NOT NULL DEFAULT 0,
  `novac` int(11) NOT NULL DEFAULT 0,
  `pice` int(11) NOT NULL DEFAULT 0,
  `tipkucice` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `camptrailers`
--

INSERT INTO `camptrailers` (`id`, `ownerid`, `spawnx`, `spawny`, `spawnz`, `spawna`, `enterx`, `entery`, `enterz`, `exitx`, `exity`, `exitz`, `gunx`, `guny`, `gunz`, `gun_1`, `gun_2`, `gun_3`, `gun_4`, `gun_ammo_1`, `gun_ammo_2`, `gun_ammo_3`, `gun_ammo_4`, `int`, `vw`, `typetxt`, `security`, `typeint`, `typeneon`, `sef`, `frizider`, `novac`, `pice`, `tipkucice`) VALUES
(1, 367, 1239.42, -731.896, 95.413, 297.116, 1239, -733.908, 95.783, 2496.15, -2032.72, 770.547, 1237.39, -734.733, 95.783, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 8, 1, 1, 0, 1, 0, 26750, 1, 1);


MYSQL LOG ovo se pojavi kada kupim kamp kucicu
[12:07:54] mysql_format - no value for specifier "%d" available
[12:07:54] CMySQLQuery::Execute - (error #1054) Unknown column '696' in 'field list'
gottinho
4
Made Man
28. Nov. 2021.
Ovo je u pwn, i ja kada kupim prikolicu ne pise mi da mi se spawnala ispred shopa..
forward OnCampTrailerCreated( playerid, this_ID);
public OnCampTrailerCreated( playerid, this_ID) {
SendInfoMessage(playerid, "Vasa kamp kucica se nalazi ispred salona kamp prikolica");
SendInfoMessage(playerid, "Kamp prikolicom upravljate komandom: /kampprikolica");
return true;
}

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha