Jump to content

TiMz

Members
  • Posts

    192
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by TiMz

  1. Script only reads the if and not the else part. Which part is written badly?

    OnPCDieEvent:
    	getmapxy .@map$,.@x,.@y,0;
    		if ( getgroupid() > 3 || killedrid == getcharid(3)) end;
    		else (.@map$ == "arena") {
    		announce rid2name(killerrid)+" wins against "+strcharinfo(0)+" at pvp!",bc_all;
    		warp "prontera",155,180; end;
    
    		}	
    	end;
    }
    
  2. I have a special room which @hide a player if they enter as a watcher. Except I'm not sure how to "unhide" them using an exit NPC.

     

    I tried sc_end all but it doesn't seem to work. I also tried @hide to reverse the command which works, but now player who enters as non-watchers will be hidden as they exit the room.

     

    Any ideas?

  3. I tried doing it this way yet  @hide is still being counted.

    BUILDIN_FUNC(getmapusers)
    {
    	const char *str;
    	int m;
    	str=script_getstr(st,2);
    	if( (m=map_mapname2mapid(str))< 0){
    		script_pushint(st,-1);
    		return 0;
    	}
    	TBL_PC *sd, *pl_sd;
    	struct s_mapiterator* iter;
    	iter = mapit_getallusers();
    	for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
    	if (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_isinvisible(pl_sd))
    					continue; // skip hidden GMs (with !hide)
    
    	script_pushint(st,map[m].users);
    	return 0;
    }
    
  4. query_sql( "SELECT `name`,`guild_id`,`position` FROM `guild_member` where guild_id = 100 LIMIT 5",.@Name$,.@gid,.@position );
    mes "[ Fruit Clan ]";
    mes " ";
    for( set .@a,0; .@a < getarraysize(.@name$); set .@a,.@a + 1)
    if(.@position[.@] == 0) mes "Apple";
    else if(.@position[.@] == 1) mes "Orange";
    mes " "+.@name$[.@a]+ " | " +.@position[.@a]+" | ";
    mes " ";
    close;
    }
    

    @sandbox It doesn't appear to work.

  5. Using SQL entries I instead of numbers appearing in-game I would like the value 0 appear as apple, 1 appear as grapes, 2 appear as watermelon etc etc.

    mes "[ " +.@position[.@a]+" ]");     <<< This will appear as a number in-game from the guild position table. How to attach a word to the corresponding number.
    mes " ";
    close;
    }
    
  6. Hello. Can someone help me make an NPC that will show a list of all member names of guild_id==100? Just a simple npc with just that.

     

    Thank you!

     

     

    Hoping it will look something like this.

     

    [Poring Guild]    //which is guild_id 100

    Members:

    Aba

    Baba

    Caba

  7. I would please like to request a modified version of this script which would split up the option to choose which MvP would give points(which is already present in the script) and an option to choose what MvP kill would be announced.

     

    Like for example:

     

    Point list: Baphomet, Eddga

    Announce list: Eddga only

     

    Player kills: baphomet> player receives points> no announcement

    Player kills: Eddga> player receives points> announce at whole server

    -	script Rank MvP	-1,{
    OnInit: // Script Configuration
    setarray .mobid[0],1511,1647,1785,1630,1399,1039,1874,2068,1272,1719,1046,1389,1112,1115,1957,1418,1871,1252,1768,1086,1688,1646,
    1373,1147,1059,1150,1956,2022,1087,1190,1038,1157,1159,1502,1623,1650,1583,1708,1312,1751,1685,1648,1917,1658; // MvP Ids
    set .a, 0; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On]
    set $@top, 5; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables)
    end;
     
    OnNPCKillEvent: // Script execution
    for (set .@c, 0; .@c < getarraysize(.mobid); set .@c, .@c + 1)
    if (killedrid == .mobid[.@c])
    set .@s, 1; // If a MvP
    if (!.@s) end;
    if (.a) // If announce On
    announce "The user [" +strcharinfo(0) +"] has killed a [" +getmonsterinfo(killedrid,0) +"] in the map [" +strcharinfo(3) +"]",bc_blue|bc_all;
    set MvP, MvP + 1;
    callfunc ("MvPRank",MvP,strcharinfo(0));
    end;
    } // End Script
    

    Thank you.

  8. I'm using pre-re and a SHR server. Having all stats above 99, it seems that the success rate of the skill has been messed up. It keeps failing against players but works on mobs. Is there a way to make the skill work 100% instead just like increase agi?

  9. This is the only version of the script that actually works with my svn so please bear with me. So it seems to work with no problem except that it still gives points when vending+autotrade mode.

     

    -	script	hourlypoints	-1,{
    
    //--Start of the Script
    OnPCLoginEvent:
    	attachnpctimer ""+strcharinfo(0)+"";
    	initnpctimer;
    	end;
    
    OnTimer60000:
    	set @minute, @minute + 1;
    	if(@minute == 20){
    	set @minute,0;
    	set .@point_amt, 2; //Points to get every hour (default: 10)
    	if(checkvending() >= 1) {
    	dispbottom "The hourly points event haulted because you were vending.";
    	stopnpctimer;
    	end;
    }
    	else {
    	set #CASHPOINTS, #CASHPOINTS + .@point_amt;
    	dispbottom "You received "+.@point_amt+" cash points for staying in-game.";
    	dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
    	set @consecutive_hour, @consecutive_hour + 1;
    }
    }
    	if(@consecutive_hour == 3) {
    	set @consecutive_hour,0;
    	set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50)
    	set #CASHPOINTS, #CASHPOINTS + .@cpoint_amt;
    	dispbottom "You received "+.@cpoint_amt+" bonus cash points for playing for 1 hour.";
    	dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
    }
    	stopnpctimer;
    	initnpctimer;
    	end;
    
    }
    //--End of the Script
    

     

×
×
  • Create New...