Jump to content

Recommended Posts

Posted (edited)

Buna! Probabil ca fiecare a intilnit problema cu salvarea coordonatelor a camerei,pai uite ca datorita acestei comenzi,usor si repede salvati coordonatele.
- Cum lucreaza comanda?
- Usor, intri pe server,te apropii in locul unde doresti  ca exemplu sa apara jucatorul pentru a alege skinul,scrii comanda /scamera si coordonatele se salveaza in scriptfiles.

 

CMD:scamera(playerid, params[]) {
        static const
        fmt_str0[] = "SetPlayerCameraPos(playerid, %f, %f, %f);\n",
        fmt_str1[] = "SetPlayerCameraLookAt(playerid, %f, %f, %f);\n";
        const
        fmt_size0 = sizeof(fmt_str0) + (-2 + 11) * 3,
        fmt_size1 = sizeof(fmt_str1) + (-2 + 11) * 3;
        #if fmt_size0 > fmt_size1
        #define final_size fmt_size0
        #else
        #define final_size fmt_size1
        #endif
        new
        str[final_size],
        File: cam_file = fopen("coordonate.ini", io_append),
        Float: cam_pos_axis_x,
        Float: cam_pos_axis_y,
        Float: cam_pos_axis_z,
        Float: cam_pos_vec_axis_x,
        Float: cam_pos_vec_axis_y,
        Float: cam_pos_vec_axis_z;
        #undef final_size
        GetPlayerCameraPos(playerid, cam_pos_axis_x, cam_pos_axis_y, cam_pos_axis_z);
        GetPlayerCameraFrontVector(playerid, cam_pos_vec_axis_x, cam_pos_vec_axis_y, cam_pos_vec_axis_z);
        format(str, sizeof(str), fmt_str0, cam_pos_axis_x, cam_pos_axis_y, cam_pos_axis_z);
        fwrite(cam_file, str);
        format(str, sizeof(str), fmt_str1, cam_pos_axis_x + 5.0 * cam_pos_vec_axis_x, cam_pos_axis_y + 5.0 * cam_pos_vec_axis_y, cam_pos_axis_z + 5.0 * cam_pos_vec_axis_z);
        fwrite(cam_file, str);
        return fclose(cam_file);
}

Va multumesc,si sper ca va fi de folos!?

Edited by #Yudin
  • Like 1
  • Thanks 1
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.