Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: randomowe
1. Randomowe punkty w Dx
Witam, ot?? totalnie nie mam pomys?u, jak zrobi? randomowe punkty w dxDrawImage.
Tutaj tabela punkt?w
local mousePoints = {
{
screenW 0.3932screenH 0.4787screenW 0.0323screenH 0.0509},
{
screenW 0.4516screenH 0.5213screenW 0.0323screenH 0.0509},
{
screenW 0.5495screenH 0.5528screenW 0.0323screenH 0.0509},
{
screenW 0.5969screenH 0.5065screenW 0.0198screenH 0.0296},
}
target=0

Tutaj kod na punkty. Chcia?bym go nieco przerobi?, by punkty by?y losowane z tabeli wy?ej
            addEventHandler("onClientRender"root, function()
                if 
getElementData(localPlayer"kopalnia:zakonczono"then return end                
                dxDrawImage
(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4],"kolo.png")
            
end)

Za pomoc zimne :piwo: :piwo: :piwo:
2. Randomowe Nazwy Gangów
Pawn

new WGSkin[2],WGColor[2],WGName[2];
enum enumGangWG
{
    
SkinTeam1,
    
SkinTeam2,
    
ColorTeam1[11],
    
ColorTeam2[11],
    
NameTeam1[50],
    
NameTeam2[50]
}

new 
GangWG[][enumGangWG] =
{
    {
115108,  0x00b2eeFF,0xeec900FF,  "{eec900}Los Santos Vagos","{00b2ee}Varrios Los Aztecas"},
    {
107104,  0x299617FF,0x604091FF,  "{604091}The Ballas",      "{299617}Grove Street Families"},
    {
107108,  0x299617FF,0xeec900FF,  "{eec900}Los Santos Vagos","{299617}Grove Street Families"},
    {
115104,  0x00b2eeFF,0x604091FF,  "{604091}The Ballas",      "{00b2ee}Varrios Los Aztecas"}
};

WGRands()
{
    new 
GangWGRand random(sizeof(GangWG));
    
WGName[0] = GangWG[GangWGRand][NameTeam1];
    
WGName[1] = GangWG[GangWGRand][NameTeam2];
    return 
1;
}

CMD:testwg2(playerid)
{
    
WGRands();
    new 
Strin[122];
    
format(Strinsizeof(Strin), "Druzyna 1 - %s"WGName[0]);
    
SCM(playeridCOLOR_GREENStrin);
    
format(Strinsizeof(Strin), "Druzyna 2 - %s"WGName[1]);
    
SCM(playeridCOLOR_GREENStrin);
    return 
1;
}




Nie rozumiem czemu wy?wietla mi jakie? "znaki" zamiast nazwy gang?w
3. Randomowe ubranie
Witam, zrobilem taki prosty skrypcik na randomowe ubranie dla CJ po zrespieniu, lecz niestety nwm jak konkretnie ustawic funkcje addPedClothes, czy zrobic to na math.random czy na siateczke w funkcji na math.random zasob nie daje ubrania.
function Player ( )
    
local joinedPlayerName getPlayerName source )
        
addPedClothes (sourcemath.random(0,44), 2)
end
addEventHandler 
"onPlayerJoin"getRootElement(), Player )
4. randomowe blipy
cze?? mam pytanie jak zrobi? randomowe tworzenie si? blip?w po starcie skryptu.
chodzi mi o to aby po wlaczeniu skryptu tworzylo sie duzo blipow na calej mapie z id 8.
5. Randomowe Liczby
Witam mam problem chodzi mi oto ze mam Skrypt na Kasyno ale sie wygrywa za cz?sto wi?c chce zeby by?a 1/10 szansa na wygran? albo chociasz zeby sie nie wygrywa?o ca?y czas ze np. 10 razy przegrasz a tu 11 wygrywasz ale zeby nie by?o ze 10 pod z?d sie wygrywa,
M?cze sie z tym bo to prawie nei daje efektu co tu robie oto kod:
[lua]
local maszyna = createObject ( 2640, 2021.64,1015.24,10.82 )
setElementData ( maszyna, "message", "Maszyna hazardowa" )
local marker = createMarker ( 2021.64,1015.24,10.82, "cylinder", 3, 255, 0, 0, 0 )


local active = false
local cash = 0


addEventHandler ( "onMarkerHit", marker, function ( element )
outputChatBox ( "Dzia?anie : ", element, 255, 255, 255 )
outputChatBox ( "Przegrana : Kwota postawiona zostaje w maszynie. Na fundacje Komisu mixLoLmix oraz Patryko12", element, 255, 255, 255 )
outputChatBox ( "Wygrana : Dostajesz zwrot zastawionej kwoty + 50% tej kwoty.", element, 255, 255, 255 )
outputChatBox ( "Wpisz /postaw <kwota>", element, 255, 255, 255 )
end)

local function result ( plr, type )
if type == true then
wynik = cash + (cash/2)
outputChatBox ( "Brawo! Maszyna wylosowa?a Twoje liczby - zgarniasz "..string.format ( "EUR %0.2f", wynik ).."", plr, 255, 255, 255 )
givePlayerMoney ( plr, wynik )
active = false
elseif type == false then
outputChatBox ( "Niestety, masz dzisiaj pe...
6. Randomowe kliki
Siemanko jak zrobi? co? takiego? https://www.youtube.com/watch?v=jn1kNnvz55s Chodzi mi o myszk?.
7. randomowe liczby
Jest jaka? funkcja, kt?ra losuje randomowe liczby?
8. PizzaBoy praca randomowe pozycje
[lua]local districtsPizza = { ---- kordy dostarczania graczy
{-291.1318359375, 1163.7275390625, 19.696998596191},
{-335.0615234375, 1171.697265625, 19.901586532593},
{-320.7666015625, 1163.1123046875, 20.2421875},
{-364.9287109375, 1165.5341796875, 19.7421875},
{-367.416015625, 1145.8359375, 20.235286712646},
{-359.54296875, 1129.7119140625, 19.679533004761},
{-369.2392578125, 1119.2783203125, 20.230415344238},
{-361.92578125, 1104.31640625, 19.749286651611},
{-331.36328125, 1115.37890625, 20.2421875},
{-322.1962890625, 1130.2138671875, 19.83712387085},
{-289.51171875, 1122.337890625, 20.238082885742},
{-304.302734375, 1114.52734375, 19.7421875},
{-260.83984375, 1165.4375, 20.2421875},
{-251.5693359375, 1179.39453125, 19.93016242981},
{-259.517578125, 1156.6357421875, 19.7421875},
{-251.677734375, 1142.8095703125, 20.243007659912},
{-260.6396484375, 1130.6669921875, 19.759662628174},
{-253.7919921875, 1115.990234375, 20.232286453247},
{-248.8818359375, 1083.751953125, 19.902923583984},
{-262.7373046875, 1076.2373046875, 20.249408721924},
{-252.0732421875, 1054.12109375, 19.956705093384},
{-260.552734375, 1040.31640625, 20.2421875},
{-282.9853515625, 995.6962890625, 20.2421875},
{-267.791015625, 1004.333984375, 19.679946899414},
{-256.2158203125, 994.55859375, 20.239133834839},
{-242.8115234375, 1002.1748046875, 19.7421875},
}
local jobBlip
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districts...