21.05.2011, 21:15
Hello. I am totally new to scripting, but I'm improving my skills really fast.
I came upon the problem. So this is the drill. I want to make player get in a car after spawning it with /cars.
/cars give out the dialog box and you choose which car you want. Then after clicking "spawn", I want the player to get in a car immediately after spawning it.
This is how my code on dialog box looks like:
I came upon the problem. So this is the drill. I want to make player get in a car after spawning it with /cars.
/cars give out the dialog box and you choose which car you want. Then after clicking "spawn", I want the player to get in a car immediately after spawning it.
This is how my code on dialog box looks like:
Quote:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new Float: x, Float: y, Float: z, Float: a; GetPlayerPos (playerid, x, y, z); GetPlayerFacingAngle (playerid, a); if (dialogid == 1 && response == 1) { if (IsPlayerInAnyVehicle (playerid)) return SendClientMessage (playerid, 0xafafafAA, "Step out of the vehicle first."); else { switch (listitem) { case 0: { CreateVehicle (598, x, y, z, a, 16, 1, 50000); } case 1: { CreateVehicle (497, x, y, z, a, 16, 1, 50000); } case 2: { CreateVehicle (415, x, y, z, a, -1, -1, 50000); } case 3: { CreateVehicle (541, x, y, z, a, -1, -1, 50000); } case 4: { CreateVehicle (560, x, y, z, a, -1, -1, 50000); } case 5: { CreateVehicle (523, x, y, z, a, 16, 1, 50000); } case 6: { CreateVehicle (599, x, y, z, a, 16, 1, 50000); } case 7: { CreateVehicle (579, x, y, z, a, -1, -1, 50000); } case 8: { CreateVehicle (562, x, y, z, a, -1, -1, 50000); } case 9: { CreateVehicle (402, x, y, z, a, -1, -1, 50000); } case 10: { CreateVehicle (492, x, y, z, a, -1, -1, 50000); } case 11: { CreateVehicle (422, x, y, z, a, -1, -1, 50000); } case 12: { CreateVehicle (554, x, y, z, a, -1, -1, 50000); } case 13: { CreateVehicle (426, x, y, z, a, -1, -1, 50000); } case 14: { CreateVehicle (521, x, y, z, a, -1, -1, 50000); } case 15: { CreateVehicle (480, x, y, z, a, -1, -1, 50000); } case 16: { CreateVehicle (412, x, y, z, a, -1, -1, 50000); } } } } return 1; } |