Ulysses
General => Developers Corner => Topic started by: IizStormViper on July 08, 2012, 01:12:26 PM
-
So I'm starting to make my own gamemode that has credits.So I was wondering if anyone could help me. I'm trying to make a custom credit system.This is what I have so far will this work if I add a loop and make it so the person that kills someone gets more credits everytime they get killed.
credit = 0
function GM:PlayerInitialSpawn(ply)
if credit = 0 then
credit = 1.5 else
if credit = getcredit then
credit + 1.5
end
end
concommand.Add("credit", credit)
edit: I know that it is on spawn, its only being tested at the moment.
-
So I'm starting to make my own gamemode that has credits.So I was wondering if anyone could help me. I'm trying to make a custom credit system.This is what I have so far will this work if I add a loop and make it so the person that kills someone gets more credits everytime they get killed.
credit = 0
function GM:PlayerInitialSpawn(ply)
if credit = 0 then
credit = 1.5 else
if credit = getcredit then
credit + 1.5
end
end
concommand.Add("credit", credit)
edit: I know that it is on spawn, its only being tested at the moment.
I don't even understand how that code is related to your description. I honestly don't think you should be making a gamemode since you don't really have the skills to make one.
You have to use the PlayerDeath( ply, weapon, killer ) hook. And you need to store the credits on the players, ply:SetNWInt( "credits", 1 ) or in a table.
-
Not to sound rude, but everything about the code you posted is wrong. Nothing will work in that.
If you can tell me what you want it to do clearly, I will help you out.