• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Sql Query !

dukzin

New Member
Joined
Aug 18, 2008
Messages
161
Reaction score
3
Hello OTland :D

i'm using this query to remove all frags of all persons.

"DELETE FROM `killers` WHERE `unjustified` = 1;"

can someone tell me how can i remove only 1 frag of all persons.

;s

thanks.

i'll Rep ++!
 
cleans all too. ;s

How i'm testing:

login 2 characters (MC) kill other one 2 times.
use the query
and say !frags..
 
Code:
"UPDATE `killers` SET `unjustified` = `unjustified`-1"
The total number of unjustified kills is not stored like that - it's stored within multiple entries (rows).
Also, no quotes around queries!

One might have to use UPDATE and store the player_id's that have been already processed. However, there isn't a player_id column in table killers which means you would have to SELECT from table player_killers, too.
 
cyko, are u talking about " ?
if it's i'm deleting it...

if u know a query to delete one frag of all persons please post heree ;(
 
Very bad way, but you could simply do
onLogin(cid) remove 1 frag from that player, set storage :p

Lua:
function onLogin(cid)
	if getPlayerStorageValue(cid, 93368) < 1 then
		db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..getPlayerGUID(cid).." LIMIT 1;")
		setPlayerStorageValue(cid, 93368, 1)
	end
	return true
end
 
@zonet
Code:
                db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..getPlayerGUID(cid).." LIMIT 1;")

it removes 1 frag?

if yes, i'm making a global event that i want :x


-----

about it.
removes 1 frag of all online or offline (if possible) players.
i've it, but it needs a query that removes 1 frag...
;s

if someone have other way to do it,
post here ;x
 
@zonet
Code:
                db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..getPlayerGUID(cid).." LIMIT 1;")

it removes 1 frag?

if yes, i'm making a global event that i want :x


-----

about it.
removes 1 frag of all online or offline (if possible) players.
i've it, but it needs a query that removes 1 frag...
;s

if someone have other way to do it,
post here ;x
Use onLogin(cid) wont hurt you, lol.
Yes, it removes all players frags that login, only 1 frag, 1 TIME.
 
noo, i dont want that removes on login..
i want to remove every x time..

function onThink(interval)
db.executeQuery("QUERY THAT I WANT")
doBroadcastMessage("Everbody Lost 1 Frag. Next remotion in 1 hours.")
return true
end
 
online maybe possible but idk how to do it for offline players also ;S
try this;
Code:
function onThink(inerval, lastExecution)
	for _, cid in ipairs(getPlayersOnline()) do
		db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..getPlayerGUID(cid).." LIMIT 1;")
		doBroadcastMessage("Everybody Lost 1 Frag. Next remotion in 1 hours.")
	end
	return true
end
 
Back
Top