Jump to content

[O comanda utila ] Save Camera


khain.dev

Recommended Posts

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
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.