0 Members and 2 Guests are viewing this topic.
onchangeteam?
OnVoteEnd(): boolean;
Events:OnKickVoteCast(voter,victim: byte; reason: string);OnMapVoteCast(voter: byte; mapname: string);function OnVoteEnd(): boolean;result:=true makes the vote have no effect
procedure OnVoteKickCast(Voter, Victim: byte; Reason: string):boolean;begin Result:=true //return false to continue with kick/map vote *custom vote stuff* if *time var* = 0 and *vote var* = # then KickPlayer(Victim); else *wutever*end;
function OnCommand(ID:Byte;Text:string):boolean;begin *blah blah blah* if StringExists(GetPiece(Text, ' ', 2)) then *do this* else *do this* *blah blah blah*end;
Functions:I woke up this morning thinking about this one.GetPlayerStat(#,'Stance'): byte;When standing, result is 0; when crouching, result is 1; when proning (sp?), result is 2; or whatever you wish it to be if this is implemented.GetPlayerStat(#,'Time'): integer;I suggest having it tell the time in seconds. I think showing this in seconds would be much more helpful to people than minutes. Same with the GetObjectStat for Time, if that is going to be implemented.Global variable thingy muh-bobberPause...0 = not paused1 = paused
maybe there should be a:function GetServerStat(IP: string; Port: integer; Stat: string);so you can check:Quote from: possible new functionStats:Name - string ----- Server nameMap - string ----- Current map playingconnection - integer ----- 0 for LAN, 1 for internetPlayers - integer ----- Current playersMaxp - integer ----- max playersGpass - string ----- Game password, not admin passAPass - string ----- Returns asterics (*) for each letter in pass, doesn't return actual pass (maybe return pass if safe mode off?)Passworded - boolean ----- password needed?ClanMatch - boolean ----- clan match enabled?Greet1, Greet2, Greet3 - string ----- Greeting messagesBalance - boolean ----- balance teams?maxvote - single ----- vote percentminping - integer ----- minimum ping limitmaxping - integer ----- maximum ping limitDedicated - boolean ----- Dedicated server?Lobby - string ----- lobby registered in (ip or http string)Respawn - single ----- respawn timebonuses - string ----- bonuses allowed (string in 5 parts (F P B V C) inactive(0) or active(1))freq - integer ----- bonus frequency (1 to 5)bots - integer ----- number of botsFFire - boolean ----- friendly fire?loop - boolean ----- loop maps?style - integer ----- game mode (same as const's in default script "core")weapons - string ----- active weaps (same format as bonuses but 14 parts (DD HK AK SA SZ RG 79 BT MM MG US CK CS 72) 0 or 1)nades - integer ----- max nadeslimit - integer ----- score limitstatgun - boolean ----- stat guns?RSA - string ----- (same as weaps and bonuses, 3 parts (R S A) 0 or 1)Aamt - integer ----- Advance mode amountand anything else you can find server-side in soldat.ini and server.ini
Stats:Name - string ----- Server nameMap - string ----- Current map playingconnection - integer ----- 0 for LAN, 1 for internetPlayers - integer ----- Current playersMaxp - integer ----- max playersGpass - string ----- Game password, not admin passAPass - string ----- Returns asterics (*) for each letter in pass, doesn't return actual pass (maybe return pass if safe mode off?)Passworded - boolean ----- password needed?ClanMatch - boolean ----- clan match enabled?Greet1, Greet2, Greet3 - string ----- Greeting messagesBalance - boolean ----- balance teams?maxvote - single ----- vote percentminping - integer ----- minimum ping limitmaxping - integer ----- maximum ping limitDedicated - boolean ----- Dedicated server?Lobby - string ----- lobby registered in (ip or http string)Respawn - single ----- respawn timebonuses - string ----- bonuses allowed (string in 5 parts (F P B V C) inactive(0) or active(1))freq - integer ----- bonus frequency (1 to 5)bots - integer ----- number of botsFFire - boolean ----- friendly fire?loop - boolean ----- loop maps?style - integer ----- game mode (same as const's in default script "core")weapons - string ----- active weaps (same format as bonuses but 14 parts (DD HK AK SA SZ RG 79 BT MM MG US CK CS 72) 0 or 1)nades - integer ----- max nadeslimit - integer ----- score limitstatgun - boolean ----- stat guns?RSA - string ----- (same as weaps and bonuses, 3 parts (R S A) 0 or 1)Aamt - integer ----- Advance mode amount
A function to get Unix Time (number of seconds elapsed since 1970).
function GetTimeSeconds(): single;var arr: TStringArray; hours, minutes, seconds, milliseconds: integer;begin arr := xsplit(FormatDate('h:n:s:z'), ':'); hours := StrToInt(arr[0]); minutes := StrToInt(arr[1]); seconds := StrToInt(arr[2]); milliseconds := StrToInt(arr[3]); Result := hours * 3600.0 + minutes * 60.0 + seconds + milliseconds/1000.0;end;function GetSecondsInterval(seconds1, seconds2: single): single;begin if seconds2 < seconds1 then seconds2 := seconds2 + 24 * 3600.0; Result := seconds2 - seconds1;end;
function StringExists(str:string):boolean;
if StrPos('lala', str) > 0 then OhYeah();
NOTE: If you change a variable, this function will not set it! This just refreshes the Syntax Example:
GetPlayerStat(ID, 'Admin') - boolean, returns true if player is admin
var Admin: array[1..32] of boolean;function OnPlayerCommand(ID:Byte;Text:string):boolean;var Temp1, Temp2, Temp3: string;begin Result:=false; Temp1:=GetPiece(LowerCase(Text), ' ', 0); Temp2:=GetPiece(Text, ' ', 1); Temp3:=ReadINI('soldat.ini','NETWORK','Admin_Password',' '); if (Temp1 = '/adminlog') then begin if (Temp2 = Temp3) then begin Admin[ID]:=true; if (Tries[ID] > 0) then Tries[ID]:=0; end; if ((Temp2 = Temp3) = false) then begin if (Tries[ID] = 0) then begin Result:=true; DrawText(ID,'Tries: 3',200,$FFFFFFFF,0.50,30,190); SayToPlayer(ID,'Password incorrect, try correct case.'); Tries[ID]:=Tries[ID]+1; exit; end; if (Tries[ID] = 1) then begin Result:=true; DrawText(ID,'Tries: 2',200,$FFFFFF20,0.50,30,190); SayToPlayer(ID,'Password incorrect, are you spelling it right?.'); Tries[ID]:=Tries[ID]+1; exit; end; if (Tries[ID] = 2) then begin Result:=true; DrawText(ID,'Tries: 1',200,$FFFF8020,0.50,30,190); SayToPlayer(ID,'Password incorrect, one more incorrect try and you will be kicked.'); Tries[ID]:=Tries[ID]+1; exit; end; if (Tries[ID] = 3) then begin DrawText(ID,'Tries: 0',200,$FFFF2020,0.50,30,190); SayToPlayer(ID,'Password incorrect, apparently you do not have the password and will be kicked.'); Sleep(90); KickPlayer(ID); end; end; end;end;procedure OnJoinGame(ID, Team: byte);begin Admin[ID]:=false; if (Tries[ID] > 0) then Tries[ID]:=0;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin if Admin[ID] then Admin[ID]:=false; if (Tries[ID] > 0) then Tries[ID]:=0;end;
This function will return some information about the specified player (ID).
Sigh.... too many lazy nub suggestions.Eg: Get current maplist = ReadFile('mapslist.txt');
Quote from: EnEsCe on October 04, 2007, 10:32:38 pmSigh.... too many lazy nub suggestions.Eg: Get current maplist = ReadFile('mapslist.txt');I mean it is the filename of the maplist the server is using at that moment (or any)
I mean it is the filename of the maplist the server is using at that moment (or any)