0 Members and 4 Guests are viewing this topic.
Go "if Winner Then", instead of "if Winner = True". Same thing for "Leader[Victim] = True". Go "if Leader[Victim] Then"..
About the Script, I don't understand quite what you're asking.
[...]1. Basically, I'm not sure when I shouldn't have semicolons in the middle of if then else statements.2. I want to know how to combine some text and a string variable into one string, for example the variable VTeam[Killer] and the text 'wins!'3. Can I end the game by setting TimeLeft to 0?
[...] if VTeam[Killer] = 'Blablabla' Then WriteConsole(Killer,'Wins!',$FFFFFF);
const White = $FFFFFF;Procedure OnPlayerSpeak(ID:Byte; Text:String);var Disable:Boolean; begin WriteConsole(ID,'Text1' + ' Text2', White); // Will display the text "Text1 Text2" WriteConsole(ID,IDToName(ID) + '''s name is cool!', White); // Displays "<XXX>'s name is cool!" ('' = ' in text') if LowerCase(Text) = '!disable' then begin Disable := not Disable; WriteConsole(ID,'Script got ' + iif(Disable=true,'enabled','disabled') + '.', White); end; end;
Just go for[...]
Code: (pascal) [Select] WriteConsole(ID,IDToName(ID) +'''s name is cool!', White);
WriteConsole(ID,IDToName(ID) +'''s name is cool!', White);
Wow, just noticed what I did. Thanks DC.Although, I'm still curious.Why do you have '''s name ...', instead of 's name ...' ?:O
WriteConsole(ID,'Script got ' + iif(Disable,'dis','en') + 'abled.', White);
1 - You just don't use ";" after:If,Else,Begin,Then,Try,Except,Const,Type,Var.You DO use ";" after ")", and everything else.
3 - To end the game, just go "Command('/nextmap');
Just go for[...]Last text will display "Script got enabled." if Disable is true and "Script got disabled." when it's false.
-A way to tell who is on your team (have your clothes change to look the same as your leader? have people on your team emit flames?)
You can create an interface that shows you the people on your team. I attached something you can work with.
for I := 1 to 32 do [...]
for I := 1 to 32 do // Start the loop if GetPlayerStat(I,'Active') = true then // Check ID AllDraw(I)
Type XXX = Record Team: Byte;end; var Player: Array[1..32] of XXX;
<ArrayName>[<ID>].<Variable> // Note the dot!