Wei Posted April 14, 2012 Author Share Posted April 14, 2012 addCommandHandler ( 'aj', function ( sCommand, uTarget, nTime ) if ( isStaff ( localPlayer ) ) then nTime = nTime * 60 * 1000 local target = getPlayerFromName ( uTarget ); setElementInterior ( target, 6 ); setElementPosition ( target, 265.21185302734, 77.63591003418, 1001.0390625 ); setTimer ( function ( uTarget ) setElementPosition ( uTarget, 1546.20203, -1675.47412, 13.56186 ); setElementInterior ( uTarget, 0 ); end, nTime, 1, target ) outputChatBox ( 'You have been jailed!', target, 255, 255, 0 ); outputChatBox ( 'INFO: ' .. getPlayerName ( target ) .. ' has been jailed for 5 minutes by Admin.', root, 255, 255, 0 ); outputDebugString ( getPlayerName ( target ) .. ' has been jailed!' ); else outputChatBox ( 'Acess denied to the command!', localPlayer, 255, 255, 0 ); end end ) addCommandHandler ( 'auj', function ( sCommand, uTarget ) if ( isStaff ( localPlayer ) ) then local target = getPlayerFromName ( uTarget ); setElementInterior ( target, 0 ); setElementPosition ( target, 1546.20203, -1675.47412, 13.56186 ); outputChatBox ( 'You have been unjailed!', target, 255, 255, 0 ); else outputChatBox ( 'Acess denied to the command!', localPlayer, 255, 255, 0 ) end end ) isStaff = function ( thePlayer ) team = getPlayerTeam(localPlayer) if team == getTeamFromName("Staff") then return true; else return false; end end Why doesn't work color for text ? Link to comment
Kenix Posted April 14, 2012 Share Posted April 14, 2012 (edited) Oh.... I give you corrected function. Why you not use it? Also i explain in latest post. Edited April 14, 2012 by Guest Link to comment
drk Posted April 14, 2012 Share Posted April 14, 2012 (edited) Kenix, it's client-side. Blazy, you must set colorCoded parameter to true. Also, Blazy, I gave you the function working before lol Edited April 14, 2012 by Guest Link to comment
Kenix Posted April 14, 2012 Share Posted April 14, 2012 Ok, so what this outputChatBox ( 'You have been jailed!', target, 255, 255, 0 ); ?? blazy can you read all argument on wiki again? isStaff = function ( uPlayer ) local uTeam = getPlayerTeam( uPlayer ) if not uTeam then return false end if uTeam == getTeamFromName 'Staff' then return true end return false end addCommandHandler ( 'aj', function ( _, sTarget, sTime ) if ( isStaff ( localPlayer ) ) then local nTime = tonumber( sTime ) nTime = nTime * 60 * 1000 local uTarget = getPlayerFromName ( sTarget ); setElementInterior ( uTarget, 6 ); setElementPosition ( uTarget, 265.21185302734, 77.63591003418, 1001.0390625 ); setTimer ( function ( uTarget ) setElementPosition ( uTarget, 1546.20203, -1675.47412, 13.56186 ); setElementInterior ( uTarget, 0 ); end, nTime, 1, uTarget ) outputChatBox ( 'You have been jailed!', 255, 255, 0 ) outputChatBox ( 'INFO: ' .. getPlayerName ( uTarget ) .. ' has been jailed for 5 minutes by Admin.', 255, 255, 0 ) outputDebugString ( getPlayerName ( uTarget ) .. ' has been jailed!' ) else outputChatBox ( 'Acess denied to the command!', 255, 255, 0 ) end end ) addCommandHandler ( 'auj', function ( _, sTarget ) if isStaff ( localPlayer ) then local target = getPlayerFromName ( sTarget ) setElementInterior ( target, 0 ) setElementPosition ( target, 1546.20203, -1675.47412, 13.56186 ) outputChatBox ( 'You have been unjailed!', 255, 255, 0 ) else outputChatBox ( 'Acess denied to the command!', 255, 255, 0 ) end end ) Corrected code Link to comment
Wei Posted April 14, 2012 Author Share Posted April 14, 2012 (edited) EDIT: thanks... Edited April 14, 2012 by Guest Link to comment
X-SHADOW Posted April 14, 2012 Share Posted April 14, 2012 Kenix, it's client-side.Blazy, you can't use colors in client-side. Also, Blazy, I gave you the function working before lol sorry bug colors works on ClientSide example outputChatBox('Darken Happy Now ? ', source, 255,255,0) Link to comment
drk Posted April 14, 2012 Share Posted April 14, 2012 I don't understand you. Are you talking about outputChatBox in client-side? I was wrong, it works, but never worked here, I don't know why. Also, if it's client-side and it's not in a event, your code is wrong Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now