Andrekkzie
New Member
- Joined
- Sep 12, 2010
- Messages
- 64
- Reaction score
- 2
I need a command for deleting ppl but when i deleted a person i want to say Name has been deleted for breaking the rules!
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
return true
end
doBroadcastMessage("" .. getCreatureName(pid) .." has been deleted for breaking the rules!")
doRemoveCreature(pid, true)
db.executeQuery("DELETE from `players` WHERE `name` = " .. getCreatureName(pid) .. " LIMIT 1")
return true
end
db.executeQuery("DELETE from `players` WHERE `name` = " .. getCreatureName(pid) .. " LIMIT 1")
db.query("DELETE from `players` WHERE `name` = " .. getCreatureName(pid) .. " LIMIT 1")
I haven put that but i don't need any special command for do it?
<talkaction log="yes" words="/delete" access="5" event="script" value="delete.lua"/>
Lol is not done help me to finish and i add u rep
function onSay(cid, words, param, channel)
if(param == "") then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
end
local c = db.executeQuery
if not c then
c = db.query
end
local pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
end
doRemoveCreature(pid)
local query = c("delete from players where name = " .. db.escapeString(getCreatureName(pid)) .. ";")
if not query then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. getCreatureName(pid) .. " cannot be deleted.")
end
return doBroadcastMessage(getCreatureName(pid) .." has been deleted for breaking the rules!")
end
Lol i already gave u rep whats ur problem?