Author Topic: Urgent Problem, needs fixing ASAP  (Read 10502 times)

0 Members and 1 Guest are viewing this topic.

Offline SpiltCoffee

  • Veteran
  • *****
  • Posts: 1579
  • Spilt, not Split!
    • SpiltCoffee's Site
Re: Urgent Problem, needs fixing ASAP
« Reply #80 on: April 18, 2010, 04:44:22 pm »
btw, if ppl would answer the f**king question AS SOON AS ITS ASKED this wouldnt happen
Oi, oi, you're lucky any of us are willing to spend our time reading through your code and finding your mistakes for you. It's a privilege, not a right.
When life hands you High Fructose Corn Syrup, Citric Acid, Ascorbic Acid, Maltodextrin, Sodium Acid Pyrophosphate,
Magnesium Oxide, Calcium Fumarate, Yellow 5, Tocopherol and Less Than 2% Natural Flavour... make Lemonade!

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Urgent Problem, needs fixing ASAP
« Reply #81 on: April 18, 2010, 05:23:30 pm »
Oi, oi, you're lucky any of us are willing to spend our time reading through your code and finding your mistakes for you. It's a privilege, not a right.

Despite being quite agressive, I agree with you.


btw, if ppl would answer the f**king question AS SOON AS ITS ASKED this wouldnt happen

You post here to ask for help. If people doesn't want to help, they don't. Although, some of us like to help others, because we know how valuable it is.

However, it doesn't give you the right to demand for help. You simply ask for it.

Don't be unreasonable (Or w/e its spelled).

Feel free to ask, just review your concepts about "help".
www.soldatx.com.br - The brazilian Soldat community.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Urgent Problem, needs fixing ASAP
« Reply #82 on: April 21, 2010, 12:53:35 am »
how do i test if my raycast is working?

trying to make it so when a certain weapon was used to kill, any other enemies in range of victim have an explosive bullet spawned on them

maybe im doing something wrong

if u guys can help ill be happy :)

Code: (pascal) [Select]
var
i:Byte;
x,y,x2,y2,Dist:Single;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var
Wepname:String;
begin
WriteLn(IDtoName(Killer)+' has just used the: '+Weapon);
if Weapon = 'Combat Knife' then begin
for i := 1 to 32 do
 x := GetPlayerStat(Victim,'x');
 y := GetPlayerStat(Victim,'y');
 x2 := GetPlayerStat(i,'x');
 y2 := GetPlayerStat(i,'y');
if RayCast(x,y,x2,y2,Dist,800) then begin
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0, 0,100, 4, 1);
end;
end;
end;
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Urgent Problem, needs fixing ASAP
« Reply #83 on: April 21, 2010, 01:00:27 am »
That looks correct. It should work, barring possible hard to notice typos.


Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Urgent Problem, needs fixing ASAP
« Reply #84 on: April 21, 2010, 01:02:39 am »
doesnt seem to be working

i added
Code: (pascal) [Select]
WriteLn(IDtoName(i)+' is in range of Raycast');
underneath If Raycast

the message isnt appearing in ARSSE

what do i do? i have no idea what to do here

From: April 21, 2010, 01:07:35 am
code update:
Code: (pascal) [Select]
var
i:Byte;
x,y,x2,y2,Dist:Single;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var Wepname:String;
begin
WriteLn(IDtoName(Killer)+' has just used the: '+Weapon);
//if Weapon = 'Combat Knife' then begin
for i := 1 to 32 do
begin
 x := GetPlayerStat(Victim,'x');
 y := GetPlayerStat(Victim,'y');
 x2 := GetPlayerStat(i,'x');
 y2 := GetPlayerStat(i,'y');
if RayCast(x,y,x2,y2 - 700,Dist,3000) then begin
WriteLn(IDtoName(i)+' is in range of Raycast');
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0, 0,100, 4, 1);
end;
end;
//end;
end;

message still isnt appearing for raycast

From: April 21, 2010, 01:11:35 am
nvm, all fixed :)
« Last Edit: April 21, 2010, 01:11:35 am by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Urgent Problem, needs fixing ASAP
« Reply #85 on: April 21, 2010, 03:54:41 am »
nvm, all fixed :)
dont just "nvm" on us, what was wrong with it? The weapon name?

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Urgent Problem, needs fixing ASAP
« Reply #86 on: April 21, 2010, 09:15:30 am »
nvm, all fixed :)
dont just "nvm" on us, what was wrong with it? The weapon name?

I believe it was the RayCast() Function..

It didn't result in "True" or "False", so there should be no way to know if it was working.
www.soldatx.com.br - The brazilian Soldat community.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Urgent Problem, needs fixing ASAP
« Reply #87 on: April 21, 2010, 09:50:47 pm »
no, actually none of the players were within range of the raycast in the if statement for it to work so it was always returning a false

where in the code i had x2,y2 - 700, ...

once i got rid of the - 700, it worked fine

heres the 2 sets of code for you to compare, ill just post the troublesome line

The Working:
Code: (pascal) [Select]
if RayCast(x,y,x2,y2,Dist,3000) then begin
the Not Working and always returning False, as the Y2 coord points into the ground:
Code: (pascal) [Select]
if RayCast(x,y,x2,y2 - 700,Dist,3000) then begin
check out my server! click here

If at first you don't succeed, Improvise! :D