Question , fast rep ++
#1

How to lock some vehicles who are loaded from SQL DB?
Reply
#2

Mysql update

Код:
UPDATE `Table A`,`Table B`
SET `Table A`.`text`=concat_ws('',`Table A`.`text`,`Table B`.`B-num`," from ",`Table B`.`date`,'/')
WHERE `Table A`.`A-num` = `Table B`.`A-num`
Reply
#3

You don't understand my question.
I mean i added some cars for my dealership , and i want to lock them from my gamemode , cuz in my sql vehicle table don't appears any lock option.
Reply
#4

Quote:
Originally Posted by buburuzu19
Посмотреть сообщение
How to lock some vehicles who are loaded from SQL DB?
when creating the vehicle...
pawn Код:
SetVehicleParamsEx(CreateVehicle(/*fill with data from db*/),0,0,0,1,0,0,0);
and that'll lock it right after it's initialisation
Reply
#5

Quote:
Originally Posted by CutX
Посмотреть сообщение
when creating the vehicle...
pawn Код:
SetVehicleParamsEx(CreateVehicle(/*fill with data from db*/),0,0,0,1,0,0,0);
and that'll lock it right after it's initialisation
And where to add that code? OnPlayerConnect?
Reply
#6

Quote:
Originally Posted by buburuzu19
Посмотреть сообщение
And where to add that code? OnPlayerConnect?
i said to add it to where you actually load & create the vehicles with data from the db.
it's that part where you query the db and fetch all the vehicle data.

im assuming that creating the veicles using the sql db already works
since you said you only want them to be locked...
Reply
#7

I tried something like this:
SetVehicleParamsEx(337, 0, 0, 0, 1, 0, 0, 0);
Where 337 is vehicleid from SQL DB ( not model id) and 1- locked doors but not working.
I also added the code at on gm init.
Reply
#8

Quote:
Originally Posted by CutX
Посмотреть сообщение
when creating the vehicle...
pawn Код:
SetVehicleParamsEx(CreateVehicle(/*fill with data from db*/),0,0,0,1,0,0,0);
and that'll lock it right after it's initialisation
The vehicles are create in my sql db not in the gamemode
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)