Jump to content
  • 0

Problem with player attach


pxxpw123

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/15/13
  • Last Seen:  

Hi guys, first sorry for my bad english i'll try explain with most clean way i can.

Well i'm having trouble with players attach  what i need is give some item to all players in the map.
 

Here what i get after some search:

            set(.player,getcharid(3));
            deletearray(.players[0],128); addrid(0);
            set(.players[getarraysize(.players)],getcharid(3));
            detachrid; attachrid(.player);
            if (.player == $mapabombporing$ ) {
                announce "Parabéns"+ strcharinfo(0) +", Você ganhou o evento!!! :D",3, 0x_FFFF00;
                sleep2 2000;
                getitem(512,1,set(.@a,.players[rand(getarraysize(.players))]));
                announce "Já recebeu seu prêmio agora TCHAU! :P",3;
                sleep2 3000;
                warp "prontera",150,150;
                goto OnInit;
            }

Here is my error:

59ebbeda20.png

 

OnInit i have:

set $mapabombporing$, "prontera";

_________________________________________________________________________________

This npc is my new game center and live in prontera thats why i use, this part of script will give some prize to all winners of Bomb poring event.

 

if i need give more information please ask :)
thx guys!

Edited by pxxpw123
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

I don't see anything wrong related with your error, please show the part before

set(.player,getcharid(3));

However some mistakes

if (.player == $mapabombporing$ ) {

.player return the account id of the player attached while $mapabombporing$ return a string, the map

 

 

some item to all players in the map.

getitem(512,1,set(.@a,.players[rand(getarraysize(.players))]));

Your script give actually one item to 1 random player in your server (not only on the map, see addrid doc)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/15/13
  • Last Seen:  

Hi Capuche, thx for help.

i do some changes here all new event prize part:

 

Premio_Auto_Event:

	switch( $eventocheck ) {
		case 1: //--------> Evento_Um
		case 2: //--------> Evento_Dois
		case 3: //--------> Evento_Tres
			set(.player,getcharid(3));
			deletearray(.players[0],128); addrid(0);
			set(.players[getarraysize(.players)],getcharid(3));
			detachrid; attachrid(.player);
			if (strcharinfo(3) == $mapabombporing$ ) {
				announce "Parabéns"+ strcharinfo(0) +", Você ganhou o evento!!! :D",3, 0x_FFFF00;
				sleep2 2000;
				getitem $premioevento, $qntpremioevento;
				announce "Já recebeu seu prêmio agora TCHAU! :P",3;
				sleep2 3000;
				warp "prontera",150,150;
				goto OnInit;
			}
		case 4: //--------> Evento_Quatro
			
	}

the error still the same on server.
 

Here a screenshot of NPC Script Editor (i don't know if i can post a large image, if i can't sorry. ):

 

2c679b5ed3.png

@Edit:

I have finished add bomb poring to my script but i'm having the same problem without this code.

here is my full script atm:

http://pastebin.com/r3jScRcu

 

Thx Sir!

Edited by pxxpw123
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...