-
Posts
451 -
Joined
-
Last visited
Everything posted by ZeyadGTX
-
function PM(theMessage, thePlayer) outputServerLog("From: "..getPlayerName(source).." to: "..getPlayerName(thePlayer)..": "..theMessage) end addEventHandler("onPlayerChat", getRootElement(), PM)
-
any way its not working in Serverside too
-
e.e but my pm system is /w playername message
-
i tried this script server side and client not working , i have and this is my Pm system but ican't read others Pms function privateMessage(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if (getPlayerFromParticalName (sendToName)) then local toPlayer = (getPlayerFromParticalName (sendToName)) local toPlayerTeam = getPlayerTeam(toPlayer) if toPlayerTeam then local toRed, toGreen, toBlue = getTeamColor(toPlayerTeam) toColor = string.format("#%02X%02X%02X", toRed, toGreen, toBlue) else toColor = '#ffffff' end local fromPlayerTeam = getPlayerTeam(thePlayer) if fromPlayerTeam then local fromRed, fromGreen, fromBlue = getTeamColor(fromPlayerTeam) fromColor = string.format("#%02X%02X%02X", fromRed, fromGreen, fromBlue) else fromColor = '#ffffff' end if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#FF4646(WHISPER) To ".. toColor .. getPlayerName(toPlayer) .. ":#FFFFFF " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FF4646(WHISPER) From " .. fromColor .. getPlayerName(thePlayer) .. ":#FFFFFF " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#FF4646(WHISPER)#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [player name] [message]", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF(WHISPER)#FFFFFF You cannot Whisper yourself#FFFFFF!", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF(WHISPER)#FFFFFF Player not found! #FFFF00(#FFFFFF"..sendToName.."#FFFF00)", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [partical player name] [message]", thePlayer, 255, 255, 255, true) return false end end addCommandHandler("pm", privateMessage) addCommandHandler("w", privateMessage) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
-
its client side right , oututchatBox is Server side
-
its not workig at all nvm some moderator close this topic
-
you mean like this ? , i don't understand function PM(theMessage, thePlayer) --You can do the rest. (source = the player who send the message end addEventHandler("onPlayerPrivateMessage", getRootElement(), randomname)
-
can you help me with script ? cause i tried it and onPlayerPrivateMessage
-
do you have ready-made script ?
-
Is there a way To See ( SPY) The Players PM , like who sents pm to each others ?
-
it works but i can be killed when iam protected
-
and its Compiled idk where to add the XYZ of spawn
-
Hey guys i use this script which allows me to save player stats but it says that it has some errors that make some lag statssave\main_s.lua:33: attempt to concatenate a boolean value addEventHandler("onPedWasted",root, function() savePedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerLogin",root, function() loadPedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerQuit",root, function() savePedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerLogout",root, function(thePreviousAccount) savePedStats( thePreviousAccount ) end ) function savePedStats( Acc) outputChatBox(getPlayerName(source).." saveing Stats now!", source) local pedposx,pedposy,pedposz = getElementPosition( source ) local pedrotx,pedroty,pedrotz = getElementRotation( source ) setAccountData(Acc, "pos.x", pedposx) setAccountData(Acc, "pos.y", pedposy) setAccountData(Acc, "pos.z", pedposz) setAccountData(Acc, "rot.x", pedrotx) setAccountData(Acc, "rot.y", pedroty) setAccountData(Acc, "rot.z", pedrotz) setAccountData(Acc, "skin", getPedSkin( source )) setAccountData(Acc, "armor", getPedArmor( source )) setAccountData(Acc, "health", getElementHealth( source )) setAccountData(Acc, "money",getPlayerMoney( source )) for i = 21 , 25 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end for i = 69 , 79 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end outputChatBox(getPlayerName(source).." saved Stats!", source) end function loadPedStats(Acc ) outputChatBox(getPlayerName(source).." loading Stats now!", source) setElementPosition(source,getAccountData(Acc, "pos.x"),getAccountData(Acc, "pos.y"),getAccountData(Acc, "pos.z")) setElementRotation(source,getAccountData(Acc, "rot.x"),getAccountData(Acc, "rot.y"),getAccountData(Acc, "rot.z")) setPedSkin(source,getAccountData(Acc, "skin")) setPedArmor(source,getAccountData(Acc, "armor")) setElementHealth(source,getAccountData(Acc, "health")) setPlayerMoney(source,getAccountData(Acc, "money")) for i = 21 , 25 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end for i = 69 , 79 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end outputChatBox(getPlayerName(source).." loaded Stats!", source) end
-
Spawn protection when you spawn for 5 seconds i mean no one can kill you after 5 seconds when you spawn like friendly fire
-
Hey i have Spawn Point But i Have Problem i tried all Spawn point Protection and Not Working can some one make spawn protection for this point and thanks "ranch" posX="-711" posY="957" posZ="12.4" rotation="90">