29.10.2017, 11:31
Hi guys.
My problem is:
If someone shoot player who is car then player get damage.That end it?
My code is:
My problem is:
If someone shoot player who is car then player get damage.That end it?
My code is:
Код:
public OnPlayerVehicleDamage(playerid,vehicleid, Float:Damage) { new vehiclec = GetPlayerVehicleID(playerid); if(vInfo[vehicleid][BEINDITVA]==true ) { for(new i; i < MAX_PLAYERS; i++) { if(AdminSzoliban[i] != 1 && ModeratorSzoliban[i] != 1) { if(GetPlayerVehicleID(i) == vehiclec) { if(BOV[i] == 0) { if( Damage > 100.0 && Damage < 220.0) //sъlyos { TogglePlayerControllable(i, false); SendClientMessage(i,PIROS,"((Sъlyosan megsйrьltйl!))"); cmd_do(i,"sъlyosan megsйrьlt."); KocsiOff(vehicleid); Serult[i] = true; beszorult[i] = true; new Float: HP; GetPlayerHealth(i, HP); SetPlayerHealth(i, HP-35); format(serulese[i], 64, "Sъlyos sйrьlйsek a testen"); } if( Damage > 220.0) //szцrnyethalбs { SendClientMessage(i,PIROS,"((Szцrnyethaltбl!))"); cmd_do(i,"szцrnyethalt."); SetVehicleHealth(vehicleid,253.0); KocsiOff(vehicleid); new Float: PosXa, Float: PosYa, Float: PosZa; GetPlayerPos(i, PosXa, PosYa, PosZa); SetPlayerPos(i, PosXa, PosYa, PosZa + 0.1); SetPlayerHealth(i,0.0); } if( Damage > 75.0 && Damage < 100.0) //kцnnyebb { SendClientMessage(i,PIROS,"((Kцnnyebben megsйrьltйl!))"); cmd_do(i,"kцnnyebben megsйrьlt."); new Float: HP; GetPlayerHealth(i, HP); SetPlayerHealth(i, HP-20); } } else { if( Damage > 200.0 && Damage < 260.0) //sъlyos { TogglePlayerControllable(i, false); SendClientMessage(i,PIROS,"((Sъlyosan megsйrьltйl!))"); cmd_do(i,"sъlyosan megsйrьlt."); KocsiOff(vehicleid); Serult[i] = true; beszorult[i] = true; new Float: HP; GetPlayerHealth(i, HP); SetPlayerHealth(i, HP-25); format(serulese[i], 64, "Sъlyos sйrьlйsek a testen"); } if( Damage > 260.0 ) //szцrnyethalбs { SendClientMessage(i,PIROS,"((Szцrnyethaltбl!))"); cmd_do(i,"szцrnyethalt."); SetVehicleHealth(vehicleid,253.0); KocsiOff(vehicleid); new Float: PosXa, Float: PosYa, Float: PosZa; GetPlayerPos(i, PosXa, PosYa, PosZa); SetPlayerPos(i, PosXa, PosYa, PosZa + 0.1); SetPlayerHealth(i,0.0); } if( Damage > 165.0 && Damage < 200.0) //kцnnyebb { SendClientMessage(i,PIROS,"((Kцnnyebben megsйrьltйl!))"); cmd_do(i,"kцnnyebben megsйrьlt."); new Float: HP; GetPlayerHealth(i, HP); SetPlayerHealth(i, HP-15); } } } } } } return 1; }