Akkoris többet vártam el a csapattól. (Vagy Kyetól XD)SetPlayerGhostMode, amit 4500-an megtekintettek, igazán betehette volna most is!
\" post=\"182479\" timestamp=\"1317673040\"]Az OnPlayerTakeDamage nálam nem mûködik NPC-n azt állítottam be ,hogy spawnoljon ha meglövik, de semmi, valaki megprobálná NPC-n tezstelni, hátha mûködne :/ [/quote]Nem is fog mûködni.Ha ennyire az életre akarsz kitérni akkor.http://controllable-npc.googlecode.com/svn/trunk/0.3.0/Controllable%20NPC%20SA-MP%200.3.0/plugin/CNPC.cpp int CNPC::WeaponDamage(int a_id,float cp_x,float cp_y,float cp_z,float f_x,float f_y,float f_z,float health,int weapon,int type){// varsfloat tmp_x;float tmp_y;float tmp_z;float np_x;float np_y;float np_z;float d_len;int part;// npc posGetPosition(&np_x,&np_y,&np_z);// get lentmp_x = np_x - cp_x;tmp_y = np_y - cp_y;tmp_z = np_z - cp_z;d_len = sqrt((tmp_x * tmp_x) + (tmp_y * tmp_y) + (tmp_z * tmp_z));// switch typeswitch(type){case DAMAGE_TYPE_RAKET:{ // get coords for range tmp_x = np_x - (cp_x + (d_len * f_x)); tmp_y = np_y - (cp_y + (d_len * f_y)); tmp_z = np_z - (cp_z + (d_len * f_z)); // part if(IsInRange(tmp_x,tmp_y,tmp_z,5.0)) part = BODYPART_ALL; else part = -1; break;}case DAMAGE_TYPE_GRENADE:{ if(IsInRange((np_x - cp_x),(np_y - cp_y),(np_z - cp_z),5.0f)) part = BODYPART_ALL; else part = -1; break;}case DAMAGE_TYPE_MEELE:{ if(IsInRange(tmp_x,tmp_y,tmp_z,0.5f)) part = BODYPART_ALL; else part = -1; break;}case DAMAGE_TYPE_BULLET:{ // get coords for range tmp_x = np_x - (cp_x + (d_len * f_x)); tmp_y = np_y - (cp_y + (d_len * f_y)); tmp_z = cp_z + (d_len * f_z); // part if(IsInRange(tmp_x,tmp_y,((np_z + 0.8f) - tmp_z),0.15f)) part = BODYPART_HEAD; else if(IsInRange(tmp_x,tmp_y,((np_z + 0.4f) - tmp_z),0.3f)) part = BODYPART_TORSO; else if(IsInRange(tmp_x,tmp_y,((np_z - 0.4f) - tmp_z),0.5f)) part = BODYPART_FOOT; else part = -1; break;}default:{ part = -1; break;}}if(part != -1){health -= WeaponsDamage[weapon];if(pCallbacks->GetDamage(local_id,a_id,WeaponsDamage[weapon],part)){ SetHealth(health); if(health <= 0.0) Kill(a_id,weapon);}if(part != BODYPART_ALL) return 1;}return 0;}
int CNPC::WeaponDamage(int a_id,float cp_x,float cp_y,float cp_z,float f_x,float f_y,float f_z,float health,int weapon,int type){// varsfloat tmp_x;float tmp_y;float tmp_z;float np_x;float np_y;float np_z;float d_len;int part;// npc posGetPosition(&np_x,&np_y,&np_z);// get lentmp_x = np_x - cp_x;tmp_y = np_y - cp_y;tmp_z = np_z - cp_z;d_len = sqrt((tmp_x * tmp_x) + (tmp_y * tmp_y) + (tmp_z * tmp_z));// switch typeswitch(type){case DAMAGE_TYPE_RAKET:{ // get coords for range tmp_x = np_x - (cp_x + (d_len * f_x)); tmp_y = np_y - (cp_y + (d_len * f_y)); tmp_z = np_z - (cp_z + (d_len * f_z)); // part if(IsInRange(tmp_x,tmp_y,tmp_z,5.0)) part = BODYPART_ALL; else part = -1; break;}case DAMAGE_TYPE_GRENADE:{ if(IsInRange((np_x - cp_x),(np_y - cp_y),(np_z - cp_z),5.0f)) part = BODYPART_ALL; else part = -1; break;}case DAMAGE_TYPE_MEELE:{ if(IsInRange(tmp_x,tmp_y,tmp_z,0.5f)) part = BODYPART_ALL; else part = -1; break;}case DAMAGE_TYPE_BULLET:{ // get coords for range tmp_x = np_x - (cp_x + (d_len * f_x)); tmp_y = np_y - (cp_y + (d_len * f_y)); tmp_z = cp_z + (d_len * f_z); // part if(IsInRange(tmp_x,tmp_y,((np_z + 0.8f) - tmp_z),0.15f)) part = BODYPART_HEAD; else if(IsInRange(tmp_x,tmp_y,((np_z + 0.4f) - tmp_z),0.3f)) part = BODYPART_TORSO; else if(IsInRange(tmp_x,tmp_y,((np_z - 0.4f) - tmp_z),0.5f)) part = BODYPART_FOOT; else part = -1; break;}default:{ part = -1; break;}}if(part != -1){health -= WeaponsDamage[weapon];if(pCallbacks->GetDamage(local_id,a_id,WeaponsDamage[weapon],part)){ SetHealth(health); if(health <= 0.0) Kill(a_id,weapon);}if(part != BODYPART_ALL) return 1;}return 0;}
Fixed a game crash when surfing an object which was deleted.[/quote]Ez nem a Te jelentésed volt kurta?