Здравствуйте, хотел сделать спидометр все коды записал правильно но после компиляции захожу в игру и на логотипе вместо названия сервера стоит "M". Помогите исправить пожалуйста
Страница 1 из 1
[ Pawn ]
speed + logo
Слетел логотип
#3
Отправлено 27 октября 2024 - 12:47
new Text:Speedometer0[MAX_PLAYERS]; new Text:Speedometer1[MAX_PLAYERS]; new Text:Speedometer2[MAX_PLAYERS]; new Text:Speedometer3[MAX_PLAYERS]; new Text:Speedometer4[MAX_PLAYERS]; new Text:Speedometer5[MAX_PLAYERS]; new Text:Speedometer6[MAX_PLAYERS]; new Text:Speedometer7[MAX_PLAYERS]; new Text:Speedometer8[MAX_PLAYERS]; new Text:Speedometer9[MAX_PLAYERS]; new Text:Speedometer11[MAX_PLAYERS]; new Text:Speedometer12[MAX_PLAYERS]; new Text:Speedometer13[MAX_PLAYERS]; new Text:Speedometer14[MAX_PLAYERS]; stock LoadSpeedometr(playerid) { Speedometer0[playerid] = TextDrawCreate(635.000000, 416.687500, "usebox"); TextDrawLetterSize(Speedometer0[playerid], 0.000000, 2.787499); TextDrawTextSize(Speedometer0[playerid], 493.500000, 0.000000); TextDrawAlignment(Speedometer0[playerid], 1); TextDrawColor(Speedometer0[playerid], 0); TextDrawUseBox(Speedometer0[playerid], true); TextDrawBoxColor(Speedometer0[playerid], 102); TextDrawSetShadow(Speedometer0[playerid], 0); TextDrawSetOutline(Speedometer0[playerid], 0); TextDrawFont(Speedometer0[playerid], 0); Speedometer1[playerid] = TextDrawCreate(635.000000, 403.125000, "usebox"); TextDrawLetterSize(Speedometer1[playerid], 0.000000, 1.043055); TextDrawTextSize(Speedometer1[playerid], 493.500000, 0.000000); TextDrawAlignment(Speedometer1[playerid], 1); TextDrawColor(Speedometer1[playerid], 0); TextDrawUseBox(Speedometer1[playerid], true); TextDrawBoxColor(Speedometer1[playerid], 102); TextDrawSetShadow(Speedometer1[playerid], 0); TextDrawSetOutline(Speedometer1[playerid], 0); TextDrawFont(Speedometer1[playerid], 0); Speedometer2[playerid] = TextDrawCreate(634.500000, 443.375000, "usebox"); TextDrawLetterSize(Speedometer2[playerid], 0.000000, -0.219444); TextDrawTextSize(Speedometer2[playerid], 494.000000, 0.000000); TextDrawAlignment(Speedometer2[playerid], 1); TextDrawColor(Speedometer2[playerid], 0); TextDrawUseBox(Speedometer2[playerid], true); TextDrawBoxColor(Speedometer2[playerid], 16711935); TextDrawSetShadow(Speedometer2[playerid], 0); TextDrawSetOutline(Speedometer2[playerid], 0); TextDrawFont(Speedometer2[playerid], 0); Speedometer3[playerid] = TextDrawCreate(498.000000, 401.187500, "NONE"); TextDrawLetterSize(Speedometer3[playerid], 0.278499, 1.337500); TextDrawAlignment(Speedometer3[playerid], 1); TextDrawColor(Speedometer3[playerid], -1); TextDrawSetShadow(Speedometer3[playerid], 0); TextDrawSetOutline(Speedometer3[playerid], 1); TextDrawBackgroundColor(Speedometer3[playerid], 51); TextDrawFont(Speedometer3[playerid], 2); TextDrawSetProportional(Speedometer3[playerid], 1); Speedometer4[playerid] = TextDrawCreate(499.000000, 416.062500, "SPEED"); TextDrawLetterSize(Speedometer4[playerid], 0.236000, 1.127500); TextDrawAlignment(Speedometer4[playerid], 1); TextDrawColor(Speedometer4[playerid], -1); TextDrawSetShadow(Speedometer4[playerid], 0); TextDrawSetOutline(Speedometer4[playerid], 1); TextDrawBackgroundColor(Speedometer4[playerid], 51); TextDrawFont(Speedometer4[playerid], 2); TextDrawSetProportional(Speedometer4[playerid], 1); Speedometer5[playerid] = TextDrawCreate(499.000000, 423.937500, "0"); TextDrawLetterSize(Speedometer5[playerid], 0.369498, 1.543124); TextDrawAlignment(Speedometer5[playerid], 1); TextDrawColor(Speedometer5[playerid], -1); TextDrawSetShadow(Speedometer5[playerid], 0); TextDrawSetOutline(Speedometer5[playerid], 1); TextDrawBackgroundColor(Speedometer5[playerid], 51); TextDrawFont(Speedometer5[playerid], 2); TextDrawSetProportional(Speedometer5[playerid], 1); Speedometer6[playerid] = TextDrawCreate(593.500000, 416.062500, "HEALTH"); TextDrawLetterSize(Speedometer6[playerid], 0.213499, 1.158124); TextDrawAlignment(Speedometer6[playerid], 1); TextDrawColor(Speedometer6[playerid], -1); TextDrawSetShadow(Speedometer6[playerid], 0); TextDrawSetOutline(Speedometer6[playerid], 1); TextDrawBackgroundColor(Speedometer6[playerid], 51); TextDrawFont(Speedometer6[playerid], 2); TextDrawSetProportional(Speedometer6[playerid], 1); Speedometer7[playerid] = TextDrawCreate(593.500000, 424.812500, "100"); TextDrawLetterSize(Speedometer7[playerid], 0.315499, 1.359375); TextDrawAlignment(Speedometer7[playerid], 1); TextDrawColor(Speedometer7[playerid], -1); TextDrawSetShadow(Speedometer7[playerid], 0); TextDrawSetOutline(Speedometer7[playerid], 1); TextDrawBackgroundColor(Speedometer7[playerid], 51); TextDrawFont(Speedometer7[playerid], 2); TextDrawSetProportional(Speedometer7[playerid], 1); Speedometer8[playerid] = TextDrawCreate(536.500000, 418.437500, "usebox"); TextDrawLetterSize(Speedometer8[playerid], 0.000000, 2.259722); TextDrawTextSize(Speedometer8[playerid], 532.000000, 0.000000); TextDrawAlignment(Speedometer8[playerid], 1); TextDrawColor(Speedometer8[playerid], 0); TextDrawUseBox(Speedometer8[playerid], true); TextDrawBoxColor(Speedometer8[playerid], 102); TextDrawSetShadow(Speedometer8[playerid], 0); TextDrawSetOutline(Speedometer8[playerid], 0); TextDrawFont(Speedometer8[playerid], 0); Speedometer9[playerid] = TextDrawCreate(593.000000, 418.437500, "usebox"); TextDrawLetterSize(Speedometer9[playerid], 0.000000, 2.233333); TextDrawTextSize(Speedometer9[playerid], 588.500000, 0.000000); TextDrawAlignment(Speedometer9[playerid], 1); TextDrawColor(Speedometer9[playerid], 0); TextDrawUseBox(Speedometer9[playerid], true); TextDrawBoxColor(Speedometer9[playerid], 102); TextDrawSetShadow(Speedometer9[playerid], 0); TextDrawSetOutline(Speedometer9[playerid], 0); TextDrawFont(Speedometer9[playerid], 0); Speedometer11[playerid] = TextDrawCreate(537.500000, 413.437500, "E"); TextDrawLetterSize(Speedometer11[playerid], 0.413000, 1.560625); TextDrawAlignment(Speedometer11[playerid], 1); TextDrawColor(Speedometer11[playerid], -1); TextDrawSetShadow(Speedometer11[playerid], 0); TextDrawSetOutline(Speedometer11[playerid], 1); TextDrawBackgroundColor(Speedometer11[playerid], 51); TextDrawFont(Speedometer11[playerid], 2); TextDrawSetProportional(Speedometer11[playerid], 1); Speedometer12[playerid] = TextDrawCreate(578.000000, 413.437500, "L"); TextDrawLetterSize(Speedometer12[playerid], 0.449999, 1.600000); TextDrawAlignment(Speedometer12[playerid], 1); TextDrawColor(Speedometer12[playerid], -1); TextDrawSetShadow(Speedometer12[playerid], 0); TextDrawSetOutline(Speedometer12[playerid], 1); TextDrawBackgroundColor(Speedometer12[playerid], 51); TextDrawFont(Speedometer12[playerid], 2); TextDrawSetProportional(Speedometer12[playerid], 1); Speedometer13[playerid] = TextDrawCreate(537.000000, 426.562500, "D"); TextDrawLetterSize(Speedometer13[playerid], 0.449999, 1.600000); TextDrawAlignment(Speedometer13[playerid], 1); TextDrawColor(Speedometer13[playerid], -1); TextDrawSetShadow(Speedometer13[playerid], 0); TextDrawSetOutline(Speedometer13[playerid], 1); TextDrawBackgroundColor(Speedometer13[playerid], 51); TextDrawFont(Speedometer13[playerid], 2); TextDrawSetProportional(Speedometer13[playerid], 1); Speedometer14[playerid] = TextDrawCreate(575.500000, 426.125000, "M"); TextDrawLetterSize(Speedometer14[playerid], 0.449999, 1.600000); TextDrawAlignment(Speedometer14[playerid], 1); TextDrawColor(Speedometer14[playerid], -1); TextDrawSetShadow(Speedometer14[playerid], 0); TextDrawSetOutline(Speedometer14[playerid], 1); TextDrawBackgroundColor(Speedometer14[playerid], 51); TextDrawFont(Speedometer14[playerid], 2); TextDrawSetProportional(Speedometer14[playerid], 1); } public UpdateSpeedometr(playerid, carid) { new Float:vehhealth; new Float:x,Float:y,Float:z; carid = GetPlayerVehicleID(playerid); SetSpeed(playerid, SpeedVehicle(playerid)); GetVehicleHealth(carid, vehhealth); SetLock(playerid, gCarLock[carid]); SetVehHealth(playerid, vehhealth); SetLights(playerid, Lights[carid]); SetEngine(playerid, Engine[carid]); SetMax(playerid, MaxSpeed[playerid]); if(MaxSpeed[playerid] == true) { GetVehicleVelocity(carid,x,y,z); if(SpeedVehicle(playerid) >= 200) { SetVehicleVelocity(carid, x*0.95, y*0.95, z); } } } stock SetSpeed(playerid, speed) { new string[4]; format(string, sizeof(string), "%d", speed); TextDrawSetString(Speedometer5[playerid], string); } stock SetVehHealth(playerid, Float:health) { new string[16]; format(string, sizeof(string), "%.0f%", health/10); TextDrawSetString(Speedometer7[playerid], string); } stock SetLock(playerid, status) { if(status == 1) { TextDrawSetString(Speedometer13[playerid], "~g~D"); } else if(status == 0) { TextDrawSetString(Speedometer13[playerid], "~y~D"); } } stock SetLights(playerid, bool:status) { if(status == true) { TextDrawSetString(Speedometer12[playerid], "~g~L"); } else if(status == false) { TextDrawSetString(Speedometer12[playerid], "~y~L"); } } stock SetMax(playerid, bool:status) { if(status == true) { TextDrawSetString(Speedometer14[playerid], "~g~M"); } else if(status == false) { TextDrawSetString(Speedometer14[playerid], "~y~M"); } } stock SetEngine(playerid, bool:status) { if(status == true) TextDrawSetString(Speedometer11[playerid], "~g~E"); else if(status == false) TextDrawSetString(Speedometer11[playerid], "~y~E"); } stock LockCar(carid) { foreach(Player, i) { if(!IsPlayerConnected(i)) continue; SetVehicleParamsForPlayer(carid,i,0,1); gCarLock[carid] = 1; } return 1; } stock UnLockCar(carid) { foreach(Player, i) { SetVehicleParamsForPlayer(carid,i,0,0); gCarLock[carid] = 0; } return 1; } stock SpeedVehicle(player) { new Float:x, Float:y, Float:z; if(IsPlayerInAnyVehicle(player)) { new veh = GetPlayerVehicleID(player); GetVehicleVelocity(veh, x, y, z); } else GetPlayerVelocity(player, x, y, z); return floatround(floatsqroot(x*x+y*y+z*z)*99); } TextDrawHideForPlayer(playerid, Speedometer0[playerid]); TextDrawHideForPlayer(playerid, Speedometer1[playerid]); TextDrawHideForPlayer(playerid, Speedometer2[playerid]); TextDrawHideForPlayer(playerid, Speedometer3[playerid]); TextDrawHideForPlayer(playerid, Speedometer4[playerid]); TextDrawHideForPlayer(playerid, Speedometer5[playerid]); TextDrawHideForPlayer(playerid, Speedometer6[playerid]); TextDrawHideForPlayer(playerid, Speedometer7[playerid]); TextDrawHideForPlayer(playerid, Speedometer8[playerid]); TextDrawHideForPlayer(playerid, Speedometer9[playerid]); TextDrawHideForPlayer(playerid, Speedometer11[playerid]); TextDrawHideForPlayer(playerid, Speedometer12[playerid]); TextDrawHideForPlayer(playerid, Speedometer13[playerid]); TextDrawHideForPlayer(playerid, Speedometer14[playerid]); if(newstate == PLAYER_STATE_ONFOOT) { if(oldstate == PLAYER_STATE_DRIVER) { TextDrawHideForPlayer(playerid, Speedometer0[playerid]); TextDrawHideForPlayer(playerid, Speedometer1[playerid]); TextDrawHideForPlayer(playerid, Speedometer2[playerid]); TextDrawHideForPlayer(playerid, Speedometer3[playerid]); TextDrawHideForPlayer(playerid, Speedometer4[playerid]); TextDrawHideForPlayer(playerid, Speedometer5[playerid]); TextDrawHideForPlayer(playerid, Speedometer6[playerid]); TextDrawHideForPlayer(playerid, Speedometer7[playerid]); TextDrawHideForPlayer(playerid, Speedometer8[playerid]); TextDrawHideForPlayer(playerid, Speedometer9[playerid]); TextDrawHideForPlayer(playerid, Speedometer11[playerid]); TextDrawHideForPlayer(playerid, Speedometer12[playerid]); TextDrawHideForPlayer(playerid, Speedometer13[playerid]); TextDrawHideForPlayer(playerid, Speedometer14[playerid]); MaxSpeed[playerid] = false; } } if(newstate == PLAYER_STATE_DRIVER) { new car = GetPlayerVehicleID(playerid); if(Engine[car] == false) SendClientMessage(playerid, -1, "Чтобы завести двигатель, нажмите: {FFFF00}LCTRL"); MaxSpeed[playerid] = true; TextDrawShowForPlayer(playerid, Speedometer0[playerid]); TextDrawShowForPlayer(playerid, Speedometer1[playerid]); TextDrawShowForPlayer(playerid, Speedometer2[playerid]); TextDrawShowForPlayer(playerid, Speedometer3[playerid]); TextDrawShowForPlayer(playerid, Speedometer4[playerid]); TextDrawShowForPlayer(playerid, Speedometer5[playerid]); TextDrawShowForPlayer(playerid, Speedometer6[playerid]); TextDrawShowForPlayer(playerid, Speedometer7[playerid]); TextDrawShowForPlayer(playerid, Speedometer8[playerid]); TextDrawShowForPlayer(playerid, Speedometer9[playerid]); TextDrawShowForPlayer(playerid, Speedometer11[playerid]); TextDrawShowForPlayer(playerid, Speedometer12[playerid]); TextDrawShowForPlayer(playerid, Speedometer13[playerid]); TextDrawShowForPlayer(playerid, Speedometer14[playerid]); TextDrawSetString(Speedometer3[playerid], VehicleNames[GetVehicleModel(car)-400]); if(newkeys & KEY_ACTION) { if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1; if(Engine[GetPlayerVehicleID(playerid)] == false) { GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective); Engine[GetPlayerVehicleID(playerid)] = true; Lights[GetPlayerVehicleID(playerid)] = true; } else { GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective); Engine[GetPlayerVehicleID(playerid)] = false; Lights[GetPlayerVehicleID(playerid)] = false; } } if(newkeys == 4096) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(MaxSpeed[playerid] == true) MaxSpeed[playerid] = false; else if(MaxSpeed[playerid] == false) MaxSpeed[playerid] = true; } } if(newkeys & KEY_SUBMISSION) { if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1; if(Engine[GetPlayerVehicleID(playerid)] == false) return SendClientMessage(playerid, -1, "?? ?????? ??????? ?????????!"); if(Lights[GetPlayerVehicleID(playerid)] == false) { GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective); Lights[GetPlayerVehicleID(playerid)] = true; SetLights(playerid, true); } else { GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective); Lights[GetPlayerVehicleID(playerid)] = false; SetLights(playerid, false); } }
M I S T E V (27 октября 2024 - 12:16) писал:
Предоставь код спидометра?
Сообщение отредактировал Asminov: 27 октября 2024 - 12:54
#4
Отправлено 28 октября 2024 - 03:51
Спидометр - это индивидуальная информация для каждого игрока, поэтому он должен быть плеерным а не глобальным.
Поделиться темой:
Страница 1 из 1