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

STOP !!! ACTING !!! LIKE !!! A !!! DAMN !!! KID !!!

OKAY ?

answer for your PROBLEMS: (unrelated to main topic)

https://forum.multitheftauto.com/viewtop ... 91&t=27027

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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,

Posted
i dont steal

did i say you do?

that was example

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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