Jump to content

Help!


Recommended Posts

Posted
commandName = "jop" 
  
addCommandHandler (commandName, 
function(sot) 
 givePlayerJetPack(sot) 
 outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0) 
end 
) 

Posted
commandName = "jop" 
  
addCommandHandler (commandName, 
function(sot) 
 givePlayerJetPack(sot) 
 outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0) 
end 
) 

Shukriya!

Posted
mujha offend nahi karna liken commandName variable ki zarovat nahi thi, directly type karla ta.

Kuch aise?

addCommandHandler ("jop", givePedJetPack) 
function givePedJetPack(sot) 
 outputChatBox("You've Got A JetPack", sot, 0, 255, 0) 
end 

Posted
JetPack aa to gaya hai, lekin meu chahata hoon ke use /rjop se remove bhi karoun aur chat meu likha aai ''Jet Pack Has Been Successfully Removed"..

Is code ko previous code meu add kar do ''end'' ke agge.

addCommandHandler ("rjop", removePedJetPack) 
function removePedJetPack(sot) 
 outputChatBox ("Jet Pack Has Been Successfully Removed", sot, 255, 0, 0) 
end 

Posted (edited)

o.O

[lua]

addCommandHandler ("jop",

function(sot)

givePedJetPack(sot)

outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0)

end

)

addCommandHandler ("rjop",

function(sot)

removePedJetPack(sot)

outputChatBox ("You've removed you Jet Pack", sot, 0, 255, 0)

end

)

Edited by Guest
Posted
o.O

[lua]

addCommandHandler ("jop",

function(sot)

givePedJetPack(sot)

outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0)

end

)

addCommandHandler ("rop",

function(sot)

removePedJetPack(sot)

outputChatBox ("You've removed you Jet Pack", sot, 0, 255, 0)

end

)

Scripting karne ke bohat se ways hain, mera bhi work karta hai.

Posted
o.O

[lua]

addCommandHandler ("jop",

function(sot)

givePedJetPack(sot)

outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0)

end

)

addCommandHandler ("rop",

function(sot)

removePedJetPack(sot)

outputChatBox ("You've removed you Jet Pack", sot, 0, 255, 0)

end

)

Scripting karne ke bohat se ways hain, mera bhi work karta hai.

tuna wrapper function bana diya, wo kuch or hi hein. wo sirf output karta hein nikal ta nahi!

aur tu kabhi kabhi decrypted functions use karta hein <

Posted
o.O

[lua]

addCommandHandler ("jop",

function(sot)

givePedJetPack(sot)

outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0)

end

)

addCommandHandler ("rop",

function(sot)

removePedJetPack(sot)

outputChatBox ("You've removed you Jet Pack", sot, 0, 255, 0)

end

)

Scripting karne ke bohat se ways hain, mera bhi work karta hai.

tuna wrapper function bana diya, wo kuch or hi hein. wo sirf output karta hein nikal ta nahi!

aur tu kabhi kabhi decrypted functions use karta hein <

Mein ne script ko test kiya hai aur ye perfectly kaam karti hai.

Posted

Is ne arguement sahi istimal kiya ta isliye overwrite kerke wo kaam ker raha tha.

Proper method:

  
_getPlayerName = getPlayerName -- copy the function  
local function getPlayerName (...) -- overwrite it 
local p = _getPlayerName ( ...) -- call the function we copied 
if p then -- True or no 
-- if true then... 
return p -- don't forget to return it  can cause problems if you're loading scripts using loadstring("return CODE")() 
end 
     end 
  

Anyway don't overwrite functions for such small things. This can can cause problems if you're calling the same function fir different script within same script.

Posted
Is ne arguement sahi istimal kiya ta isliye overwrite kerke wo kaam ker raha tha.

Proper method:

  
_getPlayerName = getPlayerName -- copy the function  
local function getPlayerName (...) -- overwrite it 
local p = _getPlayerName ( ...) -- call the function we copied 
if p then -- True or no 
-- if true then... 
return p -- don't forget to return it  can cause problems if you're loading scripts using loadstring("return CODE")() 
end 
     end 
  

Anyway don't overwrite functions for such small things. This can can cause problems if you're calling the same function fir different script within same script.

Muje pata chala ke mera previous code:

addCommandHandler ("jop", givePedJetPack) 
function givePedJetPack(sot) 
  outputChatBox("You've Got A JetPack", sot, 0, 255, 0) 
end 

message ko output nahi karta tha, lekin ye code kam karta hai.

addCommandHandler ("jop", 
function(sot) 
givePedJetPack(sot) 
outputChatBox ("You've Got A Jet Pack", sot, 0, 255, 0) 
end 
) 

Posted

You added the command handler first that's why. Even this will work:

  
addCommandHandler ("jop", givePedJetPack) 
  

But anyway just for mire explanation. This will work although it's pretty useless for using wrapper.

  
local _givePedJetPack = givePedJetPack -- copy the function  
  
local function givePedJetPack (TheP) -- overwrite it 
  
local p = _givePedJetPack ( TheP ) -- call the function we copied 
  
if p then -- True or no 
outputChatBox ("You got a Jet Pack", TheP, 0, 255, 0) 
-- if true then... 
  
return p -- don't forget to return it  can cause problems if you're loading scripts using loadstring("return CODE")() 
  
end 
  
     end 

Posted
You added the command handler first that's why. Even this will work:
  
addCommandHandler ("jop", givePedJetPack) 
  

But anyway just for mire explanation. This will work although it's pretty useless for using wrapper.

  
local _givePedJetPack = givePedJetPack -- copy the function  
  
local function givePedJetPack (TheP) -- overwrite it 
  
local p = _givePedJetPack ( TheP ) -- call the function we copied 
  
if p then -- True or no 
outputChatBox ("You got a Jet Pack", TheP, 0, 255, 0) 
-- if true then... 
  
return p -- don't forget to return it  can cause problems if you're loading scripts using loadstring("return CODE")() 
  
end 
  
     end 

Urdu bolo please, aur scripting ke bohat se ways hain...sab ka apna apna way hota hai scripting karne ka.

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