13.05.2015, 14:17
Bug: Functions
Action: No effect. As the team breaks in the call.
My script:
PHP код:
SetPlayerObjectRot(playerid, objectid, Float:RotX, Float:RotY, Float:RotZ);
SetObjectRot(objectid, Float:RotX, Float:RotY, Float:RotZ);
My script:
PHP код:
new car_weapon[1];
public OnPlayerCommandText(playerid, cmdtext[])
{
new msg[MAX_MSG_SIZE];
if (strcmp("/arm", cmdtext, true, 10) == 0)
{
if (IsPlayerInAnyVehicle(playerid)) {
//car_weapon[0] = CreateObject(18848, 0.0,0.0,0.0, 0.0,0.0,0.0, 500.0);
//AttachObjectToVehicle(car_weapon[0], GetPlayerVehicleID(playerid), 0.0000,-1.5000,-0.5000, 0.0,0.0,0.0);
car_weapon[0] = CreatePlayerObject(playerid, 18848, 0.0,0.0,0.0, 0.0,0.0,0.0, 500.0);
AttachPlayerObjectToVehicle(playerid, car_weapon[0], GetPlayerVehicleID(playerid), 0.0000,-1.5000,-0.5000, 0.0,0.0,0.0);
return 1;
}
}
if (strcmp("/darm", cmdtext, true, 10) == 0)
{
if(IsValidObject(car_weapon[0])) DestroyObject(car_weapon[0]);
else if(IsValidPlayerObject(playerid, car_weapon[0])) DestroyPlayerObject(playerid, car_weapon[0]);
return 1;
}
if (strcmp("/arm180", cmdtext, true, 10) == 0)
{
new Float:rx, Float:ry, Float:rz;
//GetObjectRot(car_weapon[0], rx, ry, rz);
GetPlayerObjectRot(playerid, car_weapon[0], rx, ry, rz);
format(msg, 256, "GetObjRot (%d) xyz: %.1f,%.1f,%.1f", car_weapon[0], rx, ry, rz);
SendClientMessage(playerid, COLOR_DEFAULT, msg);
//SetObjectRot(car_weapon[0], rx, 180.0, rz);
//GetObjectRot(car_weapon[0], rx, ry, rz);
SetPlayerObjectRot(playerid, car_weapon[0], rx, 180.0, rz);
GetPlayerObjectRot(playerid, car_weapon[0], rx, ry, rz);
format(msg, 256, "SetObjRot (%d) set_y 180.0 current_rot xyz: %.1f,%.1f,%.1f", car_weapon[0], rx, ry, rz);
return 1;
}
if (strcmp("/car", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
new id = CreateVehicle(400+random(212),x,y,z, a, -1,-1, 60);
PutPlayerInVehicle(playerid, id, 0);
return 1;
}
return 0;
}