SetPlayerInterior,CameraPos,LookAt,FacingAngle HELP
#1

Hi there! Anyone here have a better view when player will spawn in game? idontknow really what is that called.. but this will show you all..

this things are from stevo127's sfcnrrpg

Код:
SetPlayerInterior(playerid,0);
	  SetPlayerPos(playerid,-1753.6743,885.2703,295.8750);
          SetPlayerCameraPos(playerid,-1753.6849,892.0016,295.8750);
	  SetPlayerCameraLookAt(playerid,-1753.6743,885.2703,295.8750);
	  SetPlayerFacingAngle(playerid,0.6323);
i dont like this view its kinda irritate my eyes coz of the light on the top of the building.. anyone here have better??
Reply
#2

I've made a little command for you that you can add to your script that you can use to easily save player- and camera-positions.

How to use it:
- Go to any location you like,
- Position your player and the camera how you want it to show up in Class Selection
- Type /saveloc [+optional description]
- Open server_log.txt
- At the bottom you'll find the coordinates of your player and camera as well as interior ID
- Copy and paste those values to the according functions in your OnPlayerRequestClass-callback
- Recompile the script and restart the server.
- Enjoy your new Class-selection location!

I assume you are using zcmd, if not, let me know.

pawn Код:
COMMAND:saveloc(playerid, params[])

    new Float:loc[7], pint, description[64];
    sscanf(params, "s", description);
    GetPlayerPos(playerid, loc[0], loc[1], loc[2]);
    GetPlayerFacingAngle(playerid, loc[3]);
    pint = GetPlayerInterior(playerid);
    GetPlayerCameraPos(playerid, loc[4], loc[5], loc[6]);
    print("/*---------Saved Location: ---------*/");
    printf("Description: %s", description);
    printf("Interior: %d", pint);
    printf("Player X, Y, Z: %.4f, %.4f, %.4f", loc[0], loc[1], loc[2]);
    printf("Player angle: %.2f", loc[3]);
    printf("Camera X, Y, Z: %.4f, %.4f, %.4f", loc[4], loc[5], loc[6]);
    printf("Camera Lookat: %.4f, %.4f, %.4f", loc[0], loc[1], (loc[2]+0.5));
    print("/*-----------------------------------*/");
    SendClientMessage(playerid, 0x33AA33AA, "Location saved succesfully in the server log");
    return 1;
}
Example:
Reply
#3

You use #pragma unused params yet use it with sscanf. Do you know what #pragma unused does?
Reply
#4

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You use #pragma unused params yet use it with sscanf. Do you know what #pragma unused does?
You're right, not necessary with zcmd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)