Show Posts
|
Pages: 1 ... 3 4 [5] 6
|
61
|
Scripting / Script Help / Re: Player and vehicle
|
on: December 27, 2013, 03:27:40 pm
|
Hi Slayer. After reviewing the code you posted, I noticed a problem. When spawning the vehicle, you assigned its instance to the local variable 'pVehicle'.
Afterwards, you used the FindVehicle with its argument being a vehicle pointer already.
Try this: Remove the line where you used FindVehicle. Then, change the player.EnterVehicle to pVehicle instead of Fv.
Please let us know if this helps.
------- Sorry, I am typing this on my phone at the moment so I apologize for any spelling or grammar errors.
Thanks, but doesn't work. Sorry for double posting but I couldn't find the edit button on my phone.
Anyway, Slayer, I want to give you a helpful tip. When retrieving a player position (via Player.Pos), it already returns a Vector. You don't have to use the Vector function again (as long as the position stays the same) when calling CreateVehicle(). You can also use Player.Pos directly inside of CreateVehicle as well.
Offtopic: @VRocker, is it possible to make a mobile compatible website? I cannot use my PC right now and it would be helpful on the go.
I know... lol. Try This >>
function onPlayerCommand( plr, cmd, arguments ) { if ( cmd == "v" || cmd == "veh" || cmd == "car" ) { if ( plr.Spawned ) { if ( arguments ) { if ( IsNum( arguments ) ) { local pTemp = split( arguments, " " ), ID = 90; if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger(); if ( ( ID >= 90 ) && ( ID <= 150 ) ) { local v = plr.Pos; local pVehicle = CreateVehicle( ID, Vector( v.x, v.y, v.z ), plr.Angle ); pVehicle.OneTime = true;
local vehicle = GetClosestVehicle( plr ); if ( vehicle ) { plr.Vehicle = vehicle; } } } else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 ); } else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 ); } else MessagePlayer( "You first need spawn.", plr, 250, 0, 0 ); return true; }
return 1; }
And, thanks Mido_Pop, work 100%
|
|
|
62
|
Liberty Unleashed / Support / Re: A problem
|
on: December 21, 2013, 10:49:54 pm
|
LU Limit FPS: 30 SP Limit FPS: 30 (too, but you can break this limit disabling "Frame Limiter")
LU have the limit of FPS for avoid the bad synchronization with the server.
|
|
|
64
|
Scripting / Script Help / Player and vehicle
|
on: December 09, 2013, 10:50:47 pm
|
How I can put the player in the vehicle when I spawn the vehicle?
I tried this:
else if ( cmd == "v" || cmd == "veh" || cmd == "car" ) { if ( plr.Spawned ) { if ( arguments ) { if ( IsNum( arguments ) ) { local pTemp = split( arguments, " " ), ID = 90; if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger(); if ( ( ID >= 90 ) && ( ID <= 150 ) ) { local v = plr.Pos; local pVehicle = CreateVehicle( ID, Vector( v.x, v.y, v.z ), plr.Angle ); pVehicle.OneTime = true; local Fv = FindVehicle( pVehicle ); plr.Pos = Fv.Pos; plr.EnterVehicle( DOOR_DRIVER, Fv ); } } else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 ); } else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 ); } else MessagePlayer( "You first need spawn.", plr, 250, 0, 0 ); return true; }
But doesn't work.
|
|
|
67
|
Servers / General Server Chat / Re: Help RPG
|
on: October 19, 2013, 12:56:36 am
|
Hello, I would like to work on a RPG server, but not well as do some things, so I ask if anyone wanted to help me create a RPG server.
Sorry for my bad english
-_- Why don't you make it? We don't have all time of the world and most of the scripters are pro lazy *hides*
|
|
|
70
|
Scripting / Script Help / Re: Save Pos.
|
on: September 03, 2013, 08:13:27 pm
|
Thank Thijn. And, the pos is not save? And, how I save the weapons?
Sorry by many questions xD
|
|
|
71
|
Scripting / Script Help / Re: Save Pos.
|
on: September 02, 2013, 05:40:06 pm
|
zPosition <- HashTable( "Position" );
function LoadStatHashes() { zPosition.Load( "Hashes/DSS/PlayerStats/Position.hsh" ); }
function SaveStatHashes() { zPosition.Save( "Hashes/DSS/PlayerStats/Position.hsh" ); }
function CloseStatHashes() { zPosition.Close();
zPosition <- null; }
L0L
|
|
|
72
|
Scripting / Script Help / Re: Save Pos.
|
on: September 02, 2013, 04:43:43 pm
|
function GetPosition( name ) { local pos = zPosition.Get( name.tolower() ); if ( pos != null ) return pos; }
|
|
|
73
|
Scripting / Script Help / Save Pos.
|
on: September 02, 2013, 01:57:40 pm
|
What is wrong ?
function InitStatsTimer( plr ) { local pos = plr.Pos; local health = plr.Health; local armour = plr.Armour; local FormatPos = format( pos.x + "," + pos.y + "," + pos.z ); local FormatWeapon = format( plr.Weapon + "," + plr.WeaponAmmo ); SetHealth( plr.Name, health ); SetArmour( plr.Name, armour ); SetWeapon( plr.Name, FormatWeapon ); SetPosition( plr.Name, FormatPos ); SaveStatHashes(); }
function ProcessPlayerStatsLog( plr ) { plr.Health = GetHealth( plr.Name ); plr.Armour = GetArmour( plr.Name ); plr.SetWeapon( GetWeapon( plr.Name ) ); plr.Pos = Vector( GetPosition( plr.Name ) ); if ( !plr.Spawned ) plr.Spawn(); }
Say error in
plr.Pos = Vector( GetPosition( plr.Name ) );
Lol.
|
|
|
|