Jump to content
  • 0

no mount allowed when equiped andCoins NPC


Question

18 answers to this question

Recommended Posts

Posted


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;

}

Posted
// 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

Posted
// 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?

Posted

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`);
Posted (edited)

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
Posted (edited)

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
Posted (edited)

: 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
Posted

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'

Posted

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
Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...