Jump to content
  • 0

no mount allowed when equiped andCoins NPC


donkeyg

Question


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

no mount allowed when equiped *REQUEST*


and a NPC that gives 100 coin to every account ( Same IP address cannot get).

 

Link to comment
Share on other sites

18 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  


prontera,150,150,0 script Test 123,{

setarray .671,100; // Rewards: <item id>,<item amount>

query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);

if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0)

{

mes .@n$;

mes "I'm sorry, the rewards are exclusively for new players.";

close;

}

mes .@n$;

mes "Welcome! Here are some free gifts";

mes "for newcomers:";

for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )

mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]);

close2;

set #NewbieGift, 1;

setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;

for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )

getitem .@rwd[.@i], .@rwd[.@i+1];

end;

}

Link to comment
Share on other sites


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

// alter table `login` add column `newbie` tinyint(3) unsigned not null default '0', add index (`newbie`);
prontera,150,150,0	script	Test	123,{

	query_sql "select `last_ip`, `newbie` from `login` where `last_ip` in (SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) +") having `newbie` = max(`newbie`) limit 1", .@last_ip$, .@tmp;
	if ( .@tmp ) {
		mes "I'm sorry, the rewards are exclusively for new players.";
		close;
	}
	mes "Welcome! Here are some free gifts"; 
	mes "for newcomers:";

	for ( set .@i, 0; .@i < getarraysize(.reward); set .@i, .@i + 2 )
		mes .reward[.@i+1] + " x " + getitemname(.reward[.@i]);

	close2;
	for ( set .@i, 0; .@i < getarraysize(.reward); set .@i, .@i + 2 )
		getitem .reward[.@i], .reward[.@i+1];
	query_sql "update `login` set `newbie` = 1 WHERE `last_ip`= '" + .@last_ip$ + "'";
	end;

OnInit:
	setarray .reward, 671,100; // Rewards: <item id>,<item amount>
	.size = getarraysize( .reward );
}

 

nb.

setarray .671,100; // Rewards: <item id>,<item amount>

was wrong :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

// alter table `login` add column `newbie` tinyint(3) unsigned not null default '0', add index (`newbie`);
prontera,150,150,0	script	Test	123,{

	query_sql "select `last_ip`, `newbie` from `login` where `last_ip` in (SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) +") having `newbie` = max(`newbie`) limit 1", .@last_ip$, .@tmp;
	if ( .@tmp ) {
		mes "I'm sorry, the rewards are exclusively for new players.";
		close;
	}
	mes "Welcome! Here are some free gifts"; 
	mes "for newcomers:";

	for ( set .@i, 0; .@i < getarraysize(.reward); set .@i, .@i + 2 )
		mes .reward[.@i+1] + " x " + getitemname(.reward[.@i]);

	close2;
	for ( set .@i, 0; .@i < getarraysize(.reward); set .@i, .@i + 2 )
		getitem .reward[.@i], .reward[.@i+1];
	query_sql "update `login` set `newbie` = 1 WHERE `last_ip`= '" + .@last_ip$ + "'";
	end;

OnInit:
	setarray .reward, 671,100; // Rewards: <item id>,<item amount>
	.size = getarraysize( .reward );
}

 

nb.

setarray .671,100; // Rewards: <item id>,<item amount>

was wrong :P

 

 

so,, which 1 shud i use? urs or Anakid's?

Link to comment
Share on other sites


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

Anakid's script have some error.. but make your choice

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

Anakid's script have some error.. but make your choice

 

 

NPC couldn't loaded... please help..

im using ur script..

Link to comment
Share on other sites


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

Change

.size = getarraysize( .reward );

into

set .size, getarraysize( .reward );

 

 

Don't forget to load in mysql

// alter table `login` add column `newbie` tinyint(3) unsigned not null default '0', add index (`newbie`);
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

Change

.size = getarraysize( .reward );

into

set .size, getarraysize( .reward );

 

 

Don't forget to load in mysql

// alter table `login` add column `newbie` tinyint(3) unsigned not null default '0', add index (`newbie`);

 

 

yeah did it, still couldnot be loaded=.="

 

heres's my script

 

 


izlude,128,213,3    script    Anniversary Coins    123,{


    query_sql "select `last_ip`, `newbie` from `login` where `last_ip` in (SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) +") having `newbie` = max(`newbie`) limit 1", .@last_ip$, .@tmp;
    if ( .@tmp ) {
        mes "I'm sorry, the rewards are exclusively for new players.";
        close;
    }
    mes "Welcome! Here are some free gifts"; 
    mes "for newcomers:";


    for ( set .@i, 0; .@i < getarraysize(.reward); set .@i, .@i + 2 )
        mes .reward[.@i+1] + " x " + getitemname(.reward[.@i]);


    close2;
    for ( set .@i, 0; .@i < getarraysize(.reward); set .@i, .@i + 2 )
        getitem .reward[.@i], .reward[.@i+1];
    query_sql "update `login` set `newbie` = 1 WHERE `last_ip`= '" + .@last_ip$ + "'";
    end;


OnInit:
    setarray .reward, 18158,100; // Rewards: <item id>,<item amount>
    set .size, getarraysize( .reward );
}
 

 

Edited by donkeyg
Link to comment
Share on other sites


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

I don't have any errors except for the <tab> in the header. Show your error on mapserv.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

I don't have any errors except for the <tab> in the header. Show your error on mapserv.

 

ok, now i got this problem

 

 
[Debug]: at script.c:14504 - select `last_ip`, `newbie` from `login` where `last_ip` in (SELECT `last_ip` FROM `login` WHERE `account_id`=2001316) having `newbie` = max(`newbie`) limit 1
[Debug]: Source (NPC): Anniversary Coins at izlude (128,213)
: DB error - Unknown column 'newbie' in 'field list'
[Debug]: at script.c:14504 - update `login` set `newbie` = 1 WHERE `last_ip`= ''
[Debug]: Source (NPC): Anniversary Coins at izlude (128,213)

 

and i can take the coin always everytime i talk to the npc with using the same char..

help me pls..

 

im sure i had installed the SQL in my database,,

Edited by donkeyg
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

bump...

Link to comment
Share on other sites


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

: DB error - Unknown column 'newbie' in 'field list'

 

im sure i had installed the SQL in my database,,

Not me.. reload the sql table

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

: DB error - Unknown column 'newbie' in 'field list'

 

/>

>im sure i had installed the SQL in my database,,

Not me.. reload the sql table

 

 

how to reload sql table? is it restat server? or recompile server

 

sorry if asking a stupid question

Edited by donkeyg
Link to comment
Share on other sites


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

I mean re try to load the alter sql

alter table `login` add column `newbie` tinyint(3) unsigned not null default '0', add index (`newbie`);
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

I mean re try to load the alter sql

alter table `login` add column `newbie` tinyint(3) unsigned not null default '0', add index (`newbie`);

 

Error

SQL query:

ALTER TABLE `login` ADD COLUMN `newbie` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0',

ADD INDEX ( `newbie` )

MySQL said: b_help.png

#1060 - Duplicate column name 'newbie'

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

/swt maybe you load the script twice.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

/swt maybe you load the script twice.

how to delete 1 of them?

please help me..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

Make sure you do back up before manipulating your database so it will not be hard if any error will occur in the future. Execute this query then do what Capuche have said. or maybe you can try first the script made by Capuche it might work now.

ALTER TABLE login DROP COLUMN newbie
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.07
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

Make sure you do back up before manipulating your database so it will not be hard if any error will occur in the future. Execute this query then do what Capuche have said. or maybe you can try first the script made by Capuche it might work now.

ALTER TABLE login DROP COLUMN newbie

 

 

deleted and re-put it also same.... errors....

so i changed my mind to anakid's script...

but what i found is...

http://rathena.org/board/topic/83953-free-coins-to-every-players-1-ip-get-1-time-urgent/?p=205643

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...