Skrypty & Kody Ranga za fragi

Status
Zamknięty.

patryq95

User
Zarejestrowany
Dołączył
Luty 19, 2009
Posty
40
Liczba reakcji
1
a wi?c skrypt ten pokazuje range jak klikn? na innego gracza ale jak klikn? na sb to ju? moja ranga si? nie wy?wietla i nie mam poj?cia jak to zmieni?
[XML]<?xml version = "1.0" encoding = "UTF-8"?>
<mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes">
<config name = "ranks"><![CDATA[
titles = {
[5] = "Private First Class",
[10] = "Specialist",
[15] = "Corporal",
[20] = "Sergeant",
[25] = "Staff Sergeant",
[30] = "Sergeant First Class",
[35] = "Master Sergeant",
[40] = "First Sergeant",
[45] = "Sergeant Major",
[50] = "Command Sergeant Major",
[55] = "Sergeant Major of the Army",
[60] = "Second Lieutenant",
[65] = "First Lieutenant",
[70] = "Captain",
[75] = "Major",
[80] = "Lieutenant Colonel",
[90] = "Colonel",
[100] = "Brigadier General",
[110] = "Major General",
[120] = "Lieutenant General",
[140] = "General",
[170] = "General of the Army"
}
fragsStorage = 600
]]></config>
<event type = "look" name = "ranksLook" event = "script"><![CDATA[
domodlib("ranks")
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid)) then
local rank = {rank = "Private", frags = 0}
for k, v in pairs(titles) do
if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
if(k - 1 > rank.frags) then
rank.rank, rank.frags = v, k - 1
end
end
end
doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank .. " Frags: " ..getPlayerStorageValue(thing.uid, fragsStorage)+1)



end
return true


end
]]></event>
<event type = "kill" name = "ranksKill" event = "script"><![CDATA[
domodlib("ranks")
function onKill(cid, target)
if(isPlayer(target)) then
setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1))
if(titles[getPlayerStorageValue(cid, fragsStorage)]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!")
if(titles[getPlayerStorageValue(cid, fragsStorage)]== "Sergeant First Class") then
doPlayerAddItem(cid, 9693, 1)
end
end
end
return true
end
]]></event>

<event type = "login" name = "ranksLogin" event = "script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "ranksKill")
registerCreatureEvent(cid, "ranksLook")
return true
end
]]></event>
</mod>
[/XML]
 
Odp: Ranga za fragi

Dlatego, ?e jak klikasz na sb to pisz? tylko "You see yourself. You are paladin." To trzeba w creaturescript zrobi?.

@Edit
Ale tutaj jest ta funkcja wi?c trzeba co? innego.
 
Odp: Ranga za fragi

Z tego co pamietam to zmienia?o to si? w player.cpp (jezeli mnie oczy nie myla) powiniene? doda? co? takiego bo na 8++ si? nie znam:d <<

"\n Postac posiada " << range <<" rankslook."; co? w ten dese? poniewa? si? nie znam na c++ tylko lua wi?cej pom?c nie umiem ;/

spr?b?j to przerobi? z linijki na zobaczenie levela ;d

?ycz? Powodzenia.
 
Ostatnia edycja:
Odp: Ranga za fragi

probowalem zmienic thing.uid na thing.cid tak jak w jednym ze skryptow na necie ale on byl w creaturescript i mi nie dzialalo. ja mam ten skrypt w mods wiec moze jakos to przekopiowaac do creaturescript??
 
Odp: Ranga za fragi

To jeden kij czy tu czy tu. W mod si? robi d?u?sze systemy/eventy, bo wszystko jest razem i nie trzeba szuka? nie wiadomo gdzie. Je?li chcesz, ?eby pokazywa?o sie jak na posta? klikniesz to musisz w source przestawi?. Gdzie? to nie wiem, bo si? nie bawi? tam.
 
Odp: Ranga za fragi

tak jak napisalem wydaje mi sie ze w player.cpp musisz to dodac ale nie jestem pewny.


Napisane z telefonu htc.
 
Odp: Ranga za fragi

wydaje mi si? ze jest jaka? funkcja ze je?eli kliknie na sb to tez widzi to. Ale nie jestem pewny
 
Odp: Ranga za fragi

tu mam skrypt kt?ry wy?wietla po klikni?ciu na sb pr?bowa?em zmieni? tamten na podstawie tego ale nie chcia?o dzia?a?
[LUA]function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) == true) then
doPlayerSetSpecialDescription(thing.uid, ". "..(getPlayerSex(thing.uid) == 0 and "She has" or "He has").." "..getPlayerFrags(thing.uid).." frags")
elseif(isPlayer(thing.cid) == true) then
doPlayerSetSpecialDescription(thing.cid, ". You have "..getPlayerFrags(cid).." frags")
end
return true
end[/LUA]

---------- Tre?? dodana o 11:37 ----------

Zrobi?em trzeba by?o zmienic player.cpp jak mowilicie i przekompilowac
 
Status
Zamknięty.
Back
Do góry