SA-MP Forums Archive
Quick help - 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: Quick help (/showthread.php?tid=575763)



Quick help - AlexBlack - 30.05.2015

Hi, this is the second time that i need help today, i have a bug , i'am scripting a First person driving system , but when i do the command to activate this mod , the cordinations of the camera is false.

PHP код:
stock StartFPS(playerid)
{
    new 
vehicleid = GetPlayerVehicleID(playerid);
    
FirstPersonObject[playerid] = CreateObject(19300, 40.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    if(
vehicleid == VehicleRoadTrain || vehicleid == VehicleLineRunner || vehicleid == 443) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, -0.539999, 1.639998, 0.669999, 0.000000, 0.000000, 0.000000);
    else if(
vehicleid == VehicleTanker) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, -0.444999, 1.799998, 0.699999, 0.000000, 0.000000, 0.000000);
    else if(
vehicleid == VehicleFlatbed) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, -0.499999, 1.394998, 1.134999, 0.000000, 0.000000, 0.000000); 
    else if(
vehicleid == VehicleDFT30) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, -0.494999, 3.730037, 0.609999, 0.000000, 0.000000, 0.000000);
    else if(
vehicleid == 522 || vehicleid == 521 || vehicleid == 523 || vehicleid == 509 || vehicleid == 510 || vehicleid == 481 || vehicleid == 581) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, 0.000000, 0.299999, 0.719999, 0.000000, 0.000000, 0.000000); 
    else if(
vehicleid == 468 || vehicleid == 471 ) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, 0.000000, 0.299999, 0.719999, 0.000000, 0.000000, 0.000000); 
    else if(
vehicleid == 519) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, 0.000000, 5.295073, 0.514999, 0.000000, 0.000000, 0.000000); 
    else if(
vehicleid == 577 || vehicleid == 592) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, -0.439999, 24.713855, 4.410053, 0.000000, 0.000000, 0.000000);
    else if(
vehicleid == VehicleCoach || vehicleid == 431) return AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000);
    else  return 
AttachObjectToVehicle(FirstPersonObject[playerid], vehicleid, -0.519999, -0.219999, 0.374999, 0.000000, 0.000000, 0.000000);
    
AttachCameraToObject(playerid, FirstPersonObject[playerid]);
    
FirstPerson[playerid] = 1;
    return 
1;
} 



Re : Quick help - AlexBlack - 30.05.2015

problem resolved , small fail , i'am using vehicle id but it should be vehicle model lol ...