0 Members and 2 Guests are viewing this topic.
function OnPlayerCommand(ID: Byte; Text: string): boolean;begin//Spawner v1.5.1 by Braden if Text = '/commands1' then begin WriteConsole(ID,'Spawn Desert Eagles - /deagles',$EE00FFFF); WriteConsole(ID,'Spawn HK MP5 - /mp5',$EE00FFFF); WriteConsole(ID,'Spawn AK-74 - /ak74',$EE00FFFF); WriteConsole(ID,'Spawn Steyr AUG - /steyr',$EE00FFFF); WriteConsole(ID,'Spawn Spas-12 - /spas',$EE00FFFF); WriteConsole(ID,'Spawn Ruger 77 - /ruger',$EE00FFFF); WriteConsole(ID,'Spawn M79 - /m79',$EE00FFFF); WriteConsole(ID,'Spawn Barrett M82A1 - /barrett',$EE00FFFF); WriteConsole(ID,'Spawn FN Minimi - /minimi',$EE00FFFF); WriteConsole(ID,'Spawn XM214 Minigun - /minigun',$EE00FFFF); WriteConsole(ID,'Spawn USSOCOM - /socom',$EE00FFFF); WriteConsole(ID,'Spawn Combat Knife - /knife',$EE00FFFF); WriteConsole(ID,'Spawn Chainsaw - /saw',$EE00FFFF); WriteConsole(ID,'Spawn M72 LAW - /law',$EE00FFFF); WriteConsole(ID,'Spawn M2 Stationary Gun - /stat',$EE00FFFF); end; if Text = '/commands2' then begin WriteConsole(ID,'Spawn Medikit bonus - /med',$EE00FFFF); WriteConsole(ID,'Spawn Grenades bonus - /nades',$EE00FFFF); WriteConsole(ID,'Spawn Flame God bonus - /flame',$EE00FFFF); WriteConsole(ID,'Spawn Bulletproof Vest bonus - /vest',$EE00FFFF); WriteConsole(ID,'Spawn Predator bonus - /pred',$EE00FFFF); WriteConsole(ID,'Spawn Berserker bonus - /berserk',$EE00FFFF); WriteConsole(ID,'Spawn Cluster Grenades bonus - /cluster',$EE00FFFF); end; if Text = '/deagles' then begin SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),1); WriteConsole(0,'A command has been entered',$EEFF0000); WriteConsole(ID,'You have been given the Desert Eagles',$EE00FFFF); end; if Text = '/mp5' then begin SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),2); WriteConsole(0,'A command has been entered',$EEFF0000); WriteConsole(ID,'You have been given the HK MP5',$EE00FFFF);ETC. ETC. ETC. ETC. ETC.
procedure OnJoinGame(ID, Team: byte);beginWriteConsole(ID,'Spawner v1.5.1 by Braden',$EE0000FF);WriteConsole(ID,'/commands1 for Commands List Part 1 (weapon spawns)',$EE00FFFF);WriteConsole(ID,'/commands2 for Commands List Part 2 (bonus spawns)',$EE00FFFF);end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;var x, y: single;begin GetPlayerXY(ID, x, y); if GetPiece(Text, ' ', 0) = '/gimme' then case GetPiece(Text, ' ', 1) of 'deagles': SpawnObject(x, y, 1); 'mp5': SpawnObject(x, y, 2); 'ak': SpawnObject(x, y, 3); 'steyr': SpawnObject(x, y, 4); 'spas': SpawnObject(x, y, 5); 'ruger': SpawnObject(x, y, 6); 'm79': SpawnObject(x, y, 7); 'barrett': SpawnObject(x, y, 8); 'minimi': SpawnObject(x, y, 9); 'minigun': SpawnObject(x, y, 10); 'socom': SpawnObject(x, y, 11); 'knife': SpawnObject(x, y, 12); 'chainsaw': SpawnObject(x, y, 13); 'law': SpawnObject(x, y, 14); 'stat': SpawnObject(x, y, 15); 'med': SpawnObject(x, y, 16); 'nades': SpawnObject(x, y, 17); 'flamer': SpawnObject(x, y, 18); 'vest': SpawnObject(x, y, 19); 'pred': SpawnObject(x, y, 20); 'berserker': SpawnObject(x, y, 21); 'clusters': SpawnObject(x, y, 22); end; //NOTE: This function will be called when [_ANY_] player types a / command. Result := false; //Return true if you want disable the command typed.end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;var x, y: single; weap: byte;begin GetPlayerXY(ID, x, y); if GetPiece(Text, ' ', 0) = '/gimme' then begin case GetPiece(Text, ' ', 1) of 'deagles': weap := 1; 'mp5': weap := 2; 'ak': weap := 3; 'steyr': weap := 4; 'spas': weap := 5; 'ruger': weap := 6; 'm79': weap := 7; 'barrett': weap := 8; 'minimi': weap := 9; 'minigun': weap := 10; 'socom': weap := 11; 'knife': weap := 12; 'chainsaw': weap := 13; 'law': weap := 14; 'stat': weap := 15; 'med': weap := 16; 'nades': weap := 17; 'flamer': weap := 18; 'vest': weap := 19; 'pred': weap := 20; 'berserker': weap := 21; 'clusters': weap := 22 else weap := 0; end; if weap > 0 then SpawnObject(x, y, weap); end; //NOTE: This function will be called when [_ANY_] player types a / command. Result := false; //Return true if you want disable the command typed.end;
Nice Work!. Really Fantastic And a very nice and well made program.Keep it up!
Well, that will always spawn the object at player 1, not at the user... You might also wanna look into this.
QuoteWell, that will always spawn the object at player 1, not at the user... You might also wanna look into this.How do I make it spawn at the user?
but can you make a command with you can spawn all weapons and powerups?
Quote from: rumpel on March 14, 2008, 05:22:03 pmbut can you make a command with you can spawn all weapons and powerups?You can't spawn everything, so no.
var i: byte;begin//...if Text = '/gimme all' then begin for i := 1 to 22 do SpawnObject(GetPlayerStat(Id, 'X'), GetPlayerStat(Id, 'Y'), i);end;end;
Quote from: Boblekonvolutt on March 14, 2008, 06:32:20 pmQuote from: rumpel on March 14, 2008, 05:22:03 pmbut can you make a command with you can spawn all weapons and powerups?You can't spawn everything, so no.You goda loop through all possibilities, then spawn each one. Should be a really quick processCode: [Select]var i: byte;begin//...if Text = '/gimme all' then begin for i := 1 to 22 do SpawnObject(GetPlayerStat(Id, 'X'), GetPlayerStat(Id, 'Y'), i);end;end;