Hello !
I would like to connect 2 functions with job. When i was trying it, that was causing script errors -_-
Job :
[CODE]TEAM_PSYCHOPATH = AddExtraTeam("Psychopath", {
color = Color(55, 100, 190),
model = {"models/player/hostage/hostage_04.mdl"},
description = [[VIP only job ! You are really psycho person, everyone is laughing at you ! Do not hesitate, revenge on them ! ]],
weapons = {"weapon_crowbar"},
command = "Psychopath",
max = 2,
salary = 30,
admin = 0,
vote = false,
hasLicense = false,[/CODE]
Now this communicate script :
[CODE]PlayerDeath = function(ply, weapon, killer)
if( ply:Team() == TEAM_PSYCHOPATH ) then
ply:changeTeam( GAMEMODE.DefaultTeam, true )
for k,v in pairs( player.GetAll() ) do
v:PrintMessage( HUD_PRINTCENTER, "The psychopath has been killed! Town is safe!" )
end
end
end[/CODE]
And VIP+ Only :
[CODE] customCheck = function(ply)
return ply:IsUserGroup("VIP") or ply:IsUserGroup("admin") or ply:IsUserGroup("superadmin") or ply:IsUserGroup("Owner") or ply:IsUserGroup("ModeratorVIP")
end[/CODE]
Can someone do this ?
I'm going to assume the error is because of a missing comma, or because of the GAMEMODE.DefaultTeam (which always messes up for me, and I just end up setting it to TEAM_CITIZEN).
That being said, what's the error?
i simply cant mix it together, when i was trying i deleted somethig etc. Can you just please make it ?
[lua]TEAM_PSYCHOPATH = AddExtraTeam("Psychopath", {
color = Color(55, 100, 190),
model = {"models/player/hostage/hostage_04.mdl"},
description = [[VIP only job ! You are really psycho person, everyone is laughing at you ! Do not hesitate, revenge on them ! ]],
weapons = {"weapon_crowbar"},
command = "Psychopath",
max = 2,
salary = 30,
admin = 0,
vote = false,
hasLicense = false,
PlayerDeath = function(ply, weapon, killer)
if( ply:Team() == TEAM_PSYCHOPATH ) then
ply:changeTeam( GAMEMODE.DefaultTeam, true )
for k,v in pairs( player.GetAll() ) do
v:PrintMessage( HUD_PRINTCENTER, "The psychopath has been killed! Town is safe!" )
end
end
end,
customCheck = function(ply) return ply:IsUserGroup("VIP") or ply:IsUserGroup("admin") or ply:IsUserGroup("superadmin") or ply:IsUserGroup("Owner") or ply:IsUserGroup("ModeratorVIP")
end
})[/lua]
Probably fatfingered something there, because lazy and laying in bed.
Sorry, you need to Log In to post a reply to this thread.