Delvire
°£°
- Joined
- Feb 24, 2008
- Messages
- 236
- Reaction score
- 9
Hello everybody...
Some days ago, I did a script, and It works like:
"The player logs his new character in a little island, in this island, there are trainers, but the player cannot rain there forever... when he get a X amount of melee/distance/shield/magic level he is kicked from the trainers and is no more able to enter in the Trainers room"
This is the script:
For example: "The player advanced his sword fighting skill to 40, he will be kicked from the training room... ok Some time later... he decides to train his club skill, and when he get 40 of club, he will be teleported to the small island, sayng:'You may not train anymore')"
So, the basical problem is the storage value checking, It's obious that I'll REP++ those who help me
Some days ago, I did a script, and It works like:
"The player logs his new character in a little island, in this island, there are trainers, but the player cannot rain there forever... when he get a X amount of melee/distance/shield/magic level he is kicked from the trainers and is no more able to enter in the Trainers room"
This is the script:
The problem is the "getPlayerStorageValue(cid,9000) == 1", the script works, but simply don't check if the player have the following storage value, and It causes several bugs:local config =
{
pos = {x = 537, y = 558, z = 7},
message = "Você já não pode mais treinar.",
levelToTeleport = 40,
skillfi = 0, -- 0 = fist
skillcl = 1, -- 1 = club
skillsw = 2, -- 2 = sword
skillax = 3, -- 3 = axe
skillsh = 5 -- 5 = shielding
}
function onAdvance(cid, skill, oldlevel, newlevel)
if (getPlayerStorageValue(cid,9000) == 1 and skill == config.skillfi and newlevel == config.levelToTeleport or config.skillcl and newlevel == config.levelToTeleport or config.skillsw and newlevel == config.levelToTeleport or config.skillax and newlevel == config.levelToTeleport or config.skillsh and newlevel == config.levelToTeleport) then
doPlayerSendTextMessage(cid,TALKTYPE_ORANGE_1, config.message)
doTeleportThing(cid, config.pos)
doSendMagicEffect(config.pos, 10)
setPlayerStorageValue(cid,9000,2)
end
return TRUE
end
For example: "The player advanced his sword fighting skill to 40, he will be kicked from the training room... ok Some time later... he decides to train his club skill, and when he get 40 of club, he will be teleported to the small island, sayng:'You may not train anymore')"
So, the basical problem is the storage value checking, It's obious that I'll REP++ those who help me
Last edited: