Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include dof2
- #include pawn.cmd
- new pVehicleID[MAX_PLAYERS] = {INVALID_VEHICLE_ID, ...};
- new Float:pVehiclePos[MAX_PLAYERS][4];
- main(){}
- public OnGameModeExit()
- {
- DOF2::Exit();
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- switch(oldstate)
- {
- case PLAYER_STATE_DRIVER:
- {
- if(pVehicleID[playerid] != INVALID_VEHICLE_ID)
- {
- new file[16 + MAX_PLAYER_NAME];
- format(file, sizeof(file), "Veículos/%s.ini", GetPlayerNameEx(playerid));
- if(!DOF2::FileExists(file))
- DOF2::CreateFile(file);
- GetVehiclePos(pVehicleID[playerid], pVehiclePos[playerid][0], pVehiclePos[playerid][1], pVehiclePos[playerid][2]);
- GetVehicleZAngle(pVehicleID[playerid], pVehiclePos[playerid][3]);
- DestroyVehicle(pVehicleID[playerid]);
- pVehicleID[playerid] = CreateVehicle(560, pVehiclePos[playerid][0], pVehiclePos[playerid][1], pVehiclePos[playerid][2], pVehiclePos[playerid][3], -1, -1, -1);
- DOF2::SetFloat(file, "X", pVehiclePos[playerid][0]);
- DOF2::SetFloat(file, "Y", pVehiclePos[playerid][1]);
- DOF2::SetFloat(file, "Z", pVehiclePos[playerid][2]);
- DOF2::SetFloat(file, "A", pVehiclePos[playerid][3]);
- DOF2::SaveFile();
- }
- }
- }
- return 1;
- }
- GetPlayerNameEx(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- return name;
- }
- CMD:v(playerid)
- {
- GetPlayerPos(playerid, pVehiclePos[playerid][0], pVehiclePos[playerid][1], pVehiclePos[playerid][2]);
- GetPlayerFacingAngle(playerid, pVehiclePos[playerid][3]);
- pVehicleID[playerid] = CreateVehicle(560, pVehiclePos[playerid][0], pVehiclePos[playerid][1], pVehiclePos[playerid][2], pVehiclePos[playerid][3], -1, -1, -1);
- PutPlayerInVehicle(playerid, pVehicleID[playerid], 0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement