SA-MP Forums Archive
Spawn car working in zcmd but dialog. - 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: Spawn car working in zcmd but dialog. (/showthread.php?tid=619432)



Spawn car working in zcmd but dialog. - MrMirvC - 17.10.2016

Hello. I've made a dialog menu where a player can spawn a car. I click on the car but it won't spawn. but if i do it via zcmd, the car will spawn and the code is exactly the same.

BTW i've noticed that Textdraws won't show up. The only one that works is just the welcome message.. http://pastebin.com/pBywnj73


Re: Spawn car working in zcmd but dialog. - ThatFag - 17.10.2016

At dialog you have checked if the player's team i grove street so if you are not in gove street you wont the the vehicle
Код:
if(gTeam[playerid] == GroveStreet)
                {
and at command you haven't done that.


Re: Spawn car working in zcmd but dialog. - MrMirvC - 17.10.2016

So, my problem is that my gm doesn't check the team?

Quote:

SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 105 || classid == 106 || classid == 107 || classid == 269 || classid == 270 || classid == 271)
{
gTeam[playerid] = GroveStreet;
}
else if(classid == 102 || classid == 104 || classid == 105)
{
gTeam[playerid] = Ballas;
}

}




Re: Spawn car working in zcmd but dialog. - ThatFag - 17.10.2016

No the problem is that you wasnt in Grove Street team.

Код:
 if(dialogid == Auto)
    {
        switch(listitem)
        {
            case 0:
            {

                    new Float:x, Float:y, Float:z, Float:a;
                    GetPlayerPos(playerid, x,y,z);
                    GetPlayerFacingAngle(playerid, a);
                    CreateVehicle(562, x+3,y,z, a, Verde, Verde, -1);
                    printf("Auto Spawnata");
                    PutPlayerInVehicle(playerid, 562, 0);
             }
             case 1:
                {
                    new Float:x, Float:y, Float:z, Float:a;
                    GetPlayerPos(playerid, x,y,z);
                    GetPlayerFacingAngle(playerid, a);
                    CreateVehicle(562, x+3,y,z, a, Viola, Viola, -1);
                    printf("Auto Spawnata");
                    PutPlayerInVehicle(playerid, 562, 0);
                }
            }
    return 1;
    }
test this and tell me


Re: Spawn car working in zcmd but dialog. - MrMirvC - 17.10.2016

It spawns the car but in my dialog we have 3 cars: Elegy, Bullet and Sultan. We have two teams. If a grove street member spawn the car it should be Green (Verde) and if is a ballas member it should be Purple (Viola) :\


Re: Spawn car working in zcmd but dialog. - ThatFag - 17.10.2016

Well
Your old codes should work just set your team to Grove street or ballas.
if doesnt work test this..

http://paste2.org/tP8183x6


Re: Spawn car working in zcmd but dialog. - MrMirvC - 18.10.2016

Fixed

Quote:

new veh = CreateVehicle(562, x+3,y,z, a, Viola, Viola, -1);
printf("Auto Spawnata");
PutPlayerInVehicle(playerid, veh, 0);

Thanks for ur support