What's new

Skrypty & Kody Frag Counter i CC za Fraga

Status
Not open for further replies.

belox

Active User
Joined
Feb 21, 2011
Messages
141
Reaction score
2
Witam.

Jak w temacie szukam czegos albo jakiegos skryptu ktory liczy Fragi!!!

Kilkasz na Gracza "Look" i wyswietla ile ma ktos fragow.

I za kazdego fraga dostaje sie 2 cc !

Thx.
 

belox

Active User
Joined
Feb 21, 2011
Messages
141
Reaction score
2
Odp: Frag Counter i CC za Fraga

Moze ktos pomoze ;>???
 

thel gilius

Advanced User
Joined
Apr 6, 2008
Messages
203
Reaction score
2
Odp: Frag Counter i CC za Fraga

napisz jaki silnik i czy masz w nim wgrane creatureevents bo tak niewiadomo czy wymaga to c++ czy xml aka lua.
 

kubixox

Active User
Joined
Dec 15, 2008
Messages
129
Reaction score
6
Odp: Frag Counter i CC za Fraga

Sam szukam skryptu na liczenie frag?w, jak znajdziesz to wy?lij na PW. Co do drugiego to spr?buj:

Code:
#ifdef _BBK_DO_ON_KILL_
Player *attackerp = dynamic_cast<Player*>(attacker);
Player *attackedm = dynamic_cast<Player*>(attackedCreature);
if(attackerp && attackedm){
            PositionEx pos;
            Item *newitem = Item::CreateItem([COLOR="red"]2160,100[/COLOR]);
         if(!attackerp->addItem(newitem)){
			//add item on the ground
			game->addThing(NULL,attackerp->pos,newitem);
			Tile *tile = game->map->getTile(newitem->pos);
			if(tile){
				pos.stackpos = tile->getThingStackPos(newitem);
			}
			else{
				pos.stackpos = 1;
			}
		}
}
#endif //_BBK_DO_ON_KILL_

Na czerwono ustawiasz id itemka jaki gracz ma dosta? a po przecinku ilo?? tego itema.
 

belox

Active User
Joined
Feb 21, 2011
Messages
141
Reaction score
2
Odp: Frag Counter i CC za Fraga

Hmm a gdzie to dac ??? Global Action czy jak xD??

P.S

Reput dla cb :>
 

zygzagZ

Advanced User
Joined
Aug 14, 2008
Messages
281
Reaction score
34
Odp: Frag Counter i CC za Fraga

W creaturescripts:
Code:
function onKill(cid, target)
  if isPlayer(cid) == 1 and isPlayer(target) == 1 then
    if getPlayerSkullType(target) == SKULL_NONE then
      doPlayerAddItem(cid,5785,2)
      setPlayerStorageValue(cid, 98721, getPlayerStorageValue(cid, 98721) + 1)
      doPlayerSetSpecialDescription(cid, (getPlayerSex(cid) == 0 and ".\nShe" or ".\nHe") .. " has " .. getPlayerStorageValue(cid, 98721) .. " frags.")
    end
  end
  return 1
end
 
Last edited:

belox

Active User
Joined
Feb 21, 2011
Messages
141
Reaction score
2
Odp: Frag Counter i CC za Fraga

A gdzie jest CreatureScripts bo ja nie mam .. TO 8.1!!
 

zygzagZ

Advanced User
Joined
Aug 14, 2008
Messages
281
Reaction score
34
Odp: Frag Counter i CC za Fraga

Przepraszam ?e si? nie domy?li?em!
W takim razie tylko source.
 

belox

Active User
Joined
Feb 21, 2011
Messages
141
Reaction score
2
Odp: Frag Counter i CC za Fraga

Wiec co mam zrobic ???

Dobra zmienilem silnik na SQL i mam to ale tam mam zrobic nowy plik lua np frag ? frag.lua i potem w scripts dac sciezke ??
 
Last edited:

zygzagZ

Advanced User
Joined
Aug 14, 2008
Messages
281
Reaction score
34
Odp: Frag Counter i CC za Fraga

Tak, nowy plik lua, tam wklejasz to co napisa?em, potem w creaturescripts.xml dodaj:
Code:
<event type="kill" name="FragCounter" event="script" value="frag.lua"/>
Potem w login.lua pod:
Code:
registerCreatureEvent(cid, "GuildMotd")
dodaj:
Code:
registerCreatureEvent(cid, "FragCounter")
 
Status
Not open for further replies.
Top