SA-MP Forums Archive
not spawning vehicle - 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: not spawning vehicle (/showthread.php?tid=580037)



not spawning vehicle - ItzRbj - 01.07.2015

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


Re: not spawning vehicle - Suicidal.Banana - 02.07.2015

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)
{
...
}



Re: not spawning vehicle - ItzRbj - 02.07.2015

What code should i put there?


Re: not spawning vehicle - Suicidal.Banana - 02.07.2015

Код:
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)


Re: not spawning vehicle - ItzRbj - 02.07.2015

Thanks i will try this


Re: not spawning vehicle - ItzRbj - 02.07.2015

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.



Re: not spawning vehicle - Youssef221 - 02.07.2015

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);
    }
}