athenso
Average Coder
- Joined
- May 31, 2011
- Messages
- 155
- Solutions
- 3
- Reaction score
- 23
So this is a simple mentor script.
Example: /mentor Player
Player gets a message saying they have a new student. On my server a mentor gets 15% exp, but thats on you guys. Feel free to add to it/edit it. Just be sure to give me credit. This is my first 100% script all by myself
Example: /mentor Player
Player gets a message saying they have a new student. On my server a mentor gets 15% exp, but thats on you guys. Feel free to add to it/edit it. Just be sure to give me credit. This is my first 100% script all by myself
Code:
function onSay(cid, words, param)
if (words == "/mentor") then
local t = string.explode(param)
if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end
local player,pid = getPlayerByName(param),getPlayerByNameWildcard(param)
local mentor = getPlayerStorageValue(player,90000)
local speaker = getPlayerByName(cid)
if getPlayerStorageValue(player,90000) > 2 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..param.." already has 3 students.")
else
setPlayerStorageValue(player, 90000, getPlayerStorageValue(player, 90000)+1)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Someone has added you as their mentor.")
end
end
return true
end