Make /gmuted players still call the OnPlayerSpeak event.Plus a way to find out that a player is gmuted, like GetPlayerStat(ID, 'Gmuted')
Function OnVoteKick(ID: byte, Reason: string):boolean;
begin
result := true //let the vote go through
result := false //nullify the vote, player will not be kicked even if enough players press f12
end;
LockPlayer(ID: byte; Lock: boolean);You can already do that.
LockPlayer(ID: byte; Lock: boolean);You can already do that.
- "Script Packages" may be sent to the Client containing some WAV files that the server can then command the client to play. More types of files will be added gradually.
LockPlayer(ID: byte; Lock: boolean);You can already do that.
How can I? LockPlayer doesn't work. :(
SetGravity(ID: byte, Gforce: Double); ID to zero for all players, ofc.
GetPlayerStat(ID, 'Gravity'); //would then return a double
then you could pretty much freeze a player in mid air btw...function OnPlayerSpeak(const Id: byte; var Text: string): boolean;
begin
Result := false;
if Text[1] = '!' then begin
Result := true;
//do stuff
exit;
end;
Text := StrReplace(Text, 'feck', '!@#$');
end;
xmRipper, possibly it's word filter..Nah. That will not work.
procedure BulletTime(blabla: boolean);(or a server command, and then Command('/whatever 1/0')
function isInPoly(X,Y: single): boolean;
var Dist: single;
begin
Result := iif(RayCast(X,Y,X,Y,Dist,1), false, true);
end;
putplayericon(ID,"/downloads/medic.png",Teamviewonly=true/false)
can be very usefull for scripts with classes
Hotkey(ID,Number: byte)
Hey enesce,yes yes yes yes yes yes add that!!!
Here's a very personnel request of mine for the upcoming server / client versions:
Add the function to the number keys (1-9 & 0) on the keyboard that when you press them, a special command is sent to the server you're playing on.
These commands would have the only effect of triggering a scriptingcore event on the server like:Code: [Select]Hotkey(ID,Number: byte)
This would make total game modifications like Hexer, MMod or Tactical Trenchwars get rid off having to use taunts for fast special ability usage.
Thus, such mods would be way easier to get into for beginners that don't really know yet how to bind taunts or are too lazy to bind them exclusively for that mod.
Thanks for considering ;D
ciao, ava
GetPlayerStat(ID, 'Admin');
OnVoteKick(Voter, Target: byte; Reason: string): boolean;
OnVoteMap(Voter: byte; MapName: string): boolean;
WriteLn(GetPiece(MyString,' ',0)); //Hello
etc...
procedure RespawnFlag(TeamFlag: byte)
thanks, that rly helpedprocedure RespawnFlag(TeamFlag: byte)
http://forums.soldat.pl/index.php?topic=22216.0
OnBulletFire(ID,Weapon,VelocityX,VelocityY);Think about how often that would be called in a 16 vs 16 deathmatch where everyone is using miniguns.
its self-explainable
Function OnPlayerShoot (ID, Weapon: Byte): Boolean;
begin
Result := false; // false: Discard bullet (dont create it), true: Create it
end;
Function GetCursorPosition (ID: Byte; X: Boolean): Single;
begin
if X = true then Result := {get cursor position code here(X)} else Result := {get cursor position code here(Y)};
end;
I'd also like SetPlayerVelocity(ID: byte, VelX, VelY: Single)SetPlayerStat(ID, 'VelX', x)
function GetKeyPress(ID: byte; Key: string):boolean
Parameter Info:
ID (Byte): Player ID to get the key press of.
Key (String): See Description for more information.
Description:
This function will return true/false if a player is holding down the specified key.
Key Result
Left Left key
Right Right key
Up Jump/Up Key
Down Crouch/Down key
Shoot Attack button
Jetpack Jetpack button
Grenade Grenade button
Changewep Change weapon button
Throw Throw Weapon button
Reload Reload Button
Crouch Crouch/Down key
Prone Prone key (will stay TRUE while proned)
It's not an event.Quotefunction GetKeyPress(ID: byte; Key: string):boolean
Parameter Info:
ID (Byte): Player ID to get the key press of.
Key (String): See Description for more information.
Description:
This function will return true/false if a player is holding down the specified key.
Key Result
Left Left key
Right Right key
Up Jump/Up Key
Down Crouch/Down key
Shoot Attack button
Jetpack Jetpack button
Grenade Grenade button
Changewep Change weapon button
Throw Throw Weapon button
Reload Reload Button
Crouch Crouch/Down key
Prone Prone key (will stay TRUE while proned)
It's not an event.
Quotefunction GetKeyPress(ID: byte; Key: string):boolean
Parameter Info:
ID (Byte): Player ID to get the key press of.
Key (String): See Description for more information.
Description:
This function will return true/false if a player is holding down the specified key.
Key Result
Left Left key
Right Right key
Up Jump/Up Key
Down Crouch/Down key
Shoot Attack button
Jetpack Jetpack button
Grenade Grenade button
Changewep Change weapon button
Throw Throw Weapon button
Reload Reload Button
Crouch Crouch/Down key
Prone Prone key (will stay TRUE while proned)
Ability to only allow CrossFunc to access certain functions from specific scripts using scripting somehow.It's not possible?
Not each specified number but each second, and if you use mod() function you can set it like mod(ticks) BUT the ticks musst be = xy*60.Enesce said in his blog that calling a procedure too much is causing access violations...
There should be an procedure that would call something every xy ticks.
AppOnIdle(Ticks: integer);
var
i: integer;
begin
for i := 1 to 32
if GetPlayerStat(i, primary) = 1 then
repeat
if GetPlayerStat(i, ammo) = 0 then WriteConsole(i,'LOL, NO BULLETS',$EE81FAA1);
until GetPlayerStat(i, ammo) > 0
end;
Ill describe it to you this way:Server will freeze... Or AppOnIdle is called in another thread?
Make a script like thisCode: [Select]AppOnIdle(Ticks: integer);
var
i: integer;
begin
for i := 1 to 32
if GetPlayerStat(i, primary) = 1 then
repeat
if GetPlayerStat(i, ammo) = 0 then WriteConsole(i,'LOL, NO BULLETS',$EE81FAA1);
until GetPlayerStat(i, ammo) > 0
end;
Enjoy it.
Not a access violation though, but it is the same effect.
function GetWaypointStat(ID: byte; stat: string): varient;
Stats:
active: boolean
x: singe
y: single
team: byte
style: byte (like 0=right 1=left 2=up 3=down 5=jet and such, its the combined result of all)
links: array of byte (all the other waypoints ID is linked to)
getplayerstat(ID,'curwaypoint'): byte;
procedure DoHeal(ID: Byte; HealPoints: Integer)
Yes I know you can do negative damage with dodamage but I have one problem with it because it also 'heals' the bulletproof vest which makes the vest way to powerful when using a regeneration script.
an extra argument like armorpiercing : boolean on dodamage would be fine for me to
Parameter Weapon:string in function OnPlayerDamage :)at least bulletstyle, pretty pleeeeeeeeeeeeeeeeeeease
Why bulletstyle? Hk, Minimi... have all plain bullet :DM79 is likely not to...
procedure DoHeal(ID: Byte; HealPoints: Integer)I guess that I could do this for ya.
Function OnplayerBonus(ID,BonusType);
If BonusType = 1 then begin
customBonus(ID);
result := false;
end
else begin
result := true;
end;
end;
spawnCustomBonus(PosX,PosY,CustombonusIDtype,"\downloads\mytext.bmp")
and
OnplayerCustomBonus(ID : byte ;BonusType : byte) : boolean;
Instead of adding this, I think, if possible, he should add a way to spawn custom pictures.I hope new scripting core will support this.
Instead of adding this, I think, if possible, he should add a way to spawn custom pictures.I hope new scripting core will support this.
(...extra map features to provide exciting new gameplay elements, vastly improved interface customization via server-side scripting, truckloads of new Script Core features...)
Also, changing playing movement speed is much needed.
P.S. Ilikelove your new avatar, raya :D
*cough* *cough* (http://enesce.com/help/html/Functions/BotChat.html)So true.
Resolution is kind off useless, isnt it?No! For example, a script of rpg with a skill of flash. I use a big drawtext for cover the display of players. This go work with players of low resolution.
GetPlayerStat(ID,'Deaths') := *NUMBER GOES HERE*This cause syntax error of Identifier expected. GetPlayerStat go return deaths and flags caps of player, can't change them.
For setting how much caps would the player have? I think it is possible via GetPlayerStat(ID,'Flags') := *NUMBER GOES HERE*
Resolution is kind off useless, isnt it?No! For example, a script of rpg with a skill of flash. I use a big drawtext for cover the display of players. This go work with players of low resolution.
But for players with hight resolution. Go cover only a small area of screen.
I could set the correct size of drawtext using the player resolution.GetPlayerStat(ID,'Deaths') := *NUMBER GOES HERE*This cause syntax error of Identifier expected. GetPlayerStat go return deaths and flags caps of player, can't change them.
For setting how much caps would the player have? I think it is possible via GetPlayerStat(ID,'Flags') := *NUMBER GOES HERE*
Compare GetPlayerStat(ID,'Kills') with SetScore(ID, kills).
http://enesce.com/help/html/Functions/SetScore.html (http://enesce.com/help/html/Functions/SetScore.html)
I have a script where I want to align (Draw)text to the weapons in the weapon selection menu but for that to work on custom resolution I would have to know the resolution so I can scale the text down.
croat1gamer says:You see, if everyone starts using it, they will use it on paid servers, and it will be obviously a nuisance as it will slow down the whole computer, including the other servers.
Why dont you want to add such an option to the scriptcore, but simply make it “USE AT OWN RISK”
Its not like that scripters dont know what to do with it, what can it cause, and what to do to prevent server slowing down.
EnEsCe says:
Because you know everybody will use it, and it will become an extreme nuisance to hosts that run many servers such as myself. And then there is the slew of access violations it causes.
What about making 2 versions of soldatserver?It sounds perfectly fine to me, as its like the ReadLnSocket, it needs Safe Mode turned off to work. And to do it the players just need to do -safe 0 to disable Safe Mode, but in my suggestion, there wont be the option of disabling it, but they need to use the server version which is having it disabled already.
One which will be the “safe mode”, which will internally have the faster appondile disabled, which will be given to the server hosters, but if they want, they can use the not “safe mode” one, which will be the real soldatserver, with everything enabled.
procedure OnDataArrival(ID: Byte, Type,Data: String)
begin
if (Type = 'PlayerSpeak') then // recognize the type of data
begin
if (Data = 'spam') then // set what we want to intercept
begin
Command('/gmute ' + ID); // action accordingly
StopHere // important, stops running the following event: OnPlayerSpeak()
else Resume // if it arrives is not what we want to intercept, continues with the next event: OnPlayerSpeak()
end;
end;
end;
draw text layers has already been implemented. What comes to world/interface text you should not expect them anytime soon as they both seem to require netcode changes which i'd rather not touch... yet.
procedure dec(var X: integer; N: integer);
procedure inc (var X: integer; N: integer);
From: player[i].mine[ii].tleft:=player[i].mine[ii].tleft-1;
To: dec(player[i].mine[ii].tleft,1);
You can increment :
Characters
Non-floating number types
Enumeration types
Pointers
procedure servermodifier(name:string; id:byte; value:variant);
servermodifier('gravity',3,0.03); // Only player 3 is affected.
servermodifier('gravity',255,0.03); // The entire server is affected.
procedure changeweaponstats(id,weaponid:byte; dmg,interval,ammo,reload,style,startup,bink,movacc,recoil:integer);
// ID = 255 changes the weapon for everyone.
procedure writeini(filename,section,key:string; value:variant);
function weaponnumbyname(name:string):byte;
a:=weaponnumbyname('Steyr AUG'); // a = 4;
procedure movebot(id:byte; x,y:single);
a:=function addbot(id:byte; x,y:single):byte; // a = bot's ID
function IDToHWID(ID: integer): string
function HWIDToID(HWID: string): string;
function NameToHWID(Name: string): string;
function HWIDToName(HWID: string): string;
function IPToHWID(Name: string): string;
function HWIDToIP(HWID: string): string;
Script.AddFunction(@NameToHW, 'function NameToHW(A: string): string');
Script.AddFunction(@IDToHW, 'function IDToHW(Id: Byte): string');
... or a plugin for Notepad++ including Soldat's scriptcore.
procedure createFolder(name:string);
function folderExists(name:string):boolean;
procedure activateserver();
begin
if (fileexists('maps/')) or (fileexists('maps\')) then writeln(' * EXISTS') else writeln(' * DOES NOT EXIST');
end;
procedure deleteFile(name:string);
procedure moveFile(name,newdir:string);
procedure onjointeam(id,team:byte); -> function onjointeam(id,team:byte:boolean;
onjointeam() = true = allowed to join the team
global var highestID -> holds the highest present ID on the server.
Please learn english instead of using google translate because i cannot understand you.
function getplayerstat(id,'muted'):byte // Change result to boolean
function getplayerIDs():array of byte;
var i:byte; len:integer;
begin
for i := 1 to 32 do if getplayerstat(i,'active') = true then begin
inc(len,1);
setarraylength(result,len);
result[len-1] := i;
end;
end;
procedure onUnitCollision(id1,id2:byte);
Stat | Result | Type |
Owner | ID of a player who created the object (like thrown knife, dropped weapon, etc) or 255 for flags, kits, etc. | Byte |
This one has probably been suggested before, but I want this badly:Code: [Select]procedure onUnitCollision(id1,id2:byte);
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte; HeadShot: boolean);
Procedure OnRoundEnd (ID: byte; zespołu: integer);
there's OnGameEnd already(). You can check who won by comparing team's score with max score.Isn't it the same?
function oncommand(id:byte; text:string):boolean
begin
if text = '/recompile' then freeAll();
result := false;
end;
Not possible, server never recieves such info. The best info i can give you is aim angle.
Just a reminder - we still need OnAdminCommand and OnTCPAdminCommand in SC3.Yes, since we got SC3 (almost 1 year ago) only a few critical bugfixes were made over this time.
procedure ServerModifier(Name: String; Value:Variant);
procedure ServerModifier(Name: String; Value:Variant);
works in any moment of the game?Movebot(ID:Byte; X,Y:Single) and SpawnBot(Name:String; X,Y:Single) would be quite awesome, because it would save the usual routine of moving spawn points around. :)
Pls modify:
OnDamage(Shooter, Victim: TActivePlayer; Damage: Integer; Bullet: TActiveMapBullet): Integer;
to
OnDamage(Shooter, Victim: TActivePlayer; Damage: Integer; Bullet: TActiveMapBullet, HeadShot: Boolean): Integer;
- Add: ReadKey instead of GetKeyPress.This will be a realy cool, if we can use more keys instead text command.
That's a lot of work, plus i'd only confuse new players. Scriptcore is supposed to be an addition (more or less), not an integral part of Soldat.