secondlife
Member
- Joined
- Aug 1, 2009
- Messages
- 298
- Reaction score
- 23
Hi guys,
I'm trying to make a script that when giving the character a look, return a certain "nickname" depending on the storage.
Example:
If the player has 30001 storage, show Hunter when giving a look;
If the player has 30002 storage, show Assassin when giving a look;
If the player has 30003 storage, show Killer Spree when giving a look.
...
Here is my look.lua
Like this:
14:51 You see Giddeon (Level 8). He is a elite knight (Hunter).
If the player doesn't have any of the storages, he doesn't need to show anything, only:
14:51 You see Giddeon (Level 8). He is a elite knight.
Can someone help me?
Many thanks!
I'm trying to make a script that when giving the character a look, return a certain "nickname" depending on the storage.
Example:
If the player has 30001 storage, show Hunter when giving a look;
If the player has 30002 storage, show Assassin when giving a look;
If the player has 30003 storage, show Killer Spree when giving a look.
...
Here is my look.lua
Lua:
function onLook(cid, thing, position, lookDistance)
function getKillsPlayer(cid)
local Info = db.getResult("SELECT `frags` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
local frags= Info:getDataInt("frags")
return frags
end
function getDeathsPlayer(cid)
local Info = db.getResult("SELECT `deaths` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
local deaths= Info:getDataInt("deaths")
return deaths
end
if isPlayer(thing.uid) then
local kdr = getKillsPlayer(thing.uid)/getDeathsPlayer(thing.uid)
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " has Killed: ["..getKillsPlayer(thing.uid).."] Players."..(getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " has Died: ["..getDeathsPlayer(thing.uid).."] Times.\nThe Kdr(Kill Death Ratio) is: ["..kdr.."].")
end
if(thing.uid == cid) then
local kdr = getKillsPlayer(thing.uid)/getDeathsPlayer(thing.uid)
doPlayerSetSpecialDescription(thing.uid, "\nYou have Killed: ["..getKillsPlayer(thing.uid).."] Players.\nYou have Died: ["..getDeathsPlayer(thing.uid).."] Times.\nYou Kdr(Kill Death Ratio) is: ["..kdr.."].")
end
return true
end
Like this:
14:51 You see Giddeon (Level 8). He is a elite knight (Hunter).
If the player doesn't have any of the storages, he doesn't need to show anything, only:
14:51 You see Giddeon (Level 8). He is a elite knight.
Can someone help me?
Many thanks!