Jump to content

PandaLovesHamster

Members
  • Posts

    452
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by PandaLovesHamster

  1. 	set .soundef_number, .soundef_number + 1;
     
    	switch (.soundef_number)
    	{
     
    		case 1:
    		soundeffect "hollen2.wav",0;
    		break;
     
    		case 2:
    		soundeffect "hollen3.wav",0;
    		break;
     
    		case 3:
    		soundeffect "hollen4.wav",0;
    		break;
     
    		case 4:
    		soundeffect "hollen5.wav",0;
    		break;
     
    	}
     
    	if (.soundef_number >= 3)
    	{
    		set .soundef_number, 0;
    	}
    

    Try removing those from the script itself and see if it still crashes.

    • Upvote 1
  2. I wouldn't recommend it if you have many players. It will be very memory intensive if you have many players.

    Just check itemnoequp on db folder, don't remember the exact name.

  3. //Script by Normynator v1.1
    //Modified by Panda 
    prontera,146,163,4	script	Event Representative	113,{
    
    function EndEvent;
    
        if(getgmlevel() >= 99){
            .@s = select("Start:Stop:Set Reward:Cancel");
            if(.@s == 1){
    			mes "[ ^83cfe9Representative^000000 ]";
    				if(.config_done < 1){ mes "Please set your rewards and number of winners first."; close; }
    			mes "Event has been started.";
    			close2;
    			set $giveaway, 0;
    			set .start, 1;
    			announce "[Event Representative]: [GM] "+strcharinfo(0)+" has started a Give Away Event!",0;
    			sleep2 10000;
    			announce "[Event Representative]: Number of Winners - "+.winner+" - ",0;
    			end;
            }
    		else if(.@s == 2){
    			if(.start < 1){ mes "No event to stop."; close; }
    			mes "[ ^83cfe9Representative^000000 ]";
                mes "You have cancelled the event.";
                set $giveaway, 1000;
                EndEvent;
                close;
            }
    		else if(.@s == 3){
                mes "[ ^83cfe9Representative^000000 ]";
    			mes "What reward do you want to give to the players?";
    			input .Rew_Item;
    			set .item,.Rew_Item;
    			if ( getiteminfo( .item, 0 ) == -1 ) {
    					next;
    					mes "[ ^83cfe9Representative^000000 ]";
    					mes "Invalid Item ID";
    					close;
    			}
    			next;
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes "Do you want to reward them "+getitemname(.Rew_Item)+"?";
    			menu "Yes",-;
    			next;
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes "How many items will the player get?";
    			input .Rew_Amt;
    			set .amount,.Rew_Amt;
    				if(.amount < 1){
    					next;
    					mes "[ ^83cfe9Representative^000000 ]";
    					mes "Quantity can not be lesser than 1.";
    					close;
    				}
    			next;
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes "Are you sure with "+.Rew_Amt+" items?";
    			menu "Yes",-;
    			next;
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes "Quantity has been set.";
    			next;
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes "How many players do you want to win?";
    			input .Rew_Win;
    			set .winner,.Rew_Win;
    				if(.winner < 1){
    					next;
    					mes "[ ^83cfe9Representative^000000 ]";
    					mes "Winners can not be lesser than 1.";
    					close;
    				}
    			next;
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes .winner+" winners will be able to win.";
    			set .config_done,1;
    			close;
            }else{
    			end;
    		}
    		
        }
    	if(.start < 1){ mes "[Representative]"; mes "No events are running."; close; }
    	if (#AlreadyGot){
    			mes "[ ^83cfe9Representative^000000 ]";
    			mes "I have ^FF0000"+.@left + "^000000 items left.";
                mes "You already got your item.";
                close;
            }
        if($giveaway >= .winner){
    	mes "[ ^83cfe9Representative^000000 ]";
            mes "I'm sorry, all items have been claimed.";
            close;
        }
    	else{
    		mes "[ ^83cfe9Representative^000000 ]";
    		set .@left, .winner - $giveaway;
            mes "Hi";
            mes "I have ^FF0000"+.@left + "^000000 items left.";
    		next;
            set #AlreadyGot, 1;
    		mes "[ ^83cfe9Representative^000000 ]";
            mes "Congratulations for making it.";
    
    		getitem .Rew_Item, .Rew_Amt;
    		announce strcharinfo(0)+" redeemed one of the "+.@left+" Event Items!",0;
    
            set $giveaway, $giveaway + 1;
            if($giveaway == .winner){
                EndEvent;
            }
            close;
        }
    OnInit:
    	waitingroom "Event Representative",0;
    	set .start, 0;
    	end;
    
    EndEvent:
            announce "All Event Items have been redeemed.",0;
            query_sql "DELETE FROM `main`.`acc_reg_num` WHERE `key`='#AlreadyGot'"; //update this line
    	set .start,0;
        end;
    }
    

    Just change the query line if you have a different database structure. Let me know if something doesn't work.

    • Upvote 1
  4. Add these few lines, not tested but should probably work.
     

    OnPCKillEvent:
    	for(set .@i,0; .@i < getarraysize(.map$); .@i++){
    		if(strcharinfo(3) != .map$) end;
    	}
    	
    OnInit:
    	setarray .map$,"pvp_y_8-2","payon","prontera","alberta";
    end;
    
×
×
  • Create New...