Satla-Zone
התחברות
+ הגב לנושא
מציג תוצאות 1 עד 3 מתוך 3

אשכול: פרסום|מצלמה זזה בבחירת שחקן

  1. #1
    הסמל האישי של o F i R
    o F i R נינג'ה
    תאריך הצטרפות
    22/10/08
    שם פרטי
    אופיר
    הודעות
    3,865
    קיבל לייק
    0 פעמים

    פרסום|מצלמה זזה בבחירת שחקן

    לינק למקור:
    http://forum.sa-mp.com/index.php?topic=115765.0
    דוגמא:

    אם אין לכם מוד LARP או GF רק מוד רגיל תעתיקו את זה למעלה:
    קוד PHP:
    //where the player will spawn
    #define player_x -250.9738
    #define player_y 2585.6497
    #define player_z 63.5703
    #define player_angle 210.3500

    //PLAYER CAMERA, THE ONE YOU CREATE SO YOU CAN SEE THE PLAYER
    //note: for a better effect, let the camera be a few meters away from the player
    #define camera_x -248.9410
    #define camera_y 2581.5327
    #define camera_z 64.9334

    //ATTENTION; THESE ARE MILISECONDS
    //untested, but it should work in theory. The smaller the value, the faster the camera.
    #define moving_speed 50

    //declaring stuff
    //IMPORTANT: FOR THE CODE TO WORK, YOU MUST DEFINE THE ENUM BEFORE PlayerInfo
    //just copy it like It's written here
    enum pInfo
    {
    bool:SpawnDance,
    Float:SpawnAngle,
    SpawnTimer
    };

    new 
    PlayerInfo[MAX_PLAYERS][pInfo]; 
    אבל אם יש לכם מוד ארפי תשימו כך:
    קוד PHP:
    //where the player will spawn
    #define player_x -250.9738
    #define player_y 2585.6497
    #define player_z 63.5703
    #define player_angle 210.3500

    //PLAYER CAMERA, THE ONE YOU CREATE SO YOU CAN SEE THE PLAYER
    //note: for a better effect, let the camera be a few meters away from the player
    #define camera_x -248.9410
    #define camera_y 2581.5327
    #define camera_z 64.9334

    //ATTENTION; THESE ARE MILISECONDS
    //untested, but it should work in theory. The smaller the value, the faster the camera.
    #define moving_speed 50

    //declaring stuff
    //IMPORTANT: FOR THE CODE TO WORK, YOU MUST DEFINE THE ENUM BEFORE PlayerInfo
    //just copy it like It's written here 
    עכשיו תחפשו במוד PINFO מצאתם? רדו למטה לסוף הרשימה ותוסיפן את זה:
    קוד PHP:
    enum pInfo
    {
    bool:SpawnDance,
    Float:SpawnAngle,
    SpawnTimer
    }; 
    וזהו עכשיו גם למי שיש מוד DM וגם ארפי לעקוב אחרי הדברים שאני מראה..
    לכו לפובליק
    קוד PHP:
    public OnPlayerRequestClass(playerid, classid) 
    שם איפה שאתם רואים
    SetPlayerCameraPos
    וכל אלה תשמרו להם גיבוי אם אחרי זה לא תאהבו תמערכת ותמחקו את כל הקודים האלה שם..לא את כל הפאבליק!
    ואז שימו:
    קוד PHP:
    SetPlayerPos(playerid, player_x,player_y,player_z);
    SetPlayerFacingAngle(playerid, player_angle);
    SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
    SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
    ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //smooth dancing. It's most fitting to the music
    PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
    //making sure the timer gets executed only once, so the camera doesn't go to fast
    if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
    PlayerInfo[playerid][SpawnDance] = false; //preventing the timer to execute again[RIGHT][/RIGHT] 

    לכו לפאבליק
    קוד PHP:
    public OnPlayerConnect(playerid) 
    ושימו שם את הקוד:
    קוד PHP:
    PlayerInfo[playerid][SpawnDance] = true; 
    לכו לפאבליק
    קוד PHP:
    public OnPlayerSpawn(playerid) 
    ושימו:
    קוד PHP:
        PlayerInfo[playerid][SpawnAngle] = 0.0; //so when you leave and another player comes, the camera will start from start
        
    PlayerInfo[playerid][SpawnDance] = true; //to not execute to much timers
    KillTimer( PlayerInfo[playerid][SpawnTimer] ); //to kill it, since its useless now
    PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0); // (blank sound) to shut the music up
            
    SetCameraBehindPlayer(playerid); //to prevent some bugs 
    לכו לפאפבליק
    קוד PHP:
    public OnPlayerDisconnect(playerid, reason) 
    הוסיפו לו את הקוד:
    קוד PHP:
        KillTimer( PlayerInfo[playerid][SpawnTimer] ); 
    הכי למטה במוד:
    קוד PHP:
    //The business part of the code
    forward MoveCamera(playerid);
    public 
    MoveCamera(playerid)
    {
    //this is called trigonometry. It makes the camera spin
    //you can experiment with this line. Just change the values 2, 10 and 3 to make different effects
        
    SetPlayerCameraPos(playerid, player_x - 2 * floatsin(-PlayerInfo[playerid][SpawnAngle], degrees), player_y - 10 * floatcos(-PlayerInfo[playerid][SpawnAngle], degrees), player_z + 3);
        
    SetPlayerCameraLookAt(playerid, player_x, player_y, player_z + 0.5);
        
    //changing the angle a little
        
    PlayerInfo[playerid][SpawnAngle] += 0.5;

        if (
    PlayerInfo[playerid][SpawnAngle] >= 360.0)
            
    PlayerInfo[playerid][SpawnAngle] = 0.0;

    } 
    וזהו תהנו! קרדיט לסאמפ העולמי

  2. #2
    הסמל האישי של Boss
    Boss ותיק
    תאריך הצטרפות
    10/07/07
    שם פרטי
    אדי ツ
    הודעות
    1,449
    קיבל לייק
    0 פעמים
    WTF חזק אחי

  3. #3
    הסמל האישי של LonleyGangster
    LonleyGangster גורו
    תאריך הצטרפות
    20/06/08
    שם פרטי
    זוהר :P
    הודעות
    2,380
    קיבל לייק
    0 פעמים
    ווואי סוס אחי.

+ הגב לנושא

תגובה מהירה תגובה מהירה

כתובת המייל לא תוצג בפורום.

נושאים דומים

  1. פרסום שחקן סוס ותחון במייפל
    על ידי -lidoR בפורום Maple Story
    תגובות: 16
    הודעה אחרונה: 02/06/09, 16:40
  2. פרסום| מערכת CamHack - מצלמה מעופפת
    על ידי KipoD בפורום Pawno & Scripting
    תגובות: 10
    הודעה אחרונה: 26/03/09, 22:40
  3. תגובות: 25
    הודעה אחרונה: 05/03/09, 21:34
  4. פירסום| מידע שיעזור לכם בבחירת שחקן
    על ידי SiSo בפורום Silkroad Online
    תגובות: 0
    הודעה אחרונה: 23/12/07, 16:29
  5. שחקן השנה של פיפא: רונאלדיניו
    על ידי BigiD בפורום פח זבל
    תגובות: 7
    הודעה אחרונה: 21/12/04, 16:49
eXTReMe Tracker