0 Members and 1 Guest are viewing this topic.
var WNUM, PNUM: string;function OnCommand(ID:Byte;Text:string):boolean;begin if Copy(lowercase(Text), 1, 7) = '/spawn ' then begin try WNUM := GetPiece(Text, ' ', 2) PNUM := GetPiece(Text, ' ', 3) if (WNUM = (GetObjectStat(ID,Type))) then begin if GetPlayerStat(strtoint(PNUM), 'active') = true then begin SpawnObject(GetPlayerStat(PNUM,'x'),GetPlayerStat(PNUM,'y'),WNUM); end; end; end;end;
CreateBullet(GetPlayerStat(1,'x'), GetPlayerStat(1,'y'), 0, 0,100, 4, 1);
CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 0,100, 4, ID);
var antispam: integer;procedure AppOnIdle(Ticks: integer);begin If antispam > 0 then antispam:=antispam-1;end;procedure OnPlayerSpeak(ID: byte; Text: string);begin if (Text = '!sacrifice') and (antispam = 0) then begin CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y'), -50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y'), 50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 75, 0, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') - 75, -50, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') + 75, 50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') + 75, 0, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') + 75, -50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') - 75, 50, -50,100, 4, 1); DoDamage(ID,4444); antispam:=Insert here how many seconds you want to prevent !sacrifice after it was used; end;end;
var antispam: integer;procedure AppOnIdle(Ticks: integer);begin if (Text = '!Heal') and (antispam = 0) then begin antispam:=antispam-1;end;procedure OnPlayerSpeak(ID: byte; Text: string);begin if (Text = '!sacrifice') and (antispam = 0) then begin CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y'), -50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y'), 50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 75, 0, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') - 75, -50, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') + 75, 50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') + 75, 0, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') + 75, -50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') - 75, 50, -50,100, 4, 1); DoDamage(ID,4444); antispam:=65;begin if (Text = '!Heal') and (antispam = 0) then begin DoDamage(ID,-1000);antispam:=75;end; end;end;
can you figure out what's wrong with this one too?Code: [Select]var WNUM, PNUM: string;function OnCommand(ID:Byte;Text:string):boolean;begin if Copy(lowercase(Text), 1, 7) = '/spawn ' then begin try WNUM := GetPiece(Text, ' ', 2) PNUM := GetPiece(Text, ' ', 3) if (WNUM = (GetObjectStat(ID,Type))) then begin if GetPlayerStat(strtoint(PNUM), 'active') = true then begin SpawnObject(GetPlayerStat(PNUM,'x'),GetPlayerStat(PNUM,'y'),WNUM); end; end; end;end;it's sposed to be a weap spawn script
function SpawnObject(X,Y:Single; ObjType: Byte): integer;
if i were to add another command like beginDoDamage(ID,-1000); antispam:=75; end;how would i do it becouse i just cant get it rightCode: [Select]var antispam: integer;procedure AppOnIdle(Ticks: integer);begin if (Text = '!Heal') and (antispam = 0) then begin antispam:=antispam-1;end;procedure OnPlayerSpeak(ID: byte; Text: string);begin if (Text = '!sacrifice') and (antispam = 0) then begin CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y'), -50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y'), 50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 75, 0, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') - 75, -50, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') + 75, 50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') + 75, 0, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') + 75, -50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') - 75, 50, -50,100, 4, 1); DoDamage(ID,4444); antispam:=65;begin if (Text = '!Heal') and (antispam = 0) then begin DoDamage(ID,-1000);antispam:=75;end; end;end;Im new so i come out w this can u show me the correct way to do this
var antispam: integer;procedure AppOnIdle(Ticks: integer);beginif (Text = '!Heal') and (antispam = 0) then beginantispam:=antispam-1;end;procedure OnPlayerSpeak(ID: byte; Text: string);beginif (Text = '!sacrifice') and (antispam = 0) then begin CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y'), -50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y'), 50, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 75, 0, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') - 75, -50, -50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') + 75, 50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') + 75, 0, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') - 75, GetPlayerStat(ID,'y') + 75, -50, 50,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x') + 75, GetPlayerStat(ID,'y') - 75, 50, -50,100, 4, 1); DoDamage(ID,4444); antispam:=65;end;if (Text = '!Heal') and (antispam = 0) then begin DoDamage(ID,-1000); antispam:=75;end;end;
ty its workng now (+ i wont have to ask that question again)Date Posted: August 15, 2007, 05:32:03 PMCan u give me an example of a force weapon script It keeps say comma (',') expectedWhen i try to use mine
procedure OnPlayerSpeak(ID: byte; Text: string);begin if Text[1] = '%' then begin try ForceWeapon(ID,StrtoInt(Copy(Text,2,Length(Text))),255,0); except WriteConsole(ID,'Nooo! That ''tis noo numbuh!',$FFFFFFFF); end; end;end;
procedure ForceWeapon(ID, Primary, Secondary, Ammo: Byte);
var WNUM, PNUM: string;function OnCommand(ID:Byte;Text:string):boolean;begin if Copy(lowercase(Text), 1, 7) = '/spawn ' then begin try WNUM := GetPiece(Text, ' ', 2) PNUM := GetPiece(Text, ' ', 3) if (strtoint(WNUM) = (GetObjectStat(strtoint(WNUM),'Type'))) then begin if GetPlayerStat(PNUM,'active') = true then begin SpawnObject(GetPlayerStat(PNUM,'x'),GetPlayerStat(PNUM,'y'),strtoint(WNUM)); end; end; end;Result := falseend;