11.10.2017, 16:49
Hello!
So I'm a noob on scripting, and I made a not optimized command to load drugs into the Bobcat (ID: 422)
This is the code:
The thing is that I want to make those commands (cargardroga and descargardroga) only available for one vehicle, in this case the Bobcat.
I know it may hurt to see this, but I'm starting, thank you for your help.
So I'm a noob on scripting, and I made a not optimized command to load drugs into the Bobcat (ID: 422)
This is the code:
The thing is that I want to make those commands (cargardroga and descargardroga) only available for one vehicle, in this case the Bobcat.
PHP код:
new drug1, drug2, drug3, drug4, drug5, drug6, drug7, drug8, drug9, drug10, drug11, drug12, drug13, drug14, drug15, drug16, drug17, drug18, drug19, coche;
PHP код:
if(strcmp(cmdtext,"/cargardroga",true)==0)
{
coche = GetPlayerVehicleID(playerid);
drug1 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug2 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug3 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug4 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug5 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug6 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug7 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug8 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug9 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug10 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug11 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug12 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug13 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug14 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug15 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug16 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug17 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug18 = CreateObject(1575,0,0,-1000,0,0,0,100);
drug19 = CreateObject(1575,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(drug1, coche, -0.449999,-0.674999,-0.299999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug2, coche, -0.449999,-0.974999,-0.299999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug3, coche, -0.449999,-0.675000,-0.149999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug4, coche, -0.449999,-0.974999,-0.149999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug5, coche, 0.075000,-0.675000,-0.299999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug6, coche, 0.599999,-0.675000,-0.299999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug7, coche, 0.599999,-0.675000,-0.149999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug8, coche, 0.599999,-0.974999,-0.299999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug9, coche, 0.599999,-0.974999,-0.149999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug10, coche, 0.075000,-0.675000,-0.149999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug11, coche, 0.075000,-0.974999,-0.299999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug12, coche, 0.075000,-0.974999,-0.149999,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug13, coche, 0.075000,-0.600000,0.000000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug14, coche, -0.449999,-0.600000,0.000000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug15, coche, 0.599999,-0.600000,0.000000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug16, coche, 0.599999,-0.899999,0.000000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug17, coche, 0.075000,-0.899999,0.000000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug18, coche, -0.449999,-0.899999,0.000000,0.000000,0.000000,0.000000);
AttachObjectToVehicle(drug19, coche, -0.449999,-1.350000,-0.149999,2.700001,35.100006,0.000000);
return 1;
}
if(strcmp(cmdtext,"/descargardroga",true)==0)
{
DestroyObject(drug1);
DestroyObject(drug2);
DestroyObject(drug3);
DestroyObject(drug4);
DestroyObject(drug5);
DestroyObject(drug6);
DestroyObject(drug7);
DestroyObject(drug8);
DestroyObject(drug9);
DestroyObject(drug10);
DestroyObject(drug11);
DestroyObject(drug12);
DestroyObject(drug13);
DestroyObject(drug14);
DestroyObject(drug15);
DestroyObject(drug16);
DestroyObject(drug17);
DestroyObject(drug18);
DestroyObject(drug19);
return 1;
}