SA-MP Forums Archive
Question , fast rep ++ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question , fast rep ++ (/showthread.php?tid=549545)



Question , fast rep ++ - buburuzu19 - 07.12.2014

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


Re : Question , fast rep ++ - Z3N0N - 07.12.2014

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`



Re: Question , fast rep ++ - buburuzu19 - 07.12.2014

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.


Re: Question , fast rep ++ - CutX - 07.12.2014

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


Re: Question , fast rep ++ - buburuzu19 - 07.12.2014

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?


Re: Question , fast rep ++ - CutX - 07.12.2014

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...


Re: Question , fast rep ++ - buburuzu19 - 07.12.2014

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.


Re: Question , fast rep ++ - buburuzu19 - 07.12.2014

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