[Help] Remove player from vehicle
#1

Hey,
I added a dealership filterscript to my server and there is one problem.
When you enter a dealership's car, your asked if you want to buy the vehicle "Yes" No", but when you press "No" it doesn't removes you from the vehicle.
How to fix it?
Here is the script:
http://pastebin.com/4vNhRHaQ
Thanks!
Reply
#2

Up.
Please, I really need help!
Reply
#3

Did you used OnDialogResponse with return 1 any scripts?

Edit:
pawn Код:
return 1; //1015. line
change to
pawn Код:
return 0; //1015. line
Reply
#4

Quote:
Originally Posted by TheGamer!
Посмотреть сообщение
Did you used OnDialogResponse with return 1 any scripts?

Edit:
pawn Код:
return 1; //1015. line
change to
pawn Код:
return 0; //1015. line
Ok, changed it, but it didn't fix the problem :O
Reply
#5

change dialog 669 to this
pawn Код:
if(dialogid == 669)
        {
            if(response)
            {
                new file[256], name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                        format(file,sizeof(file),"Cars/%s.ini",name);
            new veh = GetPlayerVehicleID(playerid);
                    new money = GetPlayerMoney(playerid);
                if(money >= CarPrice[veh])
                {
                    if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You already own a car.");
                    new string[64];
                    SendClientMessage(playerid, 0xAFAFAFAA, "Thank you for buying at Coutt and Schutz.");
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                                dini_Create(file);
                                Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 2130.1914, -1109.5881, 25.1890, 76.2599, 1, 1, 3600000);
                format(string, sizeof(string), "Creating your vehicle %i.", veh);
                    SendClientMessage(playerid, 0xAFAFAFAA, string);
                                VehicleInfo[playerid][Model] = GetVehicleModel(veh);
                                VehicleInfo[playerid][Price] = CarPrice[veh];
                                VehicleInfo[playerid][CarX] = 2130.1914;
                                VehicleInfo[playerid][CarY] = -1109.5881;
                                VehicleInfo[playerid][CarZ] = 25.1890;
                                VehicleInfo[playerid][CarRot] = 76.2599;
                                gPlayerHasCar[playerid] = 1;
                                RemovePlayerFromVehicle(playerid);
                                OwnerID[Vehicle[playerid]] = playerid;
                                VehPlate[Vehicle[playerid]] = "XYZR 000";
                                PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
                                GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
                        }
                        else
                        {
                            RemovePlayerFromVehicle(playerid);
                            SendClientMessage(playerid, 0xAFAFAFAA, "You cannot afford this vehicle.");
                            return 1;
                        }
                }
                if(!response) return RemovePlayerFromVehicle(playerid);
        }
Reply
#6

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
change dialog 669 to this
pawn Код:
if(dialogid == 669)
        {
            if(response)
            {
                new file[256], name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                        format(file,sizeof(file),"Cars/%s.ini",name);
            new veh = GetPlayerVehicleID(playerid);
                    new money = GetPlayerMoney(playerid);
                if(money >= CarPrice[veh])
                {
                    if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You already own a car.");
                    new string[64];
                    SendClientMessage(playerid, 0xAFAFAFAA, "Thank you for buying at Coutt and Schutz.");
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                                dini_Create(file);
                                Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 2130.1914, -1109.5881, 25.1890, 76.2599, 1, 1, 3600000);
                format(string, sizeof(string), "Creating your vehicle %i.", veh);
                    SendClientMessage(playerid, 0xAFAFAFAA, string);
                                VehicleInfo[playerid][Model] = GetVehicleModel(veh);
                                VehicleInfo[playerid][Price] = CarPrice[veh];
                                VehicleInfo[playerid][CarX] = 2130.1914;
                                VehicleInfo[playerid][CarY] = -1109.5881;
                                VehicleInfo[playerid][CarZ] = 25.1890;
                                VehicleInfo[playerid][CarRot] = 76.2599;
                                gPlayerHasCar[playerid] = 1;
                                RemovePlayerFromVehicle(playerid);
                                OwnerID[Vehicle[playerid]] = playerid;
                                VehPlate[Vehicle[playerid]] = "XYZR 000";
                                PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
                                GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
                        }
                        else
                        {
                            RemovePlayerFromVehicle(playerid);
                            SendClientMessage(playerid, 0xAFAFAFAA, "You cannot afford this vehicle.");
                            return 1;
                        }
                }
                if(!response) return RemovePlayerFromVehicle(playerid);
        }
It didn't work
Thank you for trying to help.

I think know what's the problem, I tried pressing "Yes" and it didn't do anything. just the black window went away.
How can I fix that problem?
Reply
#7

Edit : Wont work ( My mistake )
Reply
#8

Quote:
Originally Posted by MTCool
Посмотреть сообщение
It didn't work
Thank you for trying to help.

I think know what's the problem, I tried pressing "Yes" and it didn't do anything. just the black window went away.
How can I fix that problem?
Tryed adding it on your gamemode, i think the fs has some problems
Reply
#9

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
Tryed adding it on your gamemode, i think the fs has some problems
I don't know how
I am a begginer scripter, so I don't know what to remove from the script, so I can add to to my gm.
Reply
#10

My new problem is that when I press "Yes" or "No" it doesn't do anything. How do I fix that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)