0 Members and 1 Guest are viewing this topic.
var Freezed:array[1..32] of boolean;procedure HideAllWeps(ID:byte);var i:integer;begin for i:=1 to 14 do SetWeaponActive(ID,i,false);end;procedure Freeze(ID:byte);var X,Y:single;begin GetPlayerXY(ID,X,Y); Command('/setteam'+inttostr(GetPlayerStat(ID,'team'))+' '+inttostr(ID)); HideAllWeps(ID); MovePlayer(ID,X,Y); Freezed[ID] := true;end;procedure Unfreeze(ID:byte);var i:integer;begin for i:=0 to 14 do SetWeaponActive(ID,i,true) Freezed[ID] := false;end;function OnCommand(ID: Byte; Text: string): boolean;begin case GetPiece(Text,' ',0) of '/freeze': begin Freeze(strtoint(GetPiece(Text,' ',1))); WriteConsole(ID,GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'name')+' was frozen!', $8FD2C4); end '/unfreeze': begin UnFreeze(strtoint(GetPiece(Text,' ',1))); WriteConsole(ID,GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'name')+' was frozen!', $8FD2C4); end endend;procedure OnJoinTeam(ID, Team: byte);begin if Freezed[ID] then begin HideAllWeps(ID); endend;procedure OnLeaveGame(ID, Team: byte;Kicked: boolean);begin Freezed[ID] := false;end;
Thanks for this script. I think it will be funny to anoy my friends with it ^_^btw offtopic: wan't a CommandBy('command', ID) function in the next soldat server script core
(...)'/unfreeze':beginUnFreeze(strtoint(GetPiece(Text,' ',1)));WriteConsole(ID,GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'name')+' was UNFROZEN!', $8FD2C4);end