• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Outfits?

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
There is function that changes players outfits during the game?
I mean, for example, if the premium expires, then the player will appear with citizen addon without addons, is that possible?
 
doSetCreatureOutfit(cid, outfit, time)

Icy, I tried to find the function on lib and it doesnt appear... It should work anyways? And also, why I would like to set time?
I want that the player stay with the outfit that I setted, because, on the OTs, when your premium expires, and you were using a premium outfit, you can still wear it, but it wont appear on the select outfit screen.

But you need to check whether the premium ended :/ Something with lastday and premdays

Cyko I had this, someone made it and I added a few things to make it work fine:

On login.lua
LUA:
if not isPremium(cid) then
if getPlayerStorageValue(cid, 1234) ~= 1 then
doTeleportThing(cid, getTownTemplePosition(1), FALSE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your premium has expired!")
setPlayerStorageValue(cid, 1234, 1)
doPlayerSetTown(cid, 1)
end
end

if isPremium(cid) then
if getPlayerStorageValue(cid, 1234) == 1 then
setPlayerStorageValue(cid, 1234, -1)
end
end

Im thinking on adding to this script a line that changes de looktype of the player, but it should be when the players log out... And also checking the storage value, so it will be once he lose the premium time, and not always.
 
Icy, I tried to find the function on lib and it doesnt appear... It should work anyways? And also, why I would like to set time?
I want that the player stay with the outfit that I setted, because, on the OTs, when your premium expires, and you were using a premium outfit, you can still wear it, but it wont appear on the select outfit screen.



Cyko I had this, someone made it and I added a few things to make it work fine:

On login.lua
LUA:
if not isPremium(cid) then
if getPlayerStorageValue(cid, 1234) ~= 1 then
doTeleportThing(cid, getTownTemplePosition(1), FALSE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your premium has expired!")
setPlayerStorageValue(cid, 1234, 1)
doPlayerSetTown(cid, 1)
end
end

if isPremium(cid) then
if getPlayerStorageValue(cid, 1234) == 1 then
setPlayerStorageValue(cid, 1234, -1)
end
end

Im thinking on adding to this script a line that changes de looktype of the player, but it should be when the players log out... And also checking the storage value, so it will be once he lose the premium time, and not always.

You could do a creature event that occurs when the player logs out and have it execute queries to manually change their outfit.
 
You could do a creature event that occurs when the player logs out and have it execute queries to manually change their outfit.

Could you help me a little with it, I need the query and the creaturescript code on .xml, and also the function onLogOut :S

Im pretty new scripting, but it could be this script:

LUA:
if not isPremium(cid) then
if getPlayerStorageValue(cid, 1234) ~= 1 then
QUERY THAT CHANGES LOOKTYPE ON DATABASE
setPlayerStorageValue(cid, 1234, 1)
end
end

Help please :)
 
You cannot execute a query while the player is online :/
Just use doCreatureChangeOutfit ?

Code:
doCreatureChangeOutfit(cid, {lookType = getPlayerSex(cid) == 0 and 136 or 128, lookHead = 78, lookBody = 68, lookLegs = 39, lookFeet = 76, lookTypeEx = 0, lookAddons = 0})
 
Last edited:
Cyko, for that reason the idea is to execute it when he gets offline... But Im going to try your idea :)

Edited:

Cyko, I tested it and didn't work:

doCreatureChangeOutfit(cid, {lookType = getPlayerSex(cid) == 0 and 136 or 128, lookHead = 78, lookBody = 68, lookLegs = 39, lookFeet = 76, lookTypeEx = 0, lookAddons = 0})

When the players logs in, the outfit doesn't change :S

That's why Im asking for a query that changes the outfit of the player to 136 o 128 depending on the sex when he logs out, because it will be saved inmediatly.
 
Last edited:
Cyko, I tested it and didn't work:



When the players logs in, the outfit doesn't change :S

That's why Im asking for a query that changes the outfit of the player to 136 o 128 depending on the sex when he logs out, because it will be saved inmediatly.
Then it's something wrong with the rest of the script (storages?).
The function for changing outfit is working fine for me ;/
 
I changed it to doCreatureChangeOutfit(cid, {lookType = 128, lookHead = 78, lookBody = 68, lookLegs = 39, lookFeet = 76, lookTypeEx = 0, lookAddons = 0}) and now works! Repped :)
 
If you still want it, the query would look along the lines of:
LUA:
db.executeQuery("UPDATE players SET lookaddons = 0 WHERE id = "..getPlayerGUID(cid)..";")
 
Back
Top