Posts: 6,242
Threads: 8
Joined: Jun 2008
GetPlayerFacingAngle and using trigonometry... You know, that thing that you didn't learn, in those classes because you thought it wasn't "needed". xD
Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
no i was never learning that i think and my mind blowns up when i think about it, i kinda know how to do it but i don't at the same time lmao
Posts: 6,242
Threads: 8
Joined: Jun 2008
I got told in school I'd only ever pass English, but in the end failed English, passed Maths and Science, and most of my class time in both of those classes was sleeping in the back of the class.
Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
lol ok, but do u know how to make it? anyone?
Posts: 1,208
Threads: 36
Joined: Apr 2015
PHP код:
new Float:x,Float:y,Float:z,
Float:tx,Float:ty,Float:tz,
Float:rx,Float:rz,Float:offset_rz;
GetPlayerPos(center_playerid,x,y,z);
GetPlayerFacingAngle(center_playerid,offset_rz);
GetPlayerPos(circle_playerid,tx,ty,tz);
GetRotationFor2Point3D(x,y,z,tx,ty,tz,rx,rz);
CompRotationFloat(rz-offset_rz,rz);
//compare rz
3DTryg:
https://sampforum.blast.hk/showthread.php?tid=591010
Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
Erm, would it be possible without any additional includes?
Posts: 6,242
Threads: 8
Joined: Jun 2008
In the thread it says it only needs the plugins for the more advanced portions. Check that thread, it seems like it shouldn't need anything extra.
PHP код:
GetRotationFor2Point3D(x,y,z,tx,ty,tz,rx,rz);
CompRotationFloat(rz-offset_rz,rz);
Those are the 2 functions that the include is needed for. They don't seem like they are under the plugin required listings.
Posts: 1,208
Threads: 36
Joined: Apr 2015
3DTryg. It does not require plug-ins.
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart){
if(damagedid != INVALID_PLAYER_ID){
new Float:x,Float:y,Float:z,
Float:tx,Float:ty,Float:tz,
Float:rx,Float:rz,Float:offset_rz;
GetPlayerPos(damagedid,x,y,z);
GetPlayerFacingAngle(damagedid,offset_rz);
GetPlayerPos(playerid,tx,ty,tz);
GetRotationFor2Point3D(x,y,z,tx,ty,tz,rx,rz);
CompRotationFloat(rz-offset_rz,rz);
//compare rz
if((rz >= 0.0 && rz <= 45.0) || (rz >= 315.0 && rz <= 360.0)){
//front of skin
} else if(rz >= 45.0 && rz <= 135.0){
//right of skin
} else if(rz >= 135.0 && rz <= 225.0){
//back of skin
} else if(rz >= 225.0 && rz <= 315.0){
//left of skin
}
}
return 1;
}