My DMV Driving Test, Create Vehicle Problem...
#1

I'm not sure what's going on, I changed the position of the driving school and now when I start the driving test, I puts me outside the driving school like it should but then it dosen't create the vehicle... It just puts me up in the air around 2 + the Z Poistion of where the car should be placed and freezes me there, I can't see my player and all i can do is move the camra.

The new DrivingTestVeh; is at the top of my script as it is needed for other things aswell.

This is my /StartTest Command:
pawn Код:
dcmd_StartTest(playerid, params[])
#pragma unused params
{
    new string[54];
    if(PlayerToPoint(1,playerid,-2026.969482, -114.465362, 1035.171875))
    {
        if (500 > GetPlayerMoney(playerid)) return SendClientMessage(playerid, ERROR_COLOR, "[!] Sorry, You don't have the requiered $500 in your wallet.");
        else if (DriveTestAlready) return SendClientMessage(playerid, ERROR_COLOR, "[!] Sorry, Somebody else is currently doing there driving test! Please be patient.");
        else if (InventInfo[playerid][iCarLic] == 1) return SendClientMessage(playerid, ERROR_COLOR, "[!] You already have a valid drivers license!");
        else
        {
            DrivingTestVeh = CreateVehicle(405,1500.540283,-1039.090209,23.573339,262.772949,-1,-1,10000);
            GivePlayerMoney(playerid, 0 - 500);
            InBuildingID[playerid] = 0;
            TextDrawHideForPlayer(playerid,FCdmv);
            SetPlayerInterior(playerid,0);
            DriveTest[playerid] = 1;
            SetPlayerCheckpoint(playerid, 1558.131713,-1068.965454,23.423524, 4.0);
            PutPlayerInVehicle(playerid,DrivingTestVeh,0);
            DriveTestAlready = 1;
        }
    }
    return 1;
}
Reply
#2

This is very odd...so basically it puts you into a vehicle that doesn't exist? Are you sure your coordinates are right? Maybe you should try using:

Код:
LinkVehicleToInterior(DrivingTestVeh, 0);
Although I'm not sure why it wouldn't be working as it should in the first place. The only other thing I can think of at the moment is that you might have too many vehicles?
Reply
#3

Quote:
Originally Posted by lol2112
This is very odd...so basically it puts you into a vehicle that doesn't exist? Are you sure your coordinates are right? Maybe you should try using:

Код:
LinkVehicleToInterior(DrivingTestVeh, 0);
Although I'm not sure why it wouldn't be working as it should in the first place. The only other thing I can think of at the moment is that you might have too many vehicles?
Ahh' I've tried Linking to Interior like you said and still no change...
And i've redone the Coords 3 times now.
There is only 34 Vehicles in my script at the moment aswell...

So yeah it is very odd...
Reply
#4

Hmm. I have an idea. I think the problem might be the fact that you're going from an interior into the car...I know you've used SetPlayerInterior but I think it might still be causing some problems. I think that if you're in an interior then any cars spawned won't be counted as spawning on your client if you get what I mean...Also try putting the CreateVehicle and PutPlayerInVehicle functions together. So basically try this:

Код:
SetPlayerPos(playerid, 1500.540283,-1039.090209,23.573339);
SetPlayerInterior(playerid, 0);
DrivingTestVeh = CreateVehicle(405,1500.540283,-1039.090209,23.573339,262.772949,-1,-1,10000);
PutPlayerInVehicle(playerid,DrivingTestVeh,0);
GivePlayerMoney(playerid, 0 - 500);
InBuildingID[playerid] = 0;
TextDrawHideForPlayer(playerid,FCdmv);
DriveTest[playerid] = 1;
SetPlayerCheckpoint(playerid, 1558.131713,-1068.965454,23.423524, 4.0);
DriveTestAlready = 1;
I'm fairly confident this will work...

Edit: Also, could I ask why you've set respawn as 10000 in your CreateVehicle command? That means the car will always respawn back at those coordinates, so when someone else uses /starttest there'll be two vehicles inside each other. I'd recommend either changing it to -1 (which means it'll never respawn if it gets destroyed) or use DestroyVehicle(DrivingTestVeh).. Just a thought.
Reply
#5

Still no change in the problem... Hmm..
The respawnign thing:
When a player leaves the car the Vehicle is destroyed and he/she fails the test, when the driving test is complete/failed the vehicle is destroyed, and if the player disconnects the vehicle is destroyed..
Reply
#6

I'm sorry I'm all out of ideas. Only thing I can suggest is you use this command to run a quick test:

Код:
dcmd_Spawn(playerid, params[])
{
    #pragma unused params
     new Float:x,Float:y, Float:z;
     GetPlayerPos(playerid, x,y,z);
     DrivingTestVeh = CreateVehicle(405,x, y, z, 90.0,-1,-1,-1);
     PutPlayerInVehicle(playerid, DrivingTestVeh, 0);
     return 1;
}
and just see if it works.
Reply
#7

Yep, That Spawn command Works...

I'm just going to try and Set the players Pos, Get the pos afetr that and do CreateVehicle(405,x,y,z...
Ill Edit and say the outcome...

EDit: Nope, that failed aswell...
Reply
#8

Why on earth doesn't it work! Try using that spawn command, and get it to spawn the vehicle where you want the vehicle to be in your script, then come out of the interior and see if it's there...if it's not then you know it has something to do with the player moving interiors.
Reply
#9

Ahh I revised all the lines in my script and forgot to notice that My Building system changes the virtual world of the player, So i linked the vehcile to the Virtual world and it is now working..

Sorry for wasteing your time lol2112, I should've noticed this mistake..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)