0 Members and 2 Guests are viewing this topic.
procedure OnJoinGame(ID, Team: byte);beginSetWeaponActive(ID,0,false);SetWeaponActive(ID,1,false);SetWeaponActive(ID,2,false);SetWeaponActive(ID,3,false);SetWeaponActive(ID,4,false);SetWeaponActive(ID,5,false);SetWeaponActive(ID,6,false);SetWeaponActive(ID,7,false);SetWeaponActive(ID,8,false);SetWeaponActive(ID,9,false);SetWeaponActive(ID,10,false);SetWeaponActive(ID,14,false);SetWeaponActive(ID,15,false);SetWeaponActive(ID,16,false);end;procedure OnPlayerSpeak(ID: Byte; Text: string); beginif (Text='!soldier') then begin SetWeaponActive(ID,2,true); SetWeaponActive(ID,3,true); SetWeaponActive(ID,1,true); SetWeaponActive(ID,0,true); WriteConsole(ID, 'Youre now a Soldier !', $FF00FF00); if (Text='!sniper') then begin SetWeaponActive(ID,8,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,6,true); SetWeaponActive(ID,14,true); WriteConsole(ID, 'Youre now a Sniper !', $FF00FF00); if (Text='!destroyer') then begin SetWeaponActive(ID,7,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,10,true); SetWeaponActive(ID,0,true); SetWeaponActive(ID,8,true); SetWeaponActive(ID,5,true); WriteConsole(ID, 'Youre now a Destroyer !', $FF00FF00); if (Text='!medic') then begin SetWeaponActive(ID,6,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,14,true); SetWeaponActive(ID,5,true); SetWeaponActive(ID,9,true); WriteConsole(ID, 'Youre now a Medic !', $FF00FF00); if (Text='!credits') then begin WriteConsole(ID, 'Credits go to all people wgo helped me !', $FF00FF00); if (Text='!classes') then begin WriteConsole(ID, '!soldier (Able you to take MP5,AK47,EAGLE and SOCOM)', $FF00FF00); WriteConsole(ID, '!destroyer (Able you to take M79,spas,minigun,law and SOCOM)', $FF00FF00); WriteConsole(ID, '!sniper (Able you to take Barret,ruger,law and knife) ', $FF00FF00); WriteConsole(ID, '!medic (Able you to take Ruger,eagle,saw and knife)', $FF00FF00); WriteConsole(ID, 'Medic can also heal you if you stay next to him !', $FF00FF00); if (Text='!help') then begin WriteConsole(ID, '!classes (For a list of classes)', $FF00FF00); WriteConsole(ID, '!credits (For credits)', $FF00FF00); WriteConsole(ID, '!rules (for a list of rule)', $FF00FF00); WriteConsole(ID, '!news (For a list of the lastest new)', $FF00FF00); WriteConsole(ID, '!info (To see the server descriptions)', $FF00FF00); if (Text='!news') then begin WriteConsole(ID, 'There is no new now', $FF00FF00); if (Text='!rules') then begin WriteConsole(ID, '#############################RULES##########################################', $FF00FF00); WriteConsole(ID, '#No spamming. If an admin sees you doing it you will be banned for an hour.#', $FF00FF00); WriteConsole(ID, '#No hacking. If an admin sees you doing it you will be banned forever. #', $FF00FF00); WriteConsole(ID, '#No Pushing. #', $FF00FF00); WriteConsole(ID, '#No votekicking for no reasons . #', $FF00FF00); WriteConsole(ID, '#Do not ignore admins if they talk to you. #', $FF00FF00); WriteConsole(ID, '#No poly bugging. #', $FF00FF00); WriteConsole(ID, '#Respect admins and their decisions. #', $FF00FF00); WriteConsole(ID, '############################################################################', $FF00FF00); if (Text='!info') then begin WriteConsole(ID, 'This server is scripted!', $FF00FF00); WriteConsole(ID, 'You can chose about 4 classe', $FF00FF00); WriteConsole(ID, 'Type !classes to see these classes', $FF00FF00); end; end; end; end; end; end; end; end; end; end; const
function OnPlayerCommand(ID: byte; text: string): boolean;var i: integer; // define a counter-variable. Used for the FOR-loopbegin // This is a comment, it's skipped by the compiler... if GetPiece(text, ' ', 0) = '/nova' then begin // start looping at 2, repeat until reaches 15 for i:=2 to 15 do begin WriteConsole(id, 'BOOOM: ' + inttostr(i), $0000FF00); // do some other stuff... end; // our FOR loop's end WriteConsole(id, 'Mhmmm, flesh!', $0000FF00); // this will be called only ONCE end; // end of the IFend; // end of OnPlayerCommand
Procedure OnJoinGame(ID, Team: Byte); Var M: Byte; Begin For M := 0 To 16 Do SetWeaponActive(ID,M,False);end;Procedure OnPlayerSpeak(ID: Byte; Text: String); Var MM: Byte; Begin Text := LowerCase(Text); if Text = '!soldier' Then Begin For MM := 0 To 4 Do SetWeaponActive(ID,MM,True); end; if Text = '!sniper' Then Begin SetWeaponActive(ID,6,True); SetWeaponActive(ID,8,True); SetWeaponActive(ID,14,True); SetWeaponActive(ID,16,True);end;//Here you finish your Script, since you got the idea.//I didn't use a loop for "!sniper" because the weapon's numbers are not connected.//Ussocom, Eagles, MP5 and AK are 0,1,2,3,4, that's why the loop, instead of typing SetWeaponActive() four times.end;
Procedure DisableAll(ID: Byte);var ALL: Byte; begin for ALL := 1 to 14 do SetWeaponActive(ID,ALL,false); end;
Procedure OnJoinTeam(ID,Team:Byte); begin case Team of 1: begin DisableAll(ID); SetWeaponActive(ID,<WepID>, true); end; 2: ... 3: ... end; end;
Procedure OnJoinTeam(ID,Team:Byte); begin case Team of 1: begin DisableAll(ID); SetWeaponActive(ID,<WepID>, true); end; 2: ... 3: ... end; end;procedure OnPlayerSpeak(ID: Byte; Text: string); beginif (Text='!soldier') then begin SetWeaponActive(ID,2,true); SetWeaponActive(ID,3,true); SetWeaponActive(ID,1,true); SetWeaponActive(ID,0,true); WriteConsole(ID, 'Youre now a Soldier !', $FF00FF00); end; if (Text='!sniper') then begin SetWeaponActive(ID,8,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,6,true); SetWeaponActive(ID,14,true); WriteConsole(ID, 'Youre now a Sniper !', $FF00FF00); end; if (Text='!destroyer') then begin SetWeaponActive(ID,7,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,10,true); SetWeaponActive(ID,0,true); SetWeaponActive(ID,8,true); SetWeaponActive(ID,5,true); WriteConsole(ID, 'Youre now a Destroyer !', $FF00FF00); end; if (Text='!medic') then begin SetWeaponActive(ID,6,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,14,true); SetWeaponActive(ID,5,true); SetWeaponActive(ID,9,true); WriteConsole(ID, 'Youre now a Medic !', $FF00FF00); 4nd; if (Text='!credits') then begin WriteConsole(ID, '#################CREDITS##################', $FF00FF00); WriteConsole(ID, '#Credits go to Squiddy, Dark Crusade, #', $FF00FF00); WriteConsole(ID, '#LORD KILLA and swompie #', $FF00FF00); WriteConsole(ID, '##########################################', $FF00FF00);end; if (Text='!classes') then begin WriteConsole(ID, '########################CLASSES###############################', $FF00FF00); WriteConsole(ID, '#!destroyer (Able you to take M79,spas,minigun,law and SOCOM)#', $FF00FF00); WriteConsole(ID, '#!sniper (Able you to take Barret,ruger,law and knife) #', $FF00FF00); WriteConsole(ID, '#!medic (Able you to take Ruger,eagle,saw and knife) #', $FF00FF00); WriteConsole(ID, '#Medic can also heal you if you stay next to him ! #', $FF00FF00); WriteConsole(ID, '##############################################################', $FF00FF00);end;if (Text='!help') then begin WriteConsole(ID, '################COMMANDS################', $FF00FF00); WriteConsole(ID, '#!classes (For a list of classes) #', $FF00FF00); WriteConsole(ID, '#!credits (For credits) #', $FF00FF00); WriteConsole(ID, '#!rules (for a list of rule) #', $FF00FF00); WriteConsole(ID, '#!news (For a list of the lastest new) #', $FF00FF00); WriteConsole(ID, '#!info (To see the server descriptions)#', $FF00FF00); WriteConsole(ID, '########################################', $FF00FF00); end; if (Text='!news') then begin WriteConsole(ID, 'There is no new now', $FF00FF00); end; if (Text='!rules') then begin WriteConsole(ID, '#############################RULES##########################################', $FF00FF00); WriteConsole(ID, '#No spamming. If an admin sees you doing it you will be banned for an hour.#', $FF00FF00); WriteConsole(ID, '#No hacking. If an admin sees you doing it you will be banned forever. #', $FF00FF00); WriteConsole(ID, '#No Pushing. #', $FF00FF00); WriteConsole(ID, '#No votekicking for no reasons . #', $FF00FF00); WriteConsole(ID, '#Do not ignore admins if they talk to you. #', $FF00FF00); WriteConsole(ID, '#No poly bugging. #', $FF00FF00); WriteConsole(ID, '#Respect admins and their decisions. #', $FF00FF00); WriteConsole(ID, '############################################################################', $FF00FF00); end; if (Text='!info') then begin WriteConsole(ID, '###############INFO#################', $FF00FF00); WriteConsole(ID, '#This server is scripted! #', $FF00FF00); WriteConsole(ID, '#You can chose about 4 classe #', $FF00FF00); WriteConsole(ID, '#Type !classes to see these classes#', $FF00FF00); WriteConsole(ID, '####################################', $FF00FF00); end;end; Procedure DisableAll(ID: Byte);var ALL: Byte; begin for ALL := 1 to 14 do SetWeaponActive(ID,ALL,false); end;
Procedure DisableAll(ID: Byte);var ALL: Byte; begin for ALL := 1 to 14 do SetWeaponActive(ID,ALL,false); end;procedure OnPlayerSpeak(ID: Byte; Text: string); beginif (Text='!soldier') then begin SetWeaponActive(ID,2,true); SetWeaponActive(ID,3,true); SetWeaponActive(ID,1,true); SetWeaponActive(ID,0,true); WriteConsole(ID, 'Youre now a Soldier !', $FF00FF00); end; if (Text='!sniper') then begin SetWeaponActive(ID,8,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,6,true); SetWeaponActive(ID,14,true); WriteConsole(ID, 'Youre now a Sniper !', $FF00FF00); end; if (Text='!destroyer') then begin SetWeaponActive(ID,7,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,10,true); SetWeaponActive(ID,0,true); SetWeaponActive(ID,8,true); SetWeaponActive(ID,5,true); WriteConsole(ID, 'Youre now a Destroyer !', $FF00FF00); end; if (Text='!medic') then begin SetWeaponActive(ID,6,true); SetWeaponActive(ID,16,true); SetWeaponActive(ID,14,true); SetWeaponActive(ID,5,true); SetWeaponActive(ID,9,true); WriteConsole(ID, 'Youre now a Medic !', $FF00FF00); end; if (Text='!credits') then begin WriteConsole(ID, 'Credits go to all people who helped me !', $FF00FF00); end; if (Text='!classes') then begin WriteConsole(ID, '!soldier (MP5,AK47,EAGLE and SOCOM)', $FF00FF00); WriteConsole(ID, '!destroyer (M79,spas,minigun,law and SOCOM)', $FF00FF00); WriteConsole(ID, '!sniper (Barret,ruger,law and knife) ', $FF00FF00); WriteConsole(ID, '!medic (Ruger,eagle,saw and knife)', $FF00FF00); WriteConsole(ID, 'Medic can also heal you if you stay next to him !', $FF00FF00); end;if (Text='!help') then begin WriteConsole(ID, '!classes (For a list of classes)', $FF00FF00); WriteConsole(ID, '!credits (For credits)', $FF00FF00); WriteConsole(ID, '!rules (for a list of rule)', $FF00FF00); WriteConsole(ID, '!news (For a list of the lastest new)', $FF00FF00); WriteConsole(ID, '!info (To see the server descriptions)', $FF00FF00); end; if (Text='!news') then begin WriteConsole(ID, 'There is nothing new!', $FF00FF00); end; if (Text='!rules') then begin WriteConsole(ID, '#############################RULES##########################################', $FF00FF00); WriteConsole(ID, '#No spamming. If an admin sees you doing it you will be banned for an hour.#', $FF00FF00); WriteConsole(ID, '#No hacking. If an admin sees you doing it you will be banned forever. #', $FF00FF00); WriteConsole(ID, '#No Pushing. #', $FF00FF00); WriteConsole(ID, '#No votekicking for no reasons . #', $FF00FF00); WriteConsole(ID, '#Do not ignore admins if they talk to you. #', $FF00FF00); WriteConsole(ID, '#No poly bugging. #', $FF00FF00); WriteConsole(ID, '#Respect admins and their decisions. #', $FF00FF00); WriteConsole(ID, '############################################################################', $FF00FF00); end; if (Text='!info') then begin WriteConsole(ID, 'This server is scripted!', $FF00FF00); WriteConsole(ID, 'You can chose out of 4 classes', $FF00FF00); WriteConsole(ID, 'Type !classes to see all classes', $FF00FF00); end;end;
Procedure OnJoinTeam(ID,Team:Byte); begin case Team of begin DisableAll(ID); SetWeaponActive(ID,<WepID>, true); end; end; end;
11111111110000 This would enable all primarys and disable all secondaries.10001000001111 This would enable the weapons Desert Eagles, Spas and all secondaries.
// script by swompie for michconst DefaultWeapons = '01001000101111'; // The weapons a player gains when he joins by default (no class) // Colors cNews = $E88E88; // Used for !news and the welcome message cClasses = $FFFF00; // Used for !classes and the message when someone changes class cRules = $00FF00; // Used for !rules cHelp = $A77AFF; // Used for !help, !info and !creditsvar Weapons: Array [1..32] of string;procedure SetWeapons(ID: byte; WeaponSet: string);var i: byte;begin if Length(WeaponSet) <> 14 then Weapons[ID] := DefaultWeapons else Weapons[ID] := WeaponSet; for i := 1 to 14 do SetWeaponActive(ID, i, iif(Weapons[ID][i] = '1', true, false));end;procedure OnJoinTeam(ID, Team: byte);begin SetWeapons(ID, Weapons[ID]);end;procedure OnJoinGame(ID, Team: byte);begin WriteConsole(ID, 'This server has classes, type !classes to get a overview', cNews); DrawText(ID, 'This server has classes,' + #13#10 + 'type !classes to get a overview', 300, cNews, 0.1, 60, 140); SetWeapons(ID, DefaultWeapons);end;procedure OnPlayerSpeak(ID: Byte; Text: string);begin case LowerCase(Text) of '!soldier': begin SetWeapons(ID, '11100000001000'); WriteConsole(ID, 'You are now a soldier!', cClasses); end; '!sniper': begin SetWeapons(ID, '00000101000011'); WriteConsole(ID, 'You are now a sniper!', cClasses); end; '!destroyer': begin SetWeapons(ID, '00001001000011'); WriteConsole(ID, 'You are now a destroyer!', cClasses); end; '!medic': begin SetWeapons(ID, '00001100100011'); WriteConsole(ID, 'You are now a medic!', cClasses); end; '!classes': begin WriteConsole(ID, 'Classes:', cClasses - (cClasses div 9000)); WriteConsole(ID, 'Soldier (Desert Eagles, HK MP5, Ak74, Socom)', cClasses); WriteConsole(ID, 'Sniper (Ruger, Barret, Knife, LAW)', cClasses); WriteConsole(ID, 'Destroyer (Spas, M79, Barret, Minigun, Socom, LAW)', cClasses); WriteConsole(ID, 'Medic (Spas, Ruger, Minimi, Knife, LAW)', cClasses); WriteConsole(ID, ' ------------------------------------------------', cClasses - (cClasses div 9000)); WriteConsole(ID, ' Type !<classname> to change your class', cClasses); WriteConsole(ID, ' !soldier e.g. will change your class to soldier', cClasses); end; '!news': begin WriteConsole(ID, 'There are no news!', cNews); end; '!rules': begin WriteConsole(ID, 'Server rules:', cRules - (cRules div 9000)); WriteConsole(ID, 'No spamming. Leads to a one hour ban if ignored.', cRules); WriteConsole(ID, 'No hacking. Leads to a permament ban if ignored.', cRules); WriteConsole(ID, 'No pushing.', cRules); WriteConsole(ID, 'No votekicking without a good reason.', cRules); WriteConsole(ID, 'No poly bugging.', cRules); WriteConsole(ID, 'Do NOT ignore admins if they talk to you!', cRules); WriteConsole(ID, 'Respect admins and their decisions!', cRules); end; '!help', '!commands': begin WriteConsole(ID, 'Commands:', cHelp - (cHelp div 9000)); WriteConsole(ID, '!classes Displays list of classes and their weapons', cHelp); WriteConsole(ID, '!rules Displays server rules', cHelp); WriteConsole(ID, '!news Displays news', cHelp); WriteConsole(ID, '!info Displays info about the server', cHelp); WriteConsole(ID, '!credits Displays the credits ', cHelp); end; '!info': begin WriteConsole(ID, 'Server info:', cHelp - (cHelp div 9000)); WriteConsole(ID, 'This server is scripted, you can choose out of 4 Classes', cHelp); WriteConsole(ID, 'Each class has it''s own weapons', cHelp); end; '!credits': begin WriteConsole(ID, 'Credits:', cHelp - (cHelp div 9000)); WriteConsole(ID, 'Server hosted by mich.', cHelp); WriteConsole(ID, 'Script by Swompie for mich.', cHelp); WriteConsole(ID, 'Also thanks to Squiddy, Dark Crusade and Lord Killa aka A piece of code for help!', cHelp); end; end;end;
You can enable or disable weapons with the procedure SetWeapons(ID: byte; WeaponSet: string);I think you know what ID is there for. Now for the parameter WeaponSet.It tells the script which weapons a player should be able to use and which not.It needs to contain exact 14 chars.For example the first number is for the Desert Eagles, set it to 1 and the player can't use them, but when you set it to 0 he can use them.Here are some examples:Code: [Select]11111111110000 This would enable all primarys and disable all secondaries.10001000001111 This would enable the weapons Desert Eagles, Spas and all secondaries.
[Error] (63:1): Syntax error
// script by swompie for michconst DefaultWeapons = '10000000000011'; // The weapons a player gains when he joins by default (no class) // Colors cNews = $FF00FF00; // Used for !news and the welcome message cClasses = $FF00FF00; // Used for !classes and the message when someone changes class cRules = $FF00FF00; // Used for !rules cHelp = $FF00FF00; // Used for !help, !info and !creditsvar Weapons: Array [1..32] of string;procedure SetWeapons(ID: byte; WeaponSet: string);var i: byte;begin if Length(WeaponSet) <> 14 then Weapons[ID] := DefaultWeapons else Weapons[ID] := WeaponSet; for i := 1 to 14 do SetWeaponActive(ID, i, iif(Weapons[ID][i] = '1', true, false));end;procedure OnJoinTeam(ID, Team: byte);begin SetWeapons(ID, Weapons[ID]);end;procedure OnJoinGame(ID, Team: byte);begin WriteConsole(ID, 'This server has classes, type !classes to get a overview', cNews);DrawText(ID, 'This server has classes,' + #13#10 + 'type !classes to get a overview', 300, cNews, 0.1, 60, 140); SetWeapons(ID, DefaultWeapons);end;procedure OnPlayerSpeak(ID: Byte; Text: string);begin case LowerCase(Text) of '!soldier': begin SetWeapons(ID, '11100000001000'); WriteConsole(ID, 'You are now a soldier!', cClasses); end; '!sniper': begin SetWeapons(ID, '00000101000011'); WriteConsole(ID, 'You are now a sniper!', cClasses); end; '!destroyer': begin SetWeapons(ID, '00001001000011'); WriteConsole(ID, 'You are now a destroyer!', cClasses); end; '!medic': begin SetWeapons(ID, '00000100100011'); WriteConsole(ID, 'You are now a medic!', cClasses); end;if (Text='!credits') then begin WriteConsole(ID, '#################CREDITS##################', $FF00FF00); WriteConsole(ID, '#Credits go to Swompie, Dark Crusade, #', $FF00FF00); WriteConsole(ID, '#LORD KILLA and squiddy #', $FF00FF00); WriteConsole(ID, '##########################################', $FF00FF00);end; if (Text='!classes') then begin WriteConsole(ID, '########################CLASSES###############################', $FF00FF00); WriteConsole(ID, '#!destroyer (Able you to take M79,spas,minigun,law and SOCOM)#', $FF00FF00); WriteConsole(ID, '#!sniper (Able you to take Barret,ruger,law and knife) #', $FF00FF00); WriteConsole(ID, '#!medic (Able you to take Ruger,eagle,saw and knife) #', $FF00FF00); WriteConsole(ID, '#Medic can also heal you if you stay next to him ! #', $FF00FF00); WriteConsole(ID, '##############################################################', $FF00FF00);end;if (Text='!help') then begin WriteConsole(ID, '################COMMANDS################', $FF00FF00); WriteConsole(ID, '#!classes (For a list of classes) #', $FF00FF00); WriteConsole(ID, '#!credits (For credits) #', $FF00FF00); WriteConsole(ID, '#!rules (for a list of rule) #', $FF00FF00); WriteConsole(ID, '#!news (For a list of the lastest new) #', $FF00FF00); WriteConsole(ID, '#!info (To see the server descriptions)#', $FF00FF00); WriteConsole(ID, '########################################', $FF00FF00); end; if (Text='!news') then begin WriteConsole(ID, '#################NEW##################', $FF00FF00); WriteConsole(ID, '#There is no new now ! #', $FF00FF00); WriteConsole(ID, '######################################', $FF00FF00); end; if (Text='!rules') then begin WriteConsole(ID, '#############################RULES##########################################', $FF00FF00); WriteConsole(ID, '#No spamming. If an admin sees you doing it you will be banned for an hour.#', $FF00FF00); WriteConsole(ID, '#No hacking. If an admin sees you doing it you will be banned forever. #', $FF00FF00); WriteConsole(ID, '#No Pushing. #', $FF00FF00); WriteConsole(ID, '#No votekicking for no reasons . #', $FF00FF00); WriteConsole(ID, '#Do not ignore admins if they talk to you. #', $FF00FF00); WriteConsole(ID, '#No poly bugging. #', $FF00FF00); WriteConsole(ID, '#Respect admins and their decisions. #', $FF00FF00); WriteConsole(ID, '############################################################################', $FF00FF00); end; if (Text='!info') then begin WriteConsole(ID, '###############INFO#################', $FF00FF00); WriteConsole(ID, '#This server is scripted! #', $FF00FF00); WriteConsole(ID, '#You can chose about 4 classe #', $FF00FF00); WriteConsole(ID, '#Type !classes to see these classes#', $FF00FF00); WriteConsole(ID, '####################################', $FF00FF00); end; end; end;
'!credits': beginnotif (Text='!credits')
// script by swompie for michconst DefaultWeapons = '00000000001111'; // The weapons a player gains when he joins by default (no class) // Colors cNews = $E88E88; // Used for !news and the welcome message cClasses = $FFFF00; // Used for !classes and the message when someone changes class cRules = $00FF00; // Used for !rules cHelp = $A77AFF; // Used for !help, !info and !creditsvar Weapons: Array [1..32] of string;procedure SetWeapons(ID: byte; WeaponSet: string);var i: byte;begin if Length(WeaponSet) <> 14 then Weapons[ID] := DefaultWeapons else Weapons[ID] := WeaponSet; for i := 1 to 14 do SetWeaponActive(ID, i, iif(Weapons[ID][i] = '1', true, false));end;procedure OnJoinTeam(ID, Team: byte);begin SetWeapons(ID, Weapons[ID]);end;procedure OnJoinGame(ID, Team: byte);begin WriteConsole(ID, 'This server has classes, type !classes to get a overview', cNews); DrawText(ID, 'This server has classes,' + #13#10 + 'type !classes to get a overview', 300, cNews, 0.1, 60, 140); SetWeapons(ID, DefaultWeapons);end;procedure OnPlayerSpeak(ID: Byte; Text: string);begin case LowerCase(Text) of '!soldier': begin SetWeapons(ID, '11110000001000'); WriteConsole(ID, 'You are now a soldier!', cClasses); end; '!sniper': begin SetWeapons(ID, '00000101000011'); WriteConsole(ID, 'You are now a sniper!', cClasses); end; '!destroyer': begin SetWeapons(ID, '00001010001001'); WriteConsole(ID, 'You are now a destroyer!', cClasses); end; '!medic': begin SetWeapons(ID, '10000100100011'); WriteConsole(ID, 'You are now a medic!', cClasses); end; '!classes': begin WriteConsole(ID, 'Classes:', cClasses - (cClasses div 9000)); WriteConsole(ID, 'Soldier (Desert Eagles, HK MP5, Ak74, AUG,Socom)', cClasses); WriteConsole(ID, 'Sniper (Ruger, Barret, Knife, LAW)', cClasses); WriteConsole(ID, 'Destroyer (Spas, M79, Minigun, Socom, LAW)', cClasses); WriteConsole(ID, 'Medic (Eagle, Ruger, Minimi, Knife, LAW)', cClasses); WriteConsole(ID, ' ------------------------------------------------', cClasses - (cClasses div 9000)); WriteConsole(ID, ' Type !<classname> to change your class', cClasses); WriteConsole(ID, ' !soldier will change your class to soldier', cClasses); end; '!news': begin WriteConsole(ID, 'There are no news!', cNews); end; '!rules': begin WriteConsole(ID, 'Server rules:', cRules - (cRules div 9000)); WriteConsole(ID, 'No spamming. Leads to a one hour ban if ignored.', cRules); WriteConsole(ID, 'No hacking. Leads to a permament ban if ignored.', cRules); WriteConsole(ID, 'No pushing.', cRules); WriteConsole(ID, 'No votekicking without a good reason.', cRules); WriteConsole(ID, 'No poly bugging.', cRules); WriteConsole(ID, 'Do NOT ignore admins if they talk to you!', cRules); WriteConsole(ID, 'Respect admins and their decisions!', cRules); end; '!help', '!commands': begin WriteConsole(ID, 'Commands:', cHelp - (cHelp div 9000)); WriteConsole(ID, '!classes Displays list of classes and their weapons', cHelp); WriteConsole(ID, '!rules Displays server rules', cHelp); WriteConsole(ID, '!news Displays news', cHelp); WriteConsole(ID, '!info Displays info about the server', cHelp); WriteConsole(ID, '!credits Displays the credits ', cHelp); end; '!info': begin WriteConsole(ID, 'Server info:', cHelp - (cHelp div 9000)); WriteConsole(ID, 'This server is scripted, you can choose out of 4 Classes', cHelp); WriteConsole(ID, 'Each class has it''s own weapons', cHelp); end; '!credits': begin WriteConsole(ID, 'Credits:', cHelp - (cHelp div 9000)); WriteConsole(ID, 'Server hosted by mich.', cHelp); WriteConsole(ID, 'Script by Swompie for mich.', cHelp); WriteConsole(ID, 'Also thanks to Squiddy, Dark Crusade and Lord Killa aka A piece of code for help!', cHelp); end; end;end;
Watch your indentations. Those ain't nice (don't use tabs!).Should be correct ... really, watch your indentations or I'll be very upset
Why not use Tabs? I always use them, and they're the best. lol
{ I don't know.. My Scripts Are always Like this Instead Of Tabbing :)}