Author Topic: GM, Credit help.  (Read 2284 times)

0 Members and 1 Guest are viewing this topic.

Offline IizStormViper

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
GM, Credit help.
« 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.

Code: [Select]
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.

Offline Assault_Trooper

  • Newbie
  • *
  • Posts: 20
  • Karma: 1
    • Trooper's Gaming Servers
Re: GM, Credit help.
« Reply #1 on: July 08, 2012, 03:01:06 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.

Code: [Select]
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.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: GM, Credit help.
« Reply #2 on: July 09, 2012, 03:16:33 AM »
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.