Author Topic: Spheres problem...  (Read 2144 times)

xxxMDjxxx

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
  • SS-division*game hosting
    • View Profile
Spheres problem...
« on: October 12, 2011, 06:56:54 pm »
Hi, i cannot make this script to work:

Code: [Select]
function onScriptLoad()
{
CreateSphere( Vector( -368, 245.84, 61.02 ), 3.0, Colour( 0, 0, 255 ) )

return 1;
}

function onPlayerFootSphereHit( player, sphere )
{
if ( sphere.ID == 0 )

MessagePlayer( "Vila Janeza tretjega:", player, RED );

return 1;
}

function onPlayerSpawn( player, spawn )
{

if ( player.Name == "xXxMDjxXx" ) player.Pos = Vector( -368, 245.84, 61.02 );

return 1;
}

What is the problem? I can see the sphere, but when i walk into it nothing happens..

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Spheres problem...
« Reply #1 on: October 12, 2011, 11:26:42 pm »
The signal you're using does not exist. Check the wiki for the right signal.
« Last Edit: October 13, 2011, 04:27:32 pm by Thijn »

xxxMDjxxx

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
  • SS-division*game hosting
    • View Profile
Re: Spheres problem...
« Reply #2 on: October 13, 2011, 06:54:06 pm »
The signal you're using does not exist. Check the wiki for the right signal.

???Signal??? What???

Force

  • Developer
  • Full Member
  • *****
  • Posts: 204
  • Karma: +6/-2
    • View Profile
Re: Spheres problem...
« Reply #3 on: October 13, 2011, 06:57:17 pm »
The signal you're using does not exist. Check the wiki for the right signal.


???Signal??? What???


Signal/Event same thing, he's basically saying that onPlayerFootSphereHit doesn't exist. You should be using

Code: [Select]
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Events/Sphere/onPlayerEnterSphere

If you read the wiki you wouldn't have to figure this out.
Quote
[Tue - 20:09:35] <&VRocker> CRAP!
[Tue - 20:09:43] <&VRocker> i think i just followed through...
Quote
[Sat - 22:11:56] <~Smapy> [R3V]breSt12 killed [R3V]Jack_Bauer. (Splat)

xxxMDjxxx

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
  • SS-division*game hosting
    • View Profile
Re: Spheres problem...
« Reply #4 on: October 14, 2011, 05:44:53 pm »
Ok, well sorry, but i was not being rude to him... I am yust a beginer with ideas and want to make stuff. The weird non existing
event is something i found on the forum and tried it, but the correct event isnot helping me to...

the code looks like this:
Code: [Select]
function onScriptLoad()
{
 CreateSphere( Vector( -368, 245.84, 61.02 ), 3.0, Colour( 0, 0, 255 ) )

 return 1;
}

function onPlayerEnterSphere( player, sphere )
{
 if ( sphere.ID == 0 )
 {
  MessagePlayer( "Vila Janeza tretjega:", player, RED );
 }
return 1;
}

function onPlayerSpawn( player, spawn )
{
 if ( player.Name == "xXxMDjxXx" )
 {
  player.Pos = Vector( -368, 245.84, 61.02 );
 }
 return 1;
}


and the code onPlayerSpawn, doesent spawn me on that spot eather... idk what am i doing wrong...
And for the sphere, could it be the problem that i have more spheres in other scripts like fuelscript and car respray script, so that the id of this sphere is not 0, or is the sphere id defined for every script itself?


Modified--:

So now, the server gives an error :

AN ERROR HAS OCCURED [getVarInfo: Could not retrieve UserData]

CALLSTACK
*FUNCTION [onPlayerEnterSphere()] Scripts/hise/hise.nut line [10]

LOCALS
[sphere] INSTANCE
[player] INSTANCE
[this] TABLE

AN ERROR HAS OCCURED [getVarInfo: Could not retrieve UserData]

CALLSTACK
*FUNCTION [onPlayerEnterSphere()] Scripts/hise/hise.nut line [10]

LOCALS
[sphere] INSTANCE
[player] INSTANCE
[this] TABLE
« Last Edit: October 14, 2011, 06:11:46 pm by xxxMDjxxx »

Force

  • Developer
  • Full Member
  • *****
  • Posts: 204
  • Karma: +6/-2
    • View Profile
Re: Spheres problem...
« Reply #5 on: October 14, 2011, 07:08:49 pm »
Code: (squirrel) [Select]
MessagePlayer( "Vila Janeza tretjega:", player, RED );

Does RED even exist? You should be doing 255, 0, 0 for red in MessagePlayer.

Code: (squirrel) [Select]
MessagePlayer( "Vila Janeza tretjega:", player, 255, 0, 0 );

As for the onPlayerSpawn code I have no idea.
Quote
[Tue - 20:09:35] <&VRocker> CRAP!
[Tue - 20:09:43] <&VRocker> i think i just followed through...
Quote
[Sat - 22:11:56] <~Smapy> [R3V]breSt12 killed [R3V]Jack_Bauer. (Splat)

xxxMDjxxx

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
  • SS-division*game hosting
    • View Profile
Re: Spheres problem...
« Reply #6 on: October 14, 2011, 08:03:55 pm »
WORKS! ooooh thanx man you are the greatest!  ;D

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Re: Spheres problem...
« Reply #7 on: October 14, 2011, 09:54:24 pm »
Code: [Select]
if ( player.Name == "xXxMDjxXx" )
This is case sensitive. If one letter isn't in caps as it should be, it will fail. This should work:

Code: [Select]
if ( player.Name.tolower() == "xxxmdjxxx" )
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

 

© Liberty Unleashed Team.