27.01.2011, 15:08
(
Последний раз редактировалось Kingunit; 27.07.2011 в 21:59.
)
<fixed>
SetPlayerPos(playerid, X,Y,Z); //Where player will be standing
SetPlayerCameraPos(playerid, X,Y,Z); //Where camera will be
SetPlayerFacingAngle(playerid, angle); //Where player will be facing
SetPlayerCameraLookAt(playerid, X,Y,Z); //Put same coords that you used in SetPlayerPos.
OnPlayerCommandText(playerid, cmdtext[])
{
//[...] //You need the strtok to add this
if(strcmp(cmd, "/getpos", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Debug Command!");
new Float:x, Float:y, Float:z, Float:Zangle, Float:angle;
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,angle);
GetVehicleZAngle(vehicleid, Zangle);
SendClientMessage(playerid,COLOR_YELLOW,"Position Saved.");
print(" ");
print("___________________________________________________");
print("__________________SAVED_POSITION___________________");
if(!IsPlayerInAnyVehicle(playerid)) printf("%f,%f,%f,%f",x,y,z,angle);
if(IsPlayerInAnyVehicle(playerid)) printf("CreateVehicle(MOD,%f,%f,%f,%f,CO1,CO2,1000000);",x,y,z,Zangle);
printf("Interior: %d",GetPlayerInterior(playerid));
print(" ");
return 1;
}
//[...]
}
[17:04:34] __________________________________________________ [17:04:34] ________________SAVED_POSITION_________________ [17:04:34] 2402.397949,-1720.991088,13.612230,179.039367 [17:04:34] Interior: 0 [17:04:34] [17:04:40] [chat] [Pinki11]: spawn point of denise [17:04:45] [17:04:45] __________________________________________________ [17:04:45] ________________SAVED_POSITION_________________ [17:04:45] 2402.473144,-1716.154541,13.860107,357.786102 [17:04:45] Interior: 0 [17:04:45] [17:04:56] [chat] [Pinki11]: pos of the pickup [17:05:27]
AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
|
modelid = The skin model spawn_x = The X Array of the saved pos with my /getpos (look my first post in this topic) spawn_y = The Y Array of the saved pos with my /getpos (look my first post in this topic) spawn_z = The Z Array of the saved pos with my /getpos (look my first post in this topic) z_angle = The facing angle. 0 = player looking at north. 180 = player looking at south. 90 and 270 are east and west. I dont know what's east and whats west. weapon 1 - 2 - 3 = The 3 main weapons weapon_1 - 2 - 3_ammo = the ammo of the three weapons. |