10.07.2010, 14:23
anyone know how to get the angle directly below the player? i know how but i just dunno the angle>.< 0-180 w/e
new Float:A;
GetPlayerFacingAngle(playerid,A);
new Float:A;
GetPlayerFacingAngle(playerid,A);
SetPlayerFacingAngle(playerid,A);
CMD:cuff(playerid, params[])
{
new id, Float:x, Float:y, Float:z,Float:angle, idname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME],tmp[128];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF00AAFF, "*USAGE: /cuff [playerid / part of name]");
else if(gTeam[playerid] != TEAM_COPS) return SendClientMessage(playerid, 0xFF00AAFF, "*ERROR: You are not a Police Officer!");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF00AAFF, "*ERROR: Player is not connected,Invalid playerid Or Is Yourself!");
else if(IsPlayerInRangeOfPoint(id, 10, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "Player is not close enough!");
else
{
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, idname, sizeof(idname));
GetPlayerPos(strval(tmp),x,y,z);
GetPlayerFacingAngle(playerid, angle);
TogglePlayerControllable(id,false);
SendClientMessage(playerid, COLOR_GREY, "You Have Cuffed Citizen %s(%d)!");
SendClientMessage(id, COLOR_GREY, "You've Been Cuffed By Officer %s(%d)!");
SetPlayerPos(playerid,x+0.5,y,z);
SetPlayerFacingAngle(playerid, angle);
OnePlayAnim(playerid, "PYTHON", "python_crouchreload", 2.0, 0, 0, 0, 0, 0);
IsAnim[playerid] = 1;
}
return 1;
}