not spawning vehicle
#1

Hello when i used the command /v and then it showed me a dialog and i have clicked on it and also its not spawning the vehicle so i wanted to know why this is the command

Код:
CMD:v(playerid)
{
	ShowModelSelectionMenu(playerid, vehlist, "Select To Spawn");
	return 1;
}
could you guys help me
??
Reply
#2

There needs to be a function that handles the selection output.
Read this release post for mSelection (which is what you are talking about)

Specifically look at this bit of the Example #1 code:
Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
...
}
Reply
#3

What code should i put there?
Reply
#4

Код:
public OnPlayerModelSelection(playerid, response, listid, modelid) {
    if(listid == vehlist) {
        new Float:pos[3];
        GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, 0.0, 0.0, -1);
    }
}
Since im doing your work, +Rep appreciated (provided it works)
Reply
#5

Thanks i will try this
Reply
#6

It shows me this warning

Код:
C:\Users\Administrator\Desktop\JaKe\gamemodes\blank.pwn(9281) : warning 213: tag mismatch
C:\Users\Administrator\Desktop\JaKe\gamemodes\blank.pwn(9281) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#7

Maybe this?:

pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == vehlist)
    {
        new Float:XPos, Float:YPos, Float:ZPos, playervehicle[MAX_PLAYERS];
        GetPlayerPos(playerid, XPos, YPos, ZPos);
        playervehicle[playerid] = CreateVehicle(modelid, XPos, YPos, ZPos, 0.0, 0.0, 0.0, -1);
        PutPlayerInVehicle(playerid, playervehicle[playerid], 0);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)