new Text3D:vehdamage;GameModeInit ala:vehdamage = Create3DTextLabel( \"VehDamage\", 0x008080FF, 0.0, 0.0, 0.0, 50.0, 0, 1);public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){ Attach3DTextLabelToVehicle( vehdamage, vehicleid, 0.0, 0.0, 2.0); dmgupdate = SetTimer(\"damageupdate\", 2000, 1); return 1;}public OnPlayerExitVehicle(playerid, vehicleid){ KillTimer(dmgupdate); Delete3DTextLabel(Text3D:vehdamage); return 1;}public damageupdate(playerid){new dmgstr[10],Float:vhp;new vehicleid = GetPlayerVehicleID(playerid);GetVehicleHealth(vehicleid, vhp);if(900 < vhp <= 1000) {format(dmgstr, sizeof(dmgstr), \"{2bff00}oooooooooo\");} else if(800 < vhp <= 900) { format(dmgstr, sizeof(dmgstr), \"{2bff00}ooooooooo\"); } else if(700 < vhp <= 800) { format(dmgstr, sizeof(dmgstr), \"{2bff00}oooooooo\");} else if(600 < vhp <= 700) { format(dmgstr, sizeof(dmgstr), \"{2bff00}ooooooo\");} else if(500 < vhp <= 600) { format(dmgstr, sizeof(dmgstr), \"{2bff00}oooooo\");} else if(400 < vhp <= 500) { format(dmgstr, sizeof(dmgstr), \"{2bff00}ooooo\");} else if(300 < vhp <= 400) { format(dmgstr, sizeof(dmgstr), \"{2bff00}oooo\");} else if(200 < vhp <= 300) { format(dmgstr, sizeof(dmgstr), \"{2bff00}ooo\");} else if(100 < vhp <= 200) { format(dmgstr, sizeof(dmgstr), \"{2bff00}oo\");}Update3DTextLabelText(vehdamage, 0xFFFFFFFF, dmgstr);return 1;}
Ha 900-1000 hp ja van a kocsinak akkor 10 csik,ha 800-900 akkor 9csikotmutat a 3dtext