Problem(error/warning): Kamp kucice, se nece sejvati u data bazu https://imgur.com/a/25pGCZw
Deo skripte:
Pawno Code: [pawn]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][ctSQLID] = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaID ] = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaSqlID ] = ctInformacije[IDCampTr][ctSQLID];
sql_user_update_intandmoney( playerid, "camptrailer_id", PlayerInfo[ playerid ][ xCampKucicaSqlID ] );
ctInformacije[ IDCampTr ][ ctVlasnik_SqlID ] = PlayerInfo[ playerid ][ xID ];
ctInformacije[IDCampTr][ctInt] = 1;
ctInformacije[IDCampTr][ctVW] = IDCampTr;
new poz = random(sizeof(RandomCampShopSpawn));
ctInformacije[IDCampTr][ctSpawnX] = RandomCampShopSpawn[poz][0];
ctInformacije[IDCampTr][ctSpawnY] = RandomCampShopSpawn[poz][1];
ctInformacije[IDCampTr][ctSpawnZ] = RandomCampShopSpawn[poz][2];
ctInformacije[IDCampTr][ctSpawnA] = RandomCampShopSpawn[poz][3];
CampTrailerVehicle[IDCampTr] = KGEyes_CreateVehicle(607,ctInformacije[IDCampTr][ctSpawnX],ctInformacije[IDCampTr][ctSpawnY],ctInformacije[IDCampTr][ctSpawnZ],ctInformacije[IDCampTr][ctSpawnA],1,1,2400);
CampTrailerObject[IDCampTr] = CreateDynamicObject(3171, 0,0,0,0,0,0,80 );
AttachDynamicObjectToVehicle(CampTrailerObject[IDCampTr], CampTrailerVehicle[IDCampTr], 0.084999, -1.900115, -1.144999, -3.014999, 0.000000, 178.890090);
new Float: xPos,
Float: yPos,
Float: zPos;
GetVehicleRelativePos(CampTrailerVehicle[IDCampTr], xPos, yPos, zPos, diff_x, diff_y);
ctInformacije[IDCampTr][ctEnterX] = xPos;
ctInformacije[IDCampTr][ctEnterY] = yPos;
ctInformacije[IDCampTr][ctEnterZ] = zPos + 0.37 ;
ctInformacije[IDCampTr][ctGunPickupX] = 0.0;
ctInformacije[IDCampTr][ctGunPickupY] = 0.0;
ctInformacije[IDCampTr][ctGunPickupZ] = 0.0;
ctInformacije[IDCampTr][ctExitX] = 2512.9333;
ctInformacije[IDCampTr][ctExitY] = -1729.1531;
ctInformacije[IDCampTr][ctExitZ] = 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;
}[/pawn]
[pawn]sql_create_camptrailer( playerid, IDCampTr);[/pawn]
Citat: Galardo poslato Novembar 27, 2021, 16:30:08 POSLE PODNE
[pawn]sql_create_camptrailer( playerid, IDCampTr);[/pawn]
tu je vec brt
[pawn] strmid( ctInformacije[ IDCampTr ][ ctOwner ], ImeIgraca( playerid ), 0, strlen( ImeIgraca( playerid ) ), MAX_PLAYER_NAME );
sql_create_camptrailer( playerid, IDCampTr);
Camp_Refresh( IDCampTr, 1);[/pawn]
Citat: A L M E X poslato Novembar 27, 2021, 16:40:29 POSLE PODNE
tu je vec brt
[pawn] strmid( ctInformacije[ IDCampTr ][ ctOwner ], ImeIgraca( playerid ), 0, strlen( ImeIgraca( playerid ) ), MAX_PLAYER_NAME );
sql_create_camptrailer( playerid, IDCampTr);
Camp_Refresh( IDCampTr, 1);[/pawn]
Jesi li pokusao da zavirsi u tu funkciju? ::)
Citat: Galardo poslato Novembar 27, 2021, 17:24:18 POSLE PODNE
Jesi li pokusao da zavirsi u tu funkciju? ::)
Da, ali ne shvatam u cemu je problem stvarno
Citat: мυмα poslato Novembar 27, 2021, 17:57:31 POSLE PODNE
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
[pawn]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][ctSQLID] = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaID ] = IDCampTr;
PlayerInfo[ playerid ][ xCampKucicaSqlID ] = ctInformacije[IDCampTr][ctSQLID];
sql_user_update_intandmoney( playerid, "camptrailer_id", PlayerInfo[ playerid ][ xCampKucicaSqlID ] );
ctInformacije[ IDCampTr ][ ctVlasnik_SqlID ] = PlayerInfo[ playerid ][ xID ];
ctInformacije[IDCampTr][ctInt] = 1;
ctInformacije[IDCampTr][ctVW] = IDCampTr;
new poz = random(sizeof(RandomCampShopSpawn));
ctInformacije[IDCampTr][ctSpawnX] = RandomCampShopSpawn[poz][0];
ctInformacije[IDCampTr][ctSpawnY] = RandomCampShopSpawn[poz][1];
ctInformacije[IDCampTr][ctSpawnZ] = RandomCampShopSpawn[poz][2];
ctInformacije[IDCampTr][ctSpawnA] = RandomCampShopSpawn[poz][3];
CampTrailerVehicle[IDCampTr] = KGEyes_CreateVehicle(607,ctInformacije[IDCampTr][ctSpawnX],ctInformacije[IDCampTr][ctSpawnY],ctInformacije[IDCampTr][ctSpawnZ],ctInformacije[IDCampTr][ctSpawnA],1,1,2400);
CampTrailerObject[IDCampTr] = CreateDynamicObject(3171, 0,0,0,0,0,0,80 );
AttachDynamicObjectToVehicle(CampTrailerObject[IDCampTr], CampTrailerVehicle[IDCampTr], 0.084999, -1.900115, -1.144999, -3.014999, 0.000000, 178.890090);
new Float: xPos,
Float: yPos,
Float: zPos;
GetVehicleRelativePos(CampTrailerVehicle[IDCampTr], xPos, yPos, zPos, diff_x, diff_y);
ctInformacije[IDCampTr][ctEnterX] = xPos;
ctInformacije[IDCampTr][ctEnterY] = yPos;
ctInformacije[IDCampTr][ctEnterZ] = zPos + 0.37 ;
ctInformacije[IDCampTr][ctGunPickupX] = 0.0;
ctInformacije[IDCampTr][ctGunPickupY] = 0.0;
ctInformacije[IDCampTr][ctGunPickupZ] = 0.0;
ctInformacije[IDCampTr][ctExitX] = 2512.9333;
ctInformacije[IDCampTr][ctExitY] = -1729.1531;
ctInformacije[IDCampTr][ctExitZ] = 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;
}[/pawn]
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...
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
Citat: мυмα poslato Novembar 27, 2021, 19:01:25 POSLE PODNE
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
[pawn]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);
}[/pawn]
Mislim da ti fali jedan %d za integer u VALUES, probaj ovako zamijenit ili samo dodaj u skripti , `%d`
[pawn]"%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` )"[/pawn]
Citat: мυмα poslato Novembar 27, 2021, 19:43:12 POSLE PODNE
Mislim da ti fali jedan %d za integer u VALUES, probaj ovako zamijenit ili samo dodaj u skripti , `%d`
[pawn]"%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` )"[/pawn]
pokusao sam , prekopirao sam ovo sto si stavio, nije radilo pokusao sam dodati jos jedan i opet nije radilo...
Daj mysql i server log, i ovo gore sam preko mobitela gledao
Citat: мυмα poslato Novembar 27, 2021, 23:31:07 POSLE PODNE
Daj mysql i server log, i ovo gore sam preko mobitela gledao
MYSQL
[pawn]--
-- 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);[/pawn]
MYSQL LOG ovo se pojavi kada kupim kamp kucicu
[pawn][12:07:54] [ERROR] mysql_format - no value for specifier "%d" available
[12:07:54] [ERROR] CMySQLQuery::Execute[OnCampTrailerCreated] - (error #1054) Unknown column '696' in 'field list'
[/pawn]
Ovo je u pwn, i ja kada kupim prikolicu ne pise mi da mi se spawnala ispred shopa..
[pawn]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;
}[/pawn]
E vidiš tu OnCampTrailerCreated fali kad se kreira da dodijeli id, pogledaj neko drugo kreiranje i vidjet ćeš u tom callbacku kako je pošto ne znam koji ti je mysql, a i sam sam zaboravio code
Citat: мυмα poslato Novembar 28, 2021, 14:19:14 POSLE PODNE
E vidiš tu OnCampTrailerCreated fali kad se kreira da dodijeli id, pogledaj neko drugo kreiranje i vidjet ćeš u tom callbacku kako je pošto ne znam koji ti je mysql, a i sam sam zaboravio code
[pawn] mysql_pquery( _dbConnector, query, "OnCampTrailerCreated", "ii", playerid, thisID );
return (true);
}
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;
}[/pawn]
[pawn] mysql_pquery( _dbConnector, query, "OnHotelCreated", "ii", playerid, h );
return (true);
}
forward OnHotelCreated( playerid, h );
public OnHotelCreated( playerid, h ){[/pawn]
a, evo i isti primjerak
I pogledaj OnHotelCreated šta se nalazi u callbacku
Citat: мυмα poslato Novembar 28, 2021, 14:42:46 POSLE PODNE
I pogledaj OnHotelCreated šta se nalazi u callbacku
stvarno ne razumijem brt, gledam kod, sve je isto
Daj da vidim
Citat: мυмα poslato Novembar 28, 2021, 15:47:53 POSLE PODNE
Daj da vidim
[pawn]stock sql_create_hotel( playerid, h ) {
new query[ 256 ];
mysql_format( _dbConnector, query, sizeof( query ), "INSERT INTO `hotels` ( h_enter_x, h_enter_y, h_enter_z, h_exit_x, h_exit_y, h_exit_z, h_int, h_price )" );
mysql_format( _dbConnector, query, sizeof( query ), "%s VALUES( '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d' )",
query,
hotelInfo[ h ][ hEnter ][ 0 ],
hotelInfo[ h ][ hEnter ][ 1 ],
hotelInfo[ h ][ hEnter ][ 2 ],
hotelInfo[ h ][ hExit ][ 0 ],
hotelInfo[ h ][ hExit ][ 1 ],
hotelInfo[ h ][ hExit ][ 2 ],
hotelInfo[ h ][ hInterior ],
hotelInfo[ h ][ hPrice ] );
mysql_pquery( _dbConnector, query, "OnHotelCreated", "ii", playerid, h );
return (true);
}
forward OnHotelCreated( playerid, h );
public OnHotelCreated( playerid, h ){
hotelInfo[ h ][ hbaseID ] = cache_insert_id();
ServerInfo[ hotelsCounter ]++;
HotelRefresh( h );
SendInfoMessage( playerid, "Uspesno si kreirao hotel." );
return true;
}[/pawn]
[pawn]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);
}
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;
}[/pawn]
Kako je isto jebem ga vidiš da ovaj za hotel ima
[Pawn]hotelInfo[ h ][ hbaseID ] = cache_insert_id();[/pawn]
Dodaj u OnCampTrailerCreated
[pawn]ctInformacije[this_ID][ctSQLID] = cache_insert_id();[/pawn]
ako ti se ovako (ctSQLID) zove
A ovo gore što ima
[12:07:54] [ERROR] mysql_format - no value for specifier "%d" available
moraš kod INSERTa vidjet gdje ima viška ili fali, nmg ja ovako na mobitelu nikako
Citat: мυмα poslato Novembar 28, 2021, 16:12:29 POSLE PODNE
Kako je isto jebem ga vidiš da ovaj za hotel ima
[Pawn]hotelInfo[ h ][ hbaseID ] = cache_insert_id();[/pawn]
Dodaj u OnCampTrailerCreated
[pawn]ctInformacije[this_ID][ctSQLID] = cache_insert_id();[/pawn]
ako ti se ovako (ctSQLID) zove
A ovo gore što ima
[12:07:54] [ERROR] mysql_format - no value for specifier "%d" available
moraš kod INSERTa vidjet gdje ima viška ili fali, nmg ja ovako na mobitelu nikako
[pawn][16:45:46] [ERROR] CMySQLQuery::Execute[OnCampTrailerCreated] - (error #1136) Column count doesn't match value count at row 1[/pawn]
mysql log... pokusavao sam promjeniti sa this_id i sa thisID opet izadje ovaj error u mysql log
Ma uzmi tablu i format i query i sve to gore rewriteuj jebeš ga
Zasto diras komplex sistem koji sam ja radio ako ne znas da je kreiras ?
Kopiras bezveze i nigde ne vidis logiku evo ja cu ti reci nadji koji value ti je ovaj ID 696 sta ti je to i tada ces naci koja kolona ti fali.
Barem kada kopiras kopiraj kako valja :))))))))))))))
Preporucujem ako kod ne razumes iz Kamp Trailera - ne koristi Kamp Trailer jer za to ti treba mng vece znanje ;)
Citat: xLanmi poslato Novembar 28, 2021, 20:01:02 POSLE PODNE
Zasto diras komplex sistem koji sam ja radio ako ne znas da je kreiras ?
Kopiras bezveze i nigde ne vidis logiku evo ja cu ti reci nadji koji value ti je ovaj ID 696 sta ti je to i tada ces naci koja kolona ti fali.
Barem kada kopiras kopiraj kako valja :))))))))))))))
Preporucujem ako kod ne razumes iz Kamp Trailera - ne koristi Kamp Trailer jer za to ti treba mng vece znanje ;)
cek, zar bi onda pola nas trebalo imati vece razumijevanje za rijesenje, poput tebe...
Potrebno bi bilo razumeti osnove skriptanja, da bi znao resiti logicke probleme.
Trazenjem odgovora tacno da ti neko odgovori i iskuca kod bez sopstvenog truda i DEBUG-a neces nikad uspeti resiti problem ili ces ga resiti ali neces znati u cemu je problem.