Tibia.net.pl
| (#?)
| [8.1][C++]/changesexDyskusja dotycząca tematu [8.1][C++]/changesex, który znajduje się w kategorii Skrypty - pozostałe (Pomoc oraz inne skrypty związane z OT.), na forum C++ (Wszystko, co związane z kompilowaniem.). Treść: skrypt nie moj
W commands.cpp pod
Kod:
{"/kick",&Commands::kickPlayer},
Dodaj:
Kod:
{"/changesex",&Commands::changeSex},
W pliku commands.h pod
Kod:
bool kickPlayer(Creature* c, const std::string ... Na Tibia.net.pl znajdziesz dokończenie tematu [8.1][C++]/changesex | | |
28-06-2008, 13:43
|
| | Początkujący | [8.1][C++]/changesex skrypt nie moj
W commands.cpp pod Kod: {"/kick",&Commands::kickPlayer},
Dodaj: Kod: {"/changesex",&Commands::changeSex},
W pliku commands.h pod Kod: bool kickPlayer(Creature* c, const std::string &cmd, const std::string ¶m);
Dodaj: Kod: bool changeSex(Creature*,const std::string&,const std::string&);
Na końcu tego pliku dodajemy: Kod: bool Commands::changeSex(Creature* c, const std::string &, const std::string &Wink2 {
Player* p = dynamic_cast<Player*>©;
if (!p)
return false;
long losttime = 0*g_config.getGlobalNumber("sexchangehours", 0);
if (p->premiumTicks < losttime) {
p->sendTextMessage(MSG_SMALLINFO,"You do not have enought premium time.");
return false;
}
bool sex = p->sex == PLAYERSEX_MALE;
if (sex) {
p->sendTextMessage(MSG_SMALLINFO,"You are now a female.");
p->sex = PLAYERSEX_FEMALE;
p->looktype = 136;
game->creatureChangeOutfit(p);
} else {
p->sendTextMessage(MSG_SMALLINFO,"You are now a male.");
p->sex = PLAYERSEX_MALE;
p->looktype = 128;
game->creatureChangeOutfit(p);
W comands.xml dodajemy Kod: <command cmd="/changesex" access="3" />
Pozdro Agacik
| |
| | |
28-06-2008, 15:52
|
| | Bywalec |
Nie prościej na talkactions w oparciu o funkcję doPlayerSetSex? Wydaje mi się, że wszystkie silniki na 8.1 już tą funkcję posiadają =o
Wtedy kod byłby prosty: Cytat:
function onSay(cid, words, param)
if getPlayerPremiumDays(cid) > 2 then
if getPlayerPremiumDays(cid) < 65535 then
doPlayerAddPremiumDays(cid, -3)
end
if getPlayerSex(cid) == 0 then
doPlayerSetSex(cid, 1)
else
doPlayerSetSex(cid, 0)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your sex and lost three days of premium account.")
else
doPlayerSendCancel(cid, "You do not have enough premium days, changing sex costs three of your premium days.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
| | |
| | |
08-07-2008, 16:57
|
| | Gaduła | Cytat:
if getPlayerPremiumDays(cid) > 2 then
if getPlayerPremiumDays(cid) < 65535 then
| Po co if getPlayerPremiumDays(cid) < 65535 ? Nawet jeśli już dałeś ten warunek lepiej to zapisać jako: Kod: if getPlayerPremiumDays(cid) > 2 and getPlayerPremiumDays(cid) < 65535 then
@topic: Mało przydatne, większość serwerów (w tym TFS) mają doChangeSex
| |
| | |
08-07-2008, 23:18
|
| | Początkujący |
Noo...ten skrypt był bardzo potrzebny a szczególnie to silniku + real mapa tam zawsze był npc który nie zmieniał płci.
| |
| | |
09-07-2008, 13:00
|
| | Początkujący | /changesex 7.6
Witam, wiem, że to jest bardzo popularne pytanie, ale jako, że zauważyłem ten temat, to chciałem się o coś zapytać:
Widziałem na forum komende /changesex pod tibie 7.6, i mam pytanie czy mógłby ktoś podać mi link do tego tematu?
@EDIT
Już nie trzeba dziękuję.
| |
| | |
08-08-2008, 17:46
|
| | Nowicjusz | | |
| | |
08-08-2008, 17:47
|
| | Nowicjusz |
<a href="http://www.pokeplushies.com/feed/604963"><img src="http://www.pokeplushies.com/images/adoptables/604963.gif" border="0"><br>Click here to feed me a Star Fruit!</a><br><a href="http://www.flyffables.com">Get your own at Flyffables!</a>
| |
| | |
08-08-2008, 17:49
|
| | Nowicjusz | | |
| | |
08-08-2008, 18:15
|
| | Nowicjusz | Soryy | |
| | | Narzędzia tematu | | | | Wygląd | Wygląd liniowy | | Tibia.net.pl: C++ (Wszystko, co związane z kompilowaniem.) Temat: [8.1][C++]/changesex skrypt nie moj
W commands.cpp pod
Kod:
{"/kick",&Commands::kickPlayer},
Dodaj:
Kod:
[...] | Czasy w strefie GMT +1. Teraz jest 16:57. | | |