Is it possible to make so that different people in ULX groups can have different prop limits.
Lets say respected have 60 props whilst moderator has 80.Well you get the image.
So anyone have any ideas of how I could do that,really need this for my server :/
You could ghetto rig it so when they hit the set limit, it makes them run undo when they spawn a prop *shrug*
Edit the GM:PlayerSpawnProp function to be something like
[lua]
EXTRA_PROPS = {}
EXTRA_PROPS.Admin = 20
function GM:PlayerSpawnProp(ply, model)
ply.Props = ply.Props or 0;
if( ply:IsAdmin() ) then
local propcount = server_settings.Int("sbox_max_props", 0)
if( LimitReachedProcess(ply, props)) then
if( ply.Props > EXTRA_PROPS.Admin ) then
return
else
ply.Props = ply.Props + 1;
end
end
end
return true;
end
[/lua]
I got confused when writing that because i was talking on MSN so if it doesn't work well you get the point.
So you'd be editing the game mode? Isn't that a little.. Harsh?
[lua]
EXTRA_PROPS = {}
EXTRA_PROPS.Admin = 20
function PlayerSpawnPropEDIT(ply, model)
ply.Props = ply.Props or 0;
if( ply:IsAdmin() ) then
if( LimitReachedProcess(ply, props)) then
if( ply.Props > EXTRA_PROPS.Admin ) then
return
else
ply.Props = ply.Props + 1;
end
end
end
return true;
end
hook.Add("PlayerSpawnProp", "PropHook", PlayerSpawnPropEDIT)
[/lua]
Happy =P
Where would you be putting it in the darkrp gamemode
[QUOTE=Noodle man;16031880]Where would you be putting it in the darkrp gamemode[/QUOTE]
:dogout:
[QUOTE=Noodle man;16031880]Where would you be putting it in the darkrp gamemode[/QUOTE]
Seriously....
Any ideas how to make it work for like respected group,because currently its for admin only :(
Actually that code was helpful to me, thanks Averice, I'll be using this when I add group based limits to GManage.
May I ask you then how do you change it so it can be used by different groups.Like each group have their own limit.
=D Glad you liked it.
[QUOTE=Averice;16031804][lua]
EXTRA_PROPS = {}
EXTRA_PROPS.Admin = 20
function PlayerSpawnPropEDIT(ply, model)
ply.Props = ply.Props or 0;
if( ply:IsAdmin() ) then
if( LimitReachedProcess(ply, props)) then
if( ply.Props > EXTRA_PROPS.Admin ) then
return
else
ply.Props = ply.Props + 1;
end
end
end
return true;
end
hook.Add("PlayerSpawnProp", "PropHook", PlayerSpawnPropEDIT)
[/lua]
[/QUOTE]
I don't really understand what ply.Props = ply.Props or 0; does exactly. Is it the prop limit of the other non admin/super admins?
and wouldn't if( ply.Props > EXTRA_PROPS.Admin ) always return false or is this a checker if they change ply.Props to something more then EXTRA_PROPS.Admin so that Admins get 20 more props?
Couldn't you make a function for each of the player groups with a prop limit?
I have no idea, i don't know much lua :3
Sorry, you need to Log In to post a reply to this thread.