kolbaska=))) | Дата: Понедельник, 28.03.2016, 16:28 | Сообщение # 1 |
Свой
Группа: Журналист / Файловик
Сообщений: 36
Статус: Offline
| Всем привет с вами volna :D Это готовый скрипт спедометра для сервера! Писал специально для samp-ru.org и так! приступим: ко всем new Код new Text:Spedo0[MAX_PLAYERS]; new Text:Spedo1[MAX_PLAYERS]; new Text:Spedo2[MAX_PLAYERS]; в public OnPlayerConnect(playerid) Код Spedo0 [playerid]= TextDrawCreate(618.000000, 414.000000, "."); TextDrawBackgroundColor(Spedo0[playerid], 255); TextDrawFont(Spedo0[playerid], 1); TextDrawLetterSize(Spedo0[playerid], 0.000000, 2.000000); TextDrawColor(Spedo0[playerid], -1); TextDrawSetOutline(Spedo0[playerid], 0); TextDrawSetProportional(Spedo0[playerid], 1); TextDrawSetShadow(Spedo0[playerid], 1); TextDrawUseBox(Spedo0[playerid], 1); TextDrawBoxColor(Spedo0[playerid], -16776961); TextDrawTextSize(Spedo0[playerid], 537.000000, 0.000000);
Spedo1 [playerid]= TextDrawCreate(616.000000, 415.000000, "."); TextDrawBackgroundColor(Spedo1[playerid], 255); TextDrawFont(Spedo1[playerid], 1); TextDrawLetterSize(Spedo1[playerid], 0.000000, 1.700000); TextDrawColor(Spedo1[playerid], -1); TextDrawSetOutline(Spedo1[playerid], 0); TextDrawSetProportional(Spedo1[playerid], 1); TextDrawSetShadow(Spedo1[playerid], 1); TextDrawUseBox(Spedo1[playerid], 1); TextDrawBoxColor(Spedo1[playerid], 255); TextDrawTextSize(Spedo1[playerid], 539.000000, 0.000000);
Spedo2 [playerid]= TextDrawCreate(545.000000, 418.000000, "100 KM"); TextDrawBackgroundColor(Spedo2[playerid], -16776961); TextDrawFont(Spedo2[playerid], 1); TextDrawLetterSize(Spedo2[playerid], 0.500000, 1.000000); TextDrawColor(Spedo2[playerid], -1); TextDrawSetOutline(Spedo2[playerid], 1); TextDrawSetProportional(Spedo2[playerid], 1); в public OnPlayerUpdate(playerid)
Код new string[200]; format(string, sizeof(string), "%d KM", GetSpeedKM(playerid)); TextDrawSetString(Spedo2[playerid], string); в public OnPlayerStateChange(playerid, newstate, oldstate) Код if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { TextDrawShowForPlayer(playerid, Spedo0[playerid]); TextDrawShowForPlayer(playerid, Spedo1[playerid]); TextDrawShowForPlayer(playerid, Spedo2[playerid]); } else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { TextDrawHideForPlayer(playerid, Spedo0[playerid]); TextDrawHideForPlayer(playerid, Spedo1[playerid]); TextDrawHideForPlayer(playerid, Spedo2[playerid]); } в конец мода Код forward GetSpeedKM(playerid); stock GetSpeedKM(playerid) { new Float:PosX, Float:PosY, Float:PosZ, Float:PlayerSpeedDistance; GetVehicleVelocity(GetPlayerVehicleID(playerid), PosX, PosY, PosZ); PlayerSpeedDistance = floatmul(floatsqroot(floatadd(floatadd(floatpower( PosX, 2), floatpower(PosY, 2)), floatpower(PosZ, 2))), 170.0); new spe = floatround(PlayerSpeedDistance * 1); return spe; } Вот и все! Автор: volna Забирайте себе :*
Skype: lexan4ik2281337 VK: https://vk.com/id904141
Сообщение отредактировал kolbaska=))) - Понедельник, 28.03.2016, 16:32 |
|
| |