Jump to content

كود


Recommended Posts

Posted

السلام عليكم

ابي كود

دايرة اذا واحد جاء عليها بسيارته بسرعة محددة يكسب فلوس

فقط

بسيارة باي سيارة

واسف هاذي الايام طلباتي كثيرة لاني ناوي اسوي قيم مود :)

Posted
local theMarker = createMarker(1000,1000,30,"cylinder", 1.5, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "vehicle") then 
          speedx, speedy, speedz = getElementVelocity(hitElement) 
          actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
          kmh = math.ceil(actualspeed * 180) 
          if (kmh >= 180 ) then 
               local driver = getVehicleOccupant(hitElement) 
               givePlayerMoney(driver,1000) 
               outputChatBox("You Won $1000",driver,255,255,0) 
          end 
     end 
end) 

Posted

== (Equals to) 
~= (not equals to) 
< (Less than) 
> (Greater than) 
=< (Equals to or less than) 
>= (Equals to or greater than) 

it don't need to be edited, when you go with speed 180 or more than 180 you win money

Posted
local theMarker = createMarker(1000,1000,30,"cylinder", 1.5, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "vehicle") then 
          speedx, speedy, speedz = getElementVelocity(hitElement) 
          actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
          kmh = math.ceil(actualspeed * 180) 
          if (kmh > 180 ) then 
               local driver = getVehicleOccupant(hitElement) 
               givePlayerMoney(driver,1000) 
               outputChatBox("You Won $1000",driver,255,255,0) 
          end 
     end 
end) 

if you drive more than 180 KM/H you win money

Posted

ياهو مااشتغل امر عليه بالسيارة 20 مرة وبسرعة ماييصير شي

فيه مشكلة

وجربت

== (Equals to)

~= (not equals to)

< (Less than)

> (Greater than) هاذي

=< (Equals to or less than)

>= (Equals to or greater than)وهاذي

Posted

هذا هو حقي بالاحداثيات

local theMarker = createMarker(1820.3000488281,1248,7.5,"cylinder", 1.5, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "vehicle") then 
          speedx, speedy, speedz = getElementVelocity(hitElement) 
          actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
          kmh = math.ceil(actualspeed * 180) 
          if (kmh > 180 ) then 
               local driver = getVehicleOccupant(hitElement) 
               givePlayerMoney(driver,1000) 
               outputChatBox("You Won $1000",driver,255,255,0) 
          end 
     end 
end) 

Posted

Try:

local theMarker = createMarker(1820.3000488281,1248,7.5,"cylinder", 1.5, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "vehicle") then 
          local kmh = getElementSpeed(getPedOccupiedVehicle(hitElement),"kph") 
          if (kmh > 180 ) then 
               local driver = getVehicleOccupant(hitElement) 
               givePlayerMoney(driver,1000) 
               outputChatBox("You Won $1000",driver,255,255,0) 
          end 
     end 
end) 
  
function getElementSpeed(element, unit) 
    if not element or not isElement(element) then 
        return false 
    end 
    if unit == "kph" then 
        unit = 1.61 
    else 
        unit = 1 
    end 
    local velX, velY, velZ = getElementVelocity(element) 
    return(velX ^ 2 + velY ^ 2 + velZ ^ 2) ^ 0.5 * unit * 100 
end 

Posted

الدايرة تطلع وكل شي بس امر من جوتها بالسيارة داعسسسس مسررررررررررررع مايعطيني شي

جربت كل الاكواد الي بهذا الموضوع

Posted

جرب الكود ذا

local theMarker = createMarker(1820.3000488281,1248,7.5,"cylinder", 1.5, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "player") then 
          local vehicle = getPedOccupiedVehicle(hitElement) 
          local vx, vy, vz = getElementVelocity(vehicle) 
          local mph = math.floor(math.sqrt(vx^2 + vy^2 + vz^2) * 161) 
          if (mph >= 180) then 
               givePlayerMoney(hitElement,1000) 
               outputChatBox("You Won $1000",hitElement,255,255,0) 
          end 
     end 
end) 

Posted
local theMarker = createMarker(1820.3000488281,1248,7.5,"cylinder", 1.5, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "vehicle") then 
          local kmh = getElementSpeed(hitElement,"kph") 
          if (kmh > 180 ) then 
               local driver = getVehicleOccupant(hitElement) 
               givePlayerMoney(driver,1000) 
               outputChatBox("You Won $1000",driver,255,255,0) 
          end 
     end 
end) 
  
function getElementSpeed(element, unit) 
    if not element or not isElement(element) then 
        return false 
    end 
    if unit == "kph" then 
        unit = 1.61 
    else 
        unit = 1 
    end 
    local velX, velY, velZ = getElementVelocity(element) 
    return(velX ^ 2 + velY ^ 2 + velZ ^ 2) ^ 0.5 * unit * 100 
end 

Posted

اعتقد المشكلة في حجم الدائرة، لاني اذكر قبل كنت مسوي سكربت وكانت الدائرة صغيرة شوي فكان صعب يشتغل الكود فيها.

جرب هذا ( مافي فرق عن الاكواد الي عطوك اياها الشباب، الاختلاف في حجم الدائرة بس )

local theMarker = createMarker(1000,1000,30,"cylinder", 7.0, 255,255,0,170) 
  
addEventHandler("onMarkerHit", theMarker, 
function(hitElement) 
     if (getElementType(hitElement) == "vehicle") then 
          speedx, speedy, speedz = getElementVelocity(hitElement) 
          actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
          kmh = math.ceil(actualspeed * 180) 
          if (kmh >= 180 ) then 
               local driver = getVehicleOccupant(hitElement) 
               givePlayerMoney(driver,1000) 
               outputChatBox("You Won $1000",driver,255,255,0) 
          end 
     end 
end) 

Posted

وخررررر انتم واكوادكم تدخل بسووووول

القوات الخاصة

هع

ماشاء الله

طيب بجربه لكن يااخ بسول

اشكرك على تعاونك معي

وياليت تمر على موضوعي حق اللوحة البيضة

Posted

للاسف الكود مااشتغل مثل الباقية تاكدوا منها يااخوان

المشكلة ماهي في الحجم

اظن المشكلة هنا

if (getElementType(hitElement) == "vehicle") then

Posted
للاسف الكود مااشتغل مثل الباقية تاكدوا منها يااخوان

المشكلة ماهي في الحجم

اظن المشكلة هنا

if (getElementType(hitElement) == "vehicle") then

الكودين الي أنا حطيتهم في الموضوع شغالين و توني الحين جربتهم

هنا meta.xml حط الي في ملف

أتوقع أن عندك خطأ

و تراه الكود سيرفر موب كلينت

Posted

<meta> 
    <info author="50p" version="0.1.0" type="misc" /> 
    <script src="server.lua" type="server" /> 
</meta> 

meta.xml كل دة و المشكلة فى

Posted

ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه

والله ماانتبهت له لاني كنت استعمل هذا الملف بكل موداتي

خخخخخخخخخخخخخخخخخ

والله اسف تكفون سامحوني

والله تعبتكم

تنحسب لمن في اجركم انشاء الله

معليش والله

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...