Show Posts
|
Pages: [1] 2 3 4
|
1
|
Scripting / Script Help / Re: Object dissapear on a specific command
|
on: October 24, 2011, 06:07:15 pm
|
try this:
function onScriptLoad() { CreateSphere( Vector( 194.33, -1195.3, 26.16 ), 3.0, Colour( 0, 136, 255 ) ) oFence <- CreateObject( 1281, Vector( 844.1, -419.5, 14.97 ) ) return 1; }
function onPlayerEnterSphere( player, sphere ) if ( sphere.ID == 12 ) { MessagePlayer( "Anticefur CENTER:", player, 0, 136, 255 ); MessagePlayer( "Owner: xXxMDjxXx", player, 0, 136, 255 ); MessagePlayer( "Odkup: NONE", player, 0, 136, 255 ); MessagePlayer( "Najem: NONE", player, 0, 136, 255 ); MessagePlayer( "Vsebuje: orozja, vozila, parkirna hisa, ograja", player, 0, 136, 255 ); return 1; }
function onPlayerCommand( player, cmd ) { if ( cmd == "accso" ) { oFence.VirtualWorld = 2; return 1; }
else if ( cmd == "accsz" ) { oFence.VirtualWorld = 0; return 1; }
Actualy now i get an error ...: COMMAND: xxxmdjxxx: accso
AN ERROR HAS OCCURED [wrong number of parameters]
CALLSTACK
LOCALS COMMAND: xxxmdjxxx: accsz
AN ERROR HAS OCCURED [wrong number of parameters]
CALLSTACK
LOCALS the script function onScriptLoad() { CreateSphere( Vector( 194.33, -1195.3, 26.16 ), 3.0, Colour( 0, 136, 255 ) ) oFence <- CreateObject( 1289, Vector( 844.1, -419.5, 14.97 ) ) return 1; }
function onPlayerEnterSphere( player, sphere ) if ( sphere.ID == 12 ) { MessagePlayer( "Anticefur CENTER:", player, 0, 136, 255 ); MessagePlayer( "Owner: xXxMDjxXx", player, 0, 136, 255 ); MessagePlayer( "Odkup: 100€", player, 0, 136, 255 ); MessagePlayer( "Najem: 1€", player, 0, 136, 255 ); MessagePlayer( "Vsebuje: orozja, vozila, parkirna hisa, ograja", player, 0, 136, 255 ); return 1; }
function onPlayerCommand( player, cmd ) { if ( cmd == "accso" ) { oFence.VirtualWorld = 2; return 1; }
else if ( cmd == "accsz" ) { oFence.VirtualWorld = 1; return 1; }} PS. Ja sam iz SLO, lijep pozdrav D.Mandi?
|
|
|
4
|
Scripting / Script Help / Re: Object dissapear on a specific command
|
on: October 22, 2011, 10:56:06 am
|
"not really working..." wtf does that support to mean? Give us some more details! Does it give any error, what did you try to fix it. With a reply "its not working" we can't do much..
Hehe, sorry... Well the object is shown, but it doesent "dissapear"... There are no errors in the server window. the code is: function onScriptLoad() { CreateSphere( Vector( 194.33, -1195.3, 26.16 ), 3.0, Colour( 0, 136, 255 ) ) oFence <- CreateObject( 1281, Vector( 844.1, -419.5, 14.97 ) ) return 1; }
function onPlayerEnterSphere( player, sphere ) if ( sphere.ID == 12 ) { MessagePlayer( "Anticefur CENTER:", player, 0, 136, 255 ); MessagePlayer( "Owner: xXxMDjxXx", player, 0, 136, 255 ); MessagePlayer( "Odkup: NONE", player, 0, 136, 255 ); MessagePlayer( "Najem: NONE", player, 0, 136, 255 ); MessagePlayer( "Vsebuje: orozja, vozila, parkirna hisa, ograja", player, 0, 136, 255 ); return 1; }
else if ( cmd == "accso" ) { oFence.VirtualWorld = 2; return 1; }
else if ( cmd == "accsz" ) { oFence.VirtualWorld = 0; return 1; } I made a property on my server, so when someone walks over the sphere they see the text (owner, cost, cars etc...) And to prevent my cars from being stolen i wanted to make a gate, which would be "remote controled" so only people with the code could open the gates and dive with my cars...
|
|
|
6
|
Scripting / Script Help / Object dissapear on a specific command
|
on: October 16, 2011, 10:21:23 am
|
Hm, how could i make a object, lets say a fence and put it in front a driveway of a house, and make it dissapear with a command like /open and when i send /close the fence will apear again? I would put a gate at the enterance to a mansion..
|
|
|
8
|
Scripting / Scripting Discussion / Re: Spawn point by player name?
|
on: October 15, 2011, 07:58:33 pm
|
Err yes..
function onPlayerSpawn( player, spawn ) { if ( player.Name.tolower() == "xxxmdjxxx" ) player.Pos = Vector( 0.0, 0.0, 0.0 ); return 1; }
hmm, still not working, changed my name to xxxmdjxxx and still nothing.
|
|
|
9
|
Scripting / Scripting Discussion / Re: Spawn point by player name?
|
on: October 15, 2011, 03:35:17 pm
|
You can check the player name with player.Name; So on spawn you could do this:
function onPlayerSpawn( player, spawn ) { if ( player.Name == "testplayer123" ) player.Pos = Vector( x, y, z ); }
The code is not working... function onPlayerSpawn( player, spawn ) if ( player.Name == "xXxMDjxXx" ) { player.Pos = Vector( -812.2, 355.7, 51.32 ); return 1; } Have i done something wrong?
|
|
|
11
|
Scripting / Script Help / Re: Spheres problem...
|
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:
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
|
|
|
13
|
Scripting / Script Help / Spheres problem...
|
on: October 12, 2011, 06:56:54 pm
|
Hi, i cannot make this script to work:
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..
|
|
|
14
|
Scripting / Scripting Discussion / Spawn point by player name?
|
on: October 10, 2011, 06:00:42 pm
|
How could i make a player always spawn at a certain coordinate?
Lets say there is a player with a name "testplayer123"
So when this player joins the server or dies, he will spawn at a certain coordinate?
Other players will spawn at default spawnpoints...
|
|
|
|