Jump to content

Fun command shelp


Recommended Posts

Posted (edited)

addCommandHandler ("use",
function(player,command,Fun,FunPlayerName)
   if (findPlayerByName (FunPlayerName)) then 
     local playerToFun = findPlayerByName (FunPlayerName)
     local Text =  (Fun)
     outputChatBox (getPlayerName(player) .. " #FF0000is use ".. Text .." with " .. getPlayerName(playerToFun),getRootElement(),51,255,0,true)
end
end)

whats Wrong

Edited by Guest
Posted
addCommandHandler ("use",
function(player,command,Fun,FunPlayerName)
   if (findPlayerByName (FunPlayerName)) then 
     local playerToFun = findPlayerByName (FunPlayerName)
     local Text =  (Fun)
     outputChatBox (getPlayerName(player) .. " #FF0000is use ".. Text .." with " .. getPlayerName(playerToFun),getRootElement(),51,255,0,true)
end
end)

whats Wrong

50p means, what is wrong?

what is it suppose to be, and what doesn't work about it.;)

Posted

There's no function findPlayerByName, unless you create one. If you need to get player with a specified nickname, use getPlayerFromName. And it's better to store function result in a variable if you need to use it a few times. I'll try to correct your code

addCommandHandler("use",
function(player,command,Fun,FunPlayerName)
local playerToFun = getPlayerFromName(FunPlayerName)
if playerToFun then
outputChatBox (FunPlayerName.." #FF0000is use "..Fun.." with "..getPlayerName(player),getRootElement(),51,255,0,true)
end
end
)

Posted
function findPlayerByName (playerPart)
 for i,v in ipairs (getElementsByType ("player")) do
   if (string.find(getPlayerName(v),playerPart)) then
     return v
   end
 end
end

look you !!!!!!!!!!!!!

Posted

well, i wasn't about stickies - everyone knows that nobody reads them..

it was about:

look you !!!!!!!!!!!!!

and i'm pretty sure that Metalhero didnt read that sticky anyway

Posted

Thats why they should make a kind of system in the forums, if you want to post,

You have to read them first,

You cant go further for 30 sec's

So you can read them!;)

Posted

its going a bit offtopic, but..

i think there should be at least warning system.. for stealing scripts, acting like 11yo, flaming, going too deep OT (like this one ;>) etc

Posted
its going a bit offtopic, but..

i think there should be at least warning system.. for stealing scripts, acting like 11yo, flaming, going too deep OT (like this one ;>) etc

I agree,

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