The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GivePlayerDamage help and some explanation please!
Dominic0904 Offline
Member

Posts: 63
Threads: 14
Joined: Apr 2011
Reputation: 0
#1
Sad  GivePlayerDamage help and some explanation please!

I'm trying to refresh my memory with this scripting business, but I seem to forgotten a lot more than I thought I had, I'm trying to mess around with a small room I made, adding objects and scripting different events with them (Play sound, screen shake and so on).

But I can't seem to get GivePlayerDamage right, I'm tried going by what it says on here;
http://wiki.frictionalgames.com/hpl2/amn..._functions


but it doesn't help me, I'm still struggling to understand it. I know I would be told to look at the wiki tutorials but they explain it in a way I don't understand.

I'm trying to "kill" the player when he picked up a tomb key. The only thing that confuses me is writing in these;

(string &in asParent, string &in asChild, int alState)
or
(string &in item)


I have no idea where or when to write them or what they are needed for, I'm trying to remind myself from my old script that I made when I used it for a uni project a long time but it's not helping.

Here is what I have so far;


void OnStart()
{
SetEntityPlayerInteractCallback("key_tomb_1", "DieWhenPickUp", true);

SetEntityPlayerInteractCallback("crowbar_1", "PickUpBar", true);
}


//Plays a sound and shakes the player's screen upon pick up
void PickUpBar(string &in item)
{
PlaySoundAtEntity("", "04_scream.snt", "Player", 0, false);
StartScreenShake(0.08f, 3.0f, 0.1f, 0.02f);
}

//Kills player when key is picked up
void DieWhenPickUp(string &in item)

{
GivePlayerDamage("200", "BloodSplat", "0", "01);
}




Can anyone explain this to me please? I would really appreciate it and make me stop having to run to the forum for every single script command that doesn't work.
08-21-2012, 06:34 PM
Find


Messages In This Thread
GivePlayerDamage help and some explanation please! - by Dominic0904 - 08-21-2012, 06:34 PM



Users browsing this thread: 1 Guest(s)