0 Members and 1 Guest are viewing this topic.
//code has NOT been tested!constMaxPlayers = 18 //Maximum number of players on the server, including admins/botstype // here goes:CapitalInfo = Record //We call our type CapitalInfo. This is a 'record' that has other variables in it: cash : int; weapon : Array[1..10] of Boolean //these represent the 10 primary weapons //maybe some other booleans for stuff like a vest to be handed out after respawnend;varPlayer = Array[1..MaxPlayers] of CapitalInfo; //here you make an array of CapitalInfo called Player[]
if (Player[ID].cash >= Amount) then dec(Player[ID].cash, Amount) else WriteConsole(ID, "Not enough cash", someColor);
var Cash: array[1..32] of integer;
function OnPlayerCommand(ID: Byte; Text: string): boolean;beginif Text = '/help' then beginWriteConsole(ID,'/mp5 : $300: A fast and lethal weapon.',RGB(200,255,200));WriteConsole(ID,'/barrett : $600: One Hit Kill but slow reload.',RGB(200,255,200));WriteConsole(ID,'/m79 : $800: Explosive and very deadly.',RGB(200,255,200));end;if Text = '/mp5' then beginif Cash[ID] > 299 then begindec(Cash[ID,300);WriteConsole(ID,'You bought a mp5!',RGB(200,255,200));ForceWeapon(ID,2,GetPlayerStat(ID,'Primary),0);end else WriteConsole(ID,'Not enough Cash!',RGB(200,255,200));end;//etc..end;
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);begininc(Cash[Killer],random(0,20) + 60);WriteConsole(Killer,'Cash: $' + inttostr(Cash[Killer]),RGB(200,255,200));end;
procedure OnJoinGame(ID, Team: byte);beginCash[ID] := 100;end;