Tematy otagowane jako: malowanie
1. malowanie
Mam problem z napisaniem, mam colorpickera i chcialbym aby w stworzonym cuboidzie gdy stoi tam pojazd po wybraniu koloru zmienia mi ten kolor pojazdu
local edit = createMarker (-2384.98,2367.17,4, "cylinder", 1.5, 255, 255, 0, 170 )
addEventHandler("onClientMarkerHit", edit , function(plr)
if plr == localPlayer then
exports.N:openPicker(source, "#FFAA00", "Pick a color for some editbox:")
end
end)
addEventHandler("onColorPickerChange", root,
function(element, hex, r, g, b)
setVehicleColor(element, r, g, b)
end)
2. Malowanie aut w salonie
Witam, mam pytanie da?oby rade zrobi?, ?e po w??czeniu skryptu te autka maj? ustawiaj? kolor 0, 112, 141
Kod:
[lua]local positionVehicles = {
-- nazwa, model, przebieg, cena, x,y,z,rx,ry,rz, sprzeda?
-- salon
--{'Manana', 410, 0, 5000, 2220.04175, -123.38932, 28.46326, 359.2, 360.0, 129.9},
{'Ocenic', 467, 0, 8563, -1957.03, 299.64, 35.21, 359.6, 360.0, 140.1},
{'Premier', 426, 0, 16139, -1948.72, 268.60, 35.22, 360.0, 359.9, 43.6},
{'Tahoma', 566, 0, 11431, -1951.49, 260.42, 35.25, 0.4, 0.1, 40.7},
{'Vincent', 540, 0, 13794, -1955.89, 258.11, 40.91, 359.7, 360.0, 1.1},
{'Clover', 542, 0, 8853, -1946.46, 261.48, 40.83, 360.0, 360.0, 48.9},
{'Blista Compact', 496, 0, 21237, -1948.25, 270.74, 40.77, 0.0, 360.0, 53.0},
{'Tampa', 549, 0, 7653, -1955.07, 300.77, 40.74, 360.0, 360.0, 181.7},
}
for i,v in pairs(positionVehicles) do
local veh=createVehicle(v[2], v[5], v[6], v[7], v[8], v[9], v[10], v[11])
setElementData(veh,'pojazd_opis','Pojazd: '..v[1]..' ('..v[2]..')nCena: '..v[4]..' PLNnPrzebieg: '..v[3]..' kmnAby kupi? pojazd wsi?dz na miejsce kierowcy i wpisz /kuppojazd')
setVehicleOverrideLights(veh, 1)
setElementFrozen(veh,true)
setVehicleDamageProof(veh, true)
setElementData(veh,'vehicle.selling', true)
veh:setData('vehsell:info', {
['cost']=v[4],
['model']=v[2],
['mileage']=v[3],
['selling']=v[12]
}, false)
end
addEventHandler('onVehicleEnter', resourceRoot, function(plr, seat...
3. Malowanie pojazdu Sprayem
Witajcie. Chcia?em zrobi? malowanie pojazdu sprayem lecz napotka?em problem:
function kolor_czerwony ( thePlayer )
giveWeapon ( thePlayer , 41 , 999 )
setVehicleColor ( thePlayer , 255 , 0 , 0 )
takePlayerMoney ( thePlayer , 200 )
outputDebugString ( "Gracz kupil spray:red" )
end
addCommandHandler ( "spray:red" , kolor_czerwony )
Daje spray, pobiera kase lecz nie maluje pojazdu, I chcia?bym aby malowanie by?o p?ynne a nie raz klikne i ju? auto pomalowane
[/code]
4. Malowanie
Od paru dni robi? skrypt kt?ry pozwala na malowanie samochodu spray'em, lecz sa problemy. Chodzi mi o to ze jak we?mie spray to kolor auta sie od razu zmienia a chce ?eby zmienia? si? powoli np. Mam bia?y samoch?d i biore czarny spray i maluje auto, i wychodzi siwy itp i po pewnym czasie juz sam czarny
local marker_1= createMarker ( 0 , 0 , 2 , "cylinder" , 1 , 0 , 0 , 255 , 100 )
addEventHandler ( "onClientMarkerHit" , marker_1 , function( player )
setElementData ( player , "spray:color" , 0x0000FF )
end
)
function mal ( weapon , ammo , ammoInClip , hitX , hitY , hitZ , hitElement )
if source ~= localPlayer then return end
if ( weapon ~= 41 ) then return end
if not hitElement then return end
if ( hitElement and getElementType ( hitElement )== "vehicle" ) then
local kolor_spray = getElementData ( localPlayer , "spray:color" ) or 0
if ( kolor_spray ) then
setVehicleColor ( hitElement , math . floor ( kolor_spray / 65536 ), math . floor ( kolor_spray / 256 % 256 ), math . floor ( kolor_spray / 256 % 256 ))
end
end
end
addEventHandler ( "onClientPlayerWeaponFire" , getLocalPlayer (), mal )
5. [GF] Malowanie Spray + Wybór koloru w GUI
Cze??
Chcia?bym si? zapyta? jak podpi?? GUI oraz wyb?r koloru do tego systemu malowania spray'.
http://pastebin.pl/65148
Tutaj jest malowanie spray, ale jak do??czy? mam ,aby po zamalowaniu mo?na by?o wybra? kolor ?
6. [INNE] Malowanie auta
Czesc mam problem z malowaniem auta. Gdy maluje przez 10 sec wy?iwtla si? GUI i wybieram kolor, lecz gdy wybiore ten kolor to pojazd go nie otrzymuje.
Bardzo prosze o pomoc . Za pomoc reputacja lub piffko
[code] #include <a_samp>
new Firehold[MAX_PLAYERS];
stock Float:GetDistanceBetweenPoints(Float:X, Float:Y, Float:Z, Float:PointX, Float:PointY, Float:PointZ)
{
new Float:Distance;
Distance = floatabs(floatsub(X, PointX)) + floatabs(floatsub(Y, PointY)) + floatabs(floatsub(Z, PointZ));
return Distance;
}
stock GetNearestVehicle(playerid, Float:Distance = 1000.0)
{
Distance = floatabs(Distance);
if(Distance == 0.0) Distance = 1000.0;
new Float:X[2], Float:Y[2], Float:Z[2];
new Float:NearestPos = Distance;
new NearestVehicle = INVALID_VEHICLE_ID;
GetPlayerPos(playerid, X[0], Y[0], Z[0]);
for(new i; i<MAX_VEHICLES; i++)
{
if(!IsVehicleStreamedIn(i, playerid) || i == GetPlayerVehicleID(playerid)) continue;
GetVehiclePos(i, X[1], Y[1], Z[1]);
if(NearestPos > GetDistanceBetweenPoints(X[0], Y[0], Z[0], X[1], Y[1], Z[1])) NearestPos = GetDistanceBetweenPoints(X[0], Y[0], Z[0], X[1], Y[1], Z[1]), NearestVehicle = i;
}
if(NearestPos < Distance) return NearestVehicle;
return INVALID_VEHICLE_ID;
}
forward ResprayTimer(playerid,vehicleid);
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys){
if(newkeys & KEY_FIRE &&a...
7. [SKRYPT ] Malowanie z Spayem
Hejka , wrzucam tutaj skrypt Malowania Spray'em.Jest on podobny do tych ze znanych serwer takich jak H-RP LS-RP itp...
/spray - daje spray
Ukryta wiadomość / Hidden message(aby ją zobaczyć musisz postawić użytkownikowi) Wiadomość została ukryta, aby ją przeczytać należy się zalogować.