Jump to content

ضع وظيفة من الويكي وزود مشاركاتك


abu5lf

Recommended Posts

addPedClothes 

هذا الفكشن , تعطي الاعب ملابس

الكود :

bool addPedClothes ( ped thePed, string clothesTexture, string clothesModel, int clothesType ) 

مثال الويكي :

function onEnterVehicle ( theVehicle, seat, jacked ) 
    if getElementModel ( theVehicle ) == 522 then         -- if it's an nrg 
        addPedClothes ( source, "moto", "moto", 16 )   -- add the helmet 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", root, onEnterVehicle ) 
  
function onExitVehicle ( theVehicle, seat, jacked ) 
    if getElementModel ( theVehicle ) == 522 then      -- if it's an nrg 
        removePedClothes ( source, 16 )              -- remove the helmet 
    end 
end 
addEventHandler ( "onPlayerVehicleExit", root, onExitVehicle ) 

2- عمل شخصيه

createPed 

Code :

ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] ) 

مثال :

function pedLoad ( name ) 
   createPed ( 120, 5540.6654, 1020.55122, 1240.545 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad ) 

3- صنع نار

createFire 

Link to comment
  • Replies 211
  • Created
  • Last Reply

Top Posters In This Topic

getTeamColor -- الحصول علي لون التيم 
countPlayersInTeam -- عدد الاعبين البالتيم 
#Server 
getAccounts -- الحصول علي اسامي الحسابات 
getAccountName -- حصول علي اسم الحساب 
removeAccount -- حذف الحساب 
addAccount -- create Account 
Link to comment
getGarageBoundingBox--تجيب احداثيات زوايا الكراج 

مثال يتحقق ان الاعب داخل الكراج

--wiki example 
function garageCheck ( command, garageID ) 
    if not garageID then 
        return 
    end 
  
    local west, east, south, north = getGarageBoundingBox ( garageID ) --get the bounding box of the specified garage 
    local x, y, z = getElementPosition ( getLocalPlayer ( ) ) --get the position of the player 
  
    if x > west and x < east and y > south and y < north then --check if the player is inside the bounding box 
        outputChatBox ( "You are inside the garage" ) 
    else 
        outputChatBox ( "You are outside the garage" ) 
    end 
end 
  
addCommandHandler ( "garagecheck", garageCheck ) 

Link to comment

خربت امها ي نكست

:lol::lol::lol::lol:

--------------------------

triggerEvent 

فائدتها : انتك تقدر من خلالها تسوي ترايقر من كلاينت ل كلاينت

او من سيرفر إلى سيرفر

لكن تستقبل الترايقر في نفس الملف

بعض الأمثلة :

Server Side Example :

addEventHandler ( "onPlayerWasted" , root , 
  
 function ( _, killer ) 
  
 if ( isElement ( killer ) ) and ( killer ~= source ) and ( getElementType ( killer ) == "player" ) then 
  
 triggerEvent ( "onKillerKillPlayer" , source , killer  ) 
  
  end 
 end 
 ) 
  
addEvent ( "onKillerKillPlayer" , true ) 
  
addEventHandler ( "onKillerKillPlayer" , root, 
  
function ( killer ) 
  
givePlayerMoney ( killer , 500 ) 
  
setPedArmor ( killer , 100 ) 
  
 end 
 ) 

# Client Side Example :

addEventHandler ( "onClientGUIClick" , root , 
  
 function (  ) 
  
 triggerEvent ( "onPlayerClickGUI" , root , getPlayerName ( localPlayer ) , getElementType ( source )  ) 
  
 end 
 ) 
  
addEvent ( "onPlayerClickGUI" , true ) 
  
addEventHandler ( "onPlayerClickGUI" , root, 
  
 function ( playerName , Type ) 
  
 outputChatBox ( playerName.." Click "..Type ) 
  
 end 
 ) 

# Abdul KariM الشكر موصل للغالي : الأخ

Link to comment
خربت امها ي نكست

:lol::lol::lol::lol:

--------------------------

triggerEvent 

فائدتها : انتك تقدر من خلالها تسوي ترايقر من كلاينت ل كلاينت

او من سيرفر إلى سيرفر

لكن تستقبل الترايقر في نفس الملف

بعض الأمثلة :

Server Side Example :

addEventHandler ( "onPlayerWasted" , root , 
  
 function ( _, killer ) 
  
 if ( isElement ( killer ) ) and ( killer ~= source ) and ( getElementType ( killer ) == "player" ) then 
  
 triggerEvent ( "onKillerKillPlayer" , source , killer  ) 
  
  end 
 end 
 ) 
  
addEvent ( "onKillerKillPlayer" , true ) 
  
addEventHandler ( "onKillerKillPlayer" , root, 
  
function ( killer ) 
  
givePlayerMoney ( killer , 500 ) 
  
setPedArmor ( killer , 100 ) 
  
 end 
 ) 

# Client Side Example :

addEventHandler ( "onClientGUIClick" , root , 
  
 function (  ) 
  
 triggerEvent ( "onPlayerClickGUI" , root , getPlayerName ( localPlayer ) , getElementType ( source )  ) 
  
 end 
 ) 
  
addEvent ( "onPlayerClickGUI" , true ) 
  
addEventHandler ( "onPlayerClickGUI" , root, 
  
 function ( playerName , Type ) 
  
 outputChatBox ( playerName.." Click "..Type ) 
  
 end 
 ) 

# Abdul KariM الشكر موصل للغالي : الأخ

يقدر يستقبل من اي مود من الجهة اللي سوت الترايقر(كلنت، سيرفر)

Link to comment

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...