SA-MP Forums Archive
[Not Solved] Help, (Expert Scripters) (PRO) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Not Solved] Help, (Expert Scripters) (PRO) (/showthread.php?tid=244575)



[Not Solved] Help, (Expert Scripters) (PRO) - Alex_Obando - 27.03.2011

I have this code, I want that when I press the arrow keys then move the camera.


pawn Код:
if (strcmp(cmdtext, "/MBcam", true) == 0)
    {
    if(IsPlayerAdmin(playerid))
    {
        SetPlayerCameraPos(playerid, 2848.91, 1692.19, 16.35);
        SetPlayerCameraLookAt(playerid, 2860.95, 1730.52, 10.88);

        new Float:pos[4];
        GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        GetPlayerFacingAngle(playerid, pos[3]);
        SetPVarFloat(playerid, "PosX", pos[0]);
        SetPVarFloat(playerid, "PosY", pos[1]);
        SetPVarFloat(playerid, "PosZ", pos[2]);
        SetPVarFloat(playerid, "PosA", pos[3]);
        SetPlayerPos(playerid,2848.91, 1692.19, 16.35);
        TogglePlayerControllable(playerid, 0);

        SendClientMessage(playerid,0xff0000ff, "----------------------------------");
        SendClientMessage (playerid, COLOR_YELLOW, "You are camming Miliary Base.");
        SetPVarInt(playerid, "seccam", 1);
        return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_YELLOW, "You are not Member");
    return 1;
        }
    }



Re: [Not Solved] Help, (Expert Scripters) (PRO) - mprofitt - 27.03.2011

OnPlayerKeyStateChange ??


Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - Alex_Obando - 27.03.2011

I don't know, I just want that when I press the arrow keys then move the camera.
(Look to the right, left, up or down) position.


Re: Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - mprofitt - 27.03.2011

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
I don't know, I just want that when I press the arrow keys then move the camera.
(Look to the right, left, up or down) position.
OnPlayerKeyStateChange and/or GetPlayerKeys(playerid, &keys, &updown, &leftright)
This will do what you want.


Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - Alex_Obando - 27.03.2011

Can you give me an example with my script?
Add what you say to it, its in the 1st post...


Re: Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - mprofitt - 27.03.2011

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
Can you give me an example with my script?
Add what you say to it, its in the 1st post...
So you want me to write it for you?

Код:
SetTimer("ChangeCamPos"...)

ChangeCameraPos(...)

     GetPlayerKeys(playerid , ...)
          if player is pressing up key
               move camera x+
          if player is pressing down key
               move camera x-
          if player is pressing right key
               move camera y+
          if player is pressing left key
               move camera y-
If you want fancy camera rotation and stuff, you better know some trig


Re: [Not Solved] Help, (Expert Scripters) (PRO) - DRIFT_HUNTER - 27.03.2011

Download LuxAdmin System its have integrated moving camera (camhack)


Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - Alex_Obando - 27.03.2011

Dude, what I need is you to put my code and add this stuff, My skeelz are not that great like yours, please put my code and add your stuff to mines....





Everything will be appreciated, Alex.


Re: Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - mprofitt - 27.03.2011

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
Dude, what I need is you to put my code and add this stuff, My skeelz are not that great like yours, please put my code and add your stuff to mines....





Everything will be appreciated, Alex.
I appreciate your appreciation but I only accept the appreciation in the form of coinage, like paypal credits. When I feel that kind of appreciation, I can be much more specific.


Respuesta: [Not Solved] Help, (Expert Scripters) (PRO) - Alex_Obando - 27.03.2011

Just give me a little example here because I dont know how to make it, look, i take the idea from here:


https://sampforum.blast.hk/showthread.php?tid=68492