0 Members and 1 Guest are viewing this topic.
// -------------------------------------// | WARP and BUDDY CREATOR SCRIPT |// | by MFA |// -------------------------------------var buddyid: array[1..32] of integer; //buddyid[BUDDY_ID1], VALUE = BUDDY_ID2 buddy: array[1..32] of boolean; //buddy[ID] = true if have buddy, false if havent it buddyaccept: array[1..32] of integer; //buddyaccept[NEED_BUDDY_ID], VALUE = NEED_IT_BUDDY_ID temp: integer; //temp value procedure OnPlayerSpeak(ID: byte; Text: string); begin //WARP CREATOR if MaskCheck(Text,'!buddy *') then begin temp := strtoint(Copy(Text,8,length(Text))); //set temp to buddy value if (GetPlayerStat(temp,'Active') = true) then begin //if player ingame if (buddy[ID] = false) OR (buddy[temp] = false) then begin //if this player or you havent any other buddy buddyaccept[temp] := ID; //set buddyaccept[ID2] to ID1 WriteConsole(temp,IDToName(ID)+' needs to be your buddy!.',$EE81FAA1); //message to ID2 WriteConsole(temp,'Type !accept or !reject.',$EE81FAA1); //message to ID2 WriteConsole(ID,'Asking '+IDToName(temp)+' to be your buddy...',$EE81FAA1); //message to ID1 end else WriteConsole(ID,'You or He have another buddy.',$EE81FAA1); //message to ID1 end else WriteConsole(ID,'This player isnt ingame.',$EE81FAA1); //message to ID1 end; //ACCEPT BUDDY if (Text = '!accept') then begin if (buddyaccept[ID] <> 0) then begin //if player have any buddy proposition to accept WriteConsole(ID,IDToName(buddyaccept[ID])+' is now your buddy.',$EE81FAA1); //message to ID2 WriteConsole(ID,'Use !warp to teleport to he.',$EE81FAA1); //message to ID2 WriteConsole(buddyaccept[ID],IDToName(ID)+' is now your buddy.',$EE81FAA1); //message to ID1 WriteConsole(buddyaccept[ID],'Use !warp to teleport to he.',$EE81FAA1); //message to ID1 buddy[ID] := true; //buddy[ID2] := true buddyid[ID] := buddyaccept[ID]; //buddyid[ID2] := ID1 buddy[buddyaccept[ID]] := true; //buddy[ID1] := true buddyid[buddyaccept[ID]] := buddyid[ID]; //buddyid[ID1] := ID2 buddyaccept[buddyaccept[ID]] := 0; //buddy propositon ID2 := 0 buddyaccept[ID] := 0; //buddy propositon ID1 := 0 end else WriteConsole(ID,'You havent any buddy proposition.',$EE81FAA1); //message to ID2 end; //REJECT BUDDY if (Text = '!reject') then begin if (buddyaccept[ID] <> 0) then begin //if player have any buddy proposition to accept WriteConsole(ID,'Rejected.',$EE81FAA1); //message to ID2 WriteConsole(buddyaccept[ID],IDToName(ID)+' rejected your buddy proposition.',$EE81FAA1); //message to ID1 buddyaccept[buddyaccept[ID]] := 0; //Set buddyaccept ID2 to 0 buddyaccept[ID] := 0; //Set buddyaccept ID1 to 0 end else WriteConsole(ID,'You havent any buddy proposition.',$EE81FAA1); //message to ID2 end; //WARP if (Text = '!warp') then begin if (buddy[ID] = true) AND (buddyid[ID] <> 0) then begin //If you have buddy MovePlayer(ID, GetPlayerStat(buddyid[ID], 'X'), GetPlayerStat(buddyid[ID], 'Y')); WriteConsole(ID,'Warped.',$EE81FAA1); //message WriteConsole(buddyid[ID],'Your buddy warped to you.',$EE81FAA1); //message end else WriteConsole(ID,'You havent any buddy.',$EE81FAA1); //message end; //LEAVE if (Text = '!leave') then begin if (buddy[ID] = true) AND (buddyid[ID] <> 0) then begin //If you have buddy WriteConsole(ID,'Leave.',$EE81FAA1); //message WriteConsole(buddyid[ID],'Your buddy leave you.',$EE81FAA1); //message buddyid[buddyid[ID]] := 0; buddy[buddyid[ID]] := false; buddyid[ID] := 0; buddy[ID] := false; end else WriteConsole(ID,'You havent any buddy.',$EE81FAA1); //message end; //HELP if (Text = '!help') then begin WriteConsole(ID,'-----------------',$EE81FAA1); WriteConsole(ID,'WARP SCRIPT HELP:',$EE81FAA1); WriteConsole(ID,'!buddy ID - Ask ID to be your buddy',$EE81FAA1); WriteConsole(ID,'!accept - Accept buddy proposition',$EE81FAA1); WriteConsole(ID,'!reject - Reject buddy proposition',$EE81FAA1); WriteConsole(ID,'!warp - Teleport to your buddy',$EE81FAA1); WriteConsole(ID,'!leave - Leave your buddy',$EE81FAA1); WriteConsole(ID,' SCRIPT BY MFA ',$EE81FAA1); //PLEASE, DONT DELETE THIS LINE :( //PLEASE, IF YOU MODIFED SCRIPT LEAVE ORGINAL AUTHOR :( WriteConsole(ID,'-----------------',$EE81FAA1); end; end;
lol what.
Name it like Buddy Warper or such a thing.
Even though this script is a nice idea D; Isn't it on some climb server?