Sample1 = first request
Sample2 = second request
Sample3 = third request
Didn't test though ( /me lazy ). Just a side note i just copy the function of
@KeyWorld here (
http://rathena.org/board/topic/66255-party-checker-job/?p=118481 ) so credits to him. If any error occur post it.
prontera,150,150,0 script Sample1 100,{ getinventorylist; query_sql "SELECT `nameid` FROM `storage` WHERE `account_id` = '" +getcharid(3)+ "'", .@names; if ( ( BaseClass == Job_Novice ) && ( BaseLevel == 1 ) && ( Zeny > 1000000 ) && ( @inventorylist_count == 0 ) && ( !.@names ) ) { for ( .@i = 1; .@i < 15; .@i++ ) { if ( getequipid(.@i) == -1 ) { mes "Where you want to warp?"; next; input .@map$; Zeny -= 1000000; warp .@map$,0,0; close; } } }}prontera,153,153,0 script Sample2 100,{ for ( .@i = 1; .@i < 15; .@i++ ) { if ( getequipid(.@i) == -1 ) { getinventorylist; for ( set .@a, 0; .@a < @inventorylist_count; .@a++ ) { delitem @inventorylist_id[.@a], @inventorylist_amount[.@a]; } jobchange Job_Novice; BaseLevel = 1; JobLevel = 1; savepoint "prontera",150,150; end; } }}prontera,156,156,0 script Sample3 100,{ if ( getcharid(2) ) { if ( callfunc("party_has_duplicate_job") ) { mes "It seems that someone in the party has the same class than another member. Please check again the requirements..."; close; } getmapxy .@map$, .@x, .@y, 0; savepoint .@map$, .@x, .@y; end; }}function script party_has_duplicate_job{ set .@party_id, getarg( 0, getcharid(1) ); // Need to have a party. if ( .@party_id != 1 ) { return -1; } // Loading party members variables getpartymember getcharid(1),1; getpartymember getcharid(1),2; // Keep rid attached. set .@rid, playerattached(); // Check all members for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 ) { // Online user if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) ) { // Attach the member to access "Class" attachrid( $@partymemberaid[.@i] ); if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + Class; } // Offline user (use sql) else { set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) "`char_id`='" + $@partymembercid[.@i] + "' "; set .@sql_i, .@sql_i + 1; } } // SQL for offline users if ( getstrlen(.@sql$) ) { // get class from offline members set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class ); // Check the class. for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 ) { if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i]; } } // Restore RID. if ( .@rid ) attachrid(.@rid); else detachrid; return 0;}