Difference between revisions of "Packages:helpful-actions"
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=== ULX rank giving based on current rank === | === ULX rank giving based on current rank === | ||
+ | This is useful when a moderator donates and you want them to get a rank for example called "moderator+" instead of "donator" | ||
+ | |||
+ | ==== Initial action ==== | ||
+ | This action has to be "At first join" | ||
+ | |||
+ | <nowiki>if Prometheus.Temp.Ply:IsUserGroup("moderator") then | ||
+ | ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "moderator+") | ||
+ | elseif Prometheus.Temp.Ply:IsUserGroup("admin") then | ||
+ | ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "admin+") | ||
+ | else | ||
+ | ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "donator") | ||
+ | end</nowiki> | ||
+ | |||
+ | ==== Expire action ==== | ||
+ | On expiration of the package you need to run the above code, but in reverse: | ||
+ | |||
+ | <nowiki>if Prometheus.Temp.Ply:IsUserGroup("moderator+") then | ||
+ | ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "moderator") | ||
+ | elseif Prometheus.Temp.Ply:IsUserGroup("admin+") then | ||
+ | ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "admin") | ||
+ | else | ||
+ | ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "user") | ||
+ | end</nowiki> | ||
=== Pointshop 1 points based on amount spent === | === Pointshop 1 points based on amount spent === | ||
+ | |||
+ | In step 1 enable "custom price" and set the minimum to whatever you want. Also select "Permanent package" and "Buyable more than once if already active". | ||
+ | |||
+ | In step 2 you want to go to "Custom action" and use the following code, modify the modifier to your liking: | ||
+ | |||
+ | <nowiki>local modifier = 100 | ||
+ | Prometheus.Temp.Ply:PS_GivePoints(Prometheus.Temp.MoneySpent * modifier)</nowiki> | ||
+ | |||
+ | This would give the user 100 points for every $1 or €1 or whatever other currency you have. Meaning they can buy as much as they want. Modify the modifier to match how you want it to work. | ||
=== Pointshop 2 points based on amount spent === | === Pointshop 2 points based on amount spent === | ||
+ | |||
+ | |||
+ | In step 1 enable "custom price" and set the minimum to whatever you want. Also select "Permanent package" and "Buyable more than once if already active". | ||
+ | |||
+ | In step 2 you want to go to "Custom action" and use the following code, modify the modifier to your liking: | ||
+ | |||
+ | ==== Standard points ==== | ||
+ | <nowiki>local modifier = 100 | ||
+ | Prometheus.Temp.Ply:PS2_AddStandardPoints(Prometheus.Temp.MoneySpent * modifier)</nowiki> | ||
+ | |||
+ | ==== Premium points ==== | ||
+ | <nowiki>local modifier = 100 | ||
+ | Prometheus.Temp.Ply:PS2_AddPremiumPoints(Prometheus.Temp.MoneySpent * modifier)</nowiki> | ||
+ | |||
+ | This would give the user 100 points for every $1 or €1 or whatever other currency you have. Meaning they can buy as much as they want. Modify the modifier to match how you want it to work. | ||
=== DarkRP money based on amount spent === | === DarkRP money based on amount spent === | ||
+ | In step 1 enable "custom price" and set the minimum to whatever you want. Also select "Permanent package" and "Buyable more than once if already active". | ||
+ | |||
+ | In step 2 you want to go to "Custom action" and use the following code, modify the modifier to your liking: | ||
+ | |||
+ | <nowiki>local modifier = 100 | ||
+ | Prometheus.Temp.Ply:AddMoney(Prometheus.Temp.MoneySpent * modifier)</nowiki> | ||
+ | |||
+ | This would give the user 100 darkrp money for every $1 or €1 or whatever other currency you have. Meaning they can buy as much as they want. Modify the modifier to match how you want it to work. |
Latest revision as of 13:11, 2 January 2019
Contents
ULX rank giving based on current rank
This is useful when a moderator donates and you want them to get a rank for example called "moderator+" instead of "donator"
Initial action
This action has to be "At first join"
if Prometheus.Temp.Ply:IsUserGroup("moderator") then ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "moderator+") elseif Prometheus.Temp.Ply:IsUserGroup("admin") then ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "admin+") else ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "donator") end
Expire action
On expiration of the package you need to run the above code, but in reverse:
if Prometheus.Temp.Ply:IsUserGroup("moderator+") then ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "moderator") elseif Prometheus.Temp.Ply:IsUserGroup("admin+") then ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "admin") else ULib.ucl.addUser(Prometheus.Temp.Ply:SteamID(), nil, nil, "user") end
Pointshop 1 points based on amount spent
In step 1 enable "custom price" and set the minimum to whatever you want. Also select "Permanent package" and "Buyable more than once if already active".
In step 2 you want to go to "Custom action" and use the following code, modify the modifier to your liking:
local modifier = 100 Prometheus.Temp.Ply:PS_GivePoints(Prometheus.Temp.MoneySpent * modifier)
This would give the user 100 points for every $1 or €1 or whatever other currency you have. Meaning they can buy as much as they want. Modify the modifier to match how you want it to work.
Pointshop 2 points based on amount spent
In step 1 enable "custom price" and set the minimum to whatever you want. Also select "Permanent package" and "Buyable more than once if already active".
In step 2 you want to go to "Custom action" and use the following code, modify the modifier to your liking:
Standard points
local modifier = 100 Prometheus.Temp.Ply:PS2_AddStandardPoints(Prometheus.Temp.MoneySpent * modifier)
Premium points
local modifier = 100 Prometheus.Temp.Ply:PS2_AddPremiumPoints(Prometheus.Temp.MoneySpent * modifier)
This would give the user 100 points for every $1 or €1 or whatever other currency you have. Meaning they can buy as much as they want. Modify the modifier to match how you want it to work.
DarkRP money based on amount spent
In step 1 enable "custom price" and set the minimum to whatever you want. Also select "Permanent package" and "Buyable more than once if already active".
In step 2 you want to go to "Custom action" and use the following code, modify the modifier to your liking:
local modifier = 100 Prometheus.Temp.Ply:AddMoney(Prometheus.Temp.MoneySpent * modifier)
This would give the user 100 darkrp money for every $1 or €1 or whatever other currency you have. Meaning they can buy as much as they want. Modify the modifier to match how you want it to work.