Posts: 81
Threads: 12
Joined: Mar 2015
hello guys,,
I have Created Vehicle System and it shows with pic but when i try to spawn a vehicle it shows doesnt spawn any vehicle
Код:
CMD:v (playerid)
{
ShowModelSelectionMenu(playerid, vehlist, "Vehicles - Click To Spawn");
return 1;
}
please help me
Posts: 1,276
Threads: 6
Joined: Aug 2014
Did you add:
PHP код:
new vehlist = mS_INVALID_LISTID;
GamemodeInit
vehlist = LoadModelSelectionMenu("wherethemodelidsareat.txt);
?
Posts: 81
Threads: 12
Joined: Mar 2015
i did it and still it doesnt works
Posts: 1,276
Threads: 6
Joined: Aug 2014
What about your selected callback?
PHP код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(!response) return 1;
CreateVehicle(..)
return 1;
}
?
Posts: 81
Threads: 12
Joined: Mar 2015
Posts: 1,276
Threads: 6
Joined: Aug 2014
(..)
Means the params (parameters) like x, y, z and so on.
Fill those in. (If you haven't had this callback & function allready)
Posts: 81
Threads: 12
Joined: Mar 2015
Posts: 1,276
Threads: 6
Joined: Aug 2014
PHP код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == vehlist)
{
if(!response) return 1;
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
new tmpcar = CreateVehicle(modelid, x, y, z, a, -1, -1, -1, 0);
PutPlayerInVehicle(playerid, tmpcar, 0);
}
return 1;
}
Posts: 81
Threads: 12
Joined: Mar 2015
this error i got
Код:
C:\Users\DELL\Desktop\Server\gamemodes\freeroam.pwn(4501) : error 017: undefined symbol "listiem"
C:\Users\DELL\Desktop\Server\gamemodes\freeroam.pwn(4507) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
error for 4507
Код:
new tmpcar = CreateVehicle(modelid, x, y, z, a, -1, -1, -1, 0);
Posts: 1,276
Threads: 6
Joined: Aug 2014
I edited the script I forgot it wasn't a dialog, replace it with listid.
PHP код:
new tmpcar;
tmpcar = CreateVehicle