Hi, I want to make a guild package npc. Here's a code. I just want to have an expert to look at my code.
What I wanted support is how can I have an security so that it will not be abuse.
Sorry for my english.
PS:
The code is not yet done.
The code here is just a edited version of guild pack giver of ShogS.
Code based layout credited to ShogS.
// Script Name: Guild Package NPC Giver
// Developer: Seventhief
// Description: Nulled
// Version: 0.1
//
prontera,145,171,1 script Guild Pack Giver 757,{
if(##Gpack == 0) goto L_AG;
mes "-- Guild Package Giver --";
mes "Looks like you're on guild";
next;
mes "- Sudden disconnection of guildsmen";
mes " will not be given a consideration";
mes "- I am only obligated to give packages";
mes " to guild with 10 members or more"
next;
mes "- This only a one time";
next;
switch(select("Yes:No")) {
case 1:
query_sql("SELECT `guild_id` FROM `guild_member` WHERE `char_id` = "+getcharid(0)+" AND `account_id` = "+getcharid(3)+"", .@gIDgiver);
set .@nofoM, query_sql("SELECT `account_id`, `position` FROM `guild_member` WHERE `guild_id` = "+.@gIDgiver+" AND `online` = 1", .@aIDgiver, .@posgiver);
if ( .@nofoM >= 9 ) { // Guild members incl. Master must be 10 or more
for(set .@i,0; .@i < .@nofoM; .@i++) {
if ( .@posgiver[.@i] == 0 ) {
// Give Item for Guild Master
getitem 512,20,.@aIDgiver[.@i];
}
if ( .@posgiver[.@i] != 0 ) {
// Give Item for Guild Members
getitem 512,1,.@aIDgiver[.@i];
}
} // End For
set ##Gpack, 0;
warpguild "prontera",157,157,.@gIDgiver;
close;
}
case 2:
mes "Nevermind";
close;
}end; // End Switch
L_AG:
mes "Given";
close;
} // End Main