NEWBEH QUESTION: Why isn't this Evolve Plugin working?

I would like to know what newbie Problem i did wrong here.

Problem:

Super-Slay doesn’t slay After respawn. I am currently Testing for SQL Query Mistakes.
Codes:

[lua]
/-------------------------------------------------------------------------------------------------------------------------
Kills The Play Specified Number of times
-------------------------------------------------------------------------------------------------------------------------
/

local PLUGIN = {}
PLUGIN.Title = “SuperSlay”
PLUGIN.Description = “Spawn-Kills the Player Specified Number of Times.”
PLUGIN.Author = “Overv”
PLUGIN.ChatCommand = “superslay”
PLUGIN.Usage = “<players> [times]”
PLUGIN.Privileges = { “SuperSlay” }

function SuperSlayedTimes(ply)
local result = sql.Query(“SELECT Times FROM super_slayed WHERE SteamID = '” …ply:SteamID()…"’")
if (!result) then
return 0
else
return tonumber(result)
end
end

function SetupPlayerSuperSlay(ply, times)
if (sql.Query(“SELECT * FROM super_slayed WHERE SteamID = '” …ply:SteamID()…"’")) then
print(sql.LastError())
sql.Query(“UPDATE super_slayed SET Times = “…times…”’”)
print(sql.LastError())
else
sql.Query(“INSERT INTO super_slayed Times VALUES (”…times…")")
print(sql.LastError())
end
end

function PLUGIN:Call( ply, args )
if ( ply:EV_HasPrivilege( “SuperSlay” ) ) then
local players = evolve:FindPlayer( args, ply, true )
local times = tonumber( args[2] ) or 1
local damage = tonumber( args[3] ) or 0

	if (!sql.TableExists("super_slayed")) then
		sql.Query("CREATE TABLE super_slayed ( SteamID VARCHAR(50) UNIQUE, Times INT )")
		print(sql.LastError())
	end
	for _, pl in ipairs( players ) do
		if (pl:Alive()) then
		pl:Kill()
		SetupPlayerSuperSlay(pl,times)
		else
		SetupPlayerSuperSlay(pl,times)
		end
	end
	
	if ( #players &gt; 0 ) then
		evolve:Notify( evolve.colors.blue, ply:Nick(), evolve.colors.white, " has Super-Slayed ", evolve.colors.red, evolve:CreatePlayerList( players ), evolve.colors.white, " with " .. times .. " times.")
		
	else
		evolve:Notify( ply, evolve.colors.red, evolve.constants.noplayers )
	end
else
	evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
end

end

function PLUGIN:PlayerSpawn ( ply )
if (SuperSlayedTimes(ply) > 0) then
ply:Kill()
SetupPlayerSuperSlay(ply,SuperSlayedTimes(ply) - 1)

end

end

evolve:RegisterPlugin( PLUGIN )
[/lua]

NEW ERRORS

You can’t have spaces before and after you link variables to strings.

ah…Thank you very much. I am new To LUA, as you can see cheers

More Problems:

Hook ‘PlayerSpawn’ in plugin ‘SuperSlay’ failed with error:
[addons\evolve\lua\ev_plugins\sh_superslay.lua:42] attempt to index

Plugin ‘SuperSlay’ failed with error:
[addons\evolve\lua\ev_plugins\sh_superslay.lua:24] attempt to index field ‘?’ (a nil value)

:confused:

Next time can you please put the code directly to your post using [lua****] and [/lua****] tags, thanks.

ok. I done that.

This won’t really help you with your problem, but use the **[Player.SetPData

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.SetPData)** instead of all that sql stuff, it’s alot easier.