SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 05/03/2016, 11:49 AM   #201
R0LL3R
Little Clucker
 
Join Date: Feb 2016
Posts: 43
Reputation: 13
Default Re: SampSharp - Write gamemodes in .NET

Nice
R0LL3R is offline   Reply With Quote
Old 06/03/2016, 12:39 PM   #202
xyyy018
Little Clucker
 
Join Date: Feb 2016
Posts: 27
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

I find bug.
If you put player in vehicle using method PutInVehicle, Vehicle driver is null
How to destroy vehicle?
xyyy018 is offline   Reply With Quote
Old 06/03/2016, 03:47 PM   #203
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,070
Reputation: 189
Default Re: SampSharp - Write gamemodes in .NET

This is a SA-MP bug iirc. If you use PutPlayerInVehicle(playerid, vehicleid); then the driver is isn't set immediately either.

Destroy vehicles with v.Dispose();.
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in Go0gle Maps! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 06/03/2016, 03:51 PM   #204
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,070
Reputation: 189
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by xyyy018 View Post
How I can change "Detected mono version: <number>", "Loaded <number> commands" and "Number of vehicles model: <number>" text in console?

Any callback to block commands for player? I try this
Code:
public override void OnCommandText(SampSharp.GameMode.Events.CommandTextEventArgs e)
        {

            if (e.Text[0] == '/' && this.Attraction != AttractionTypes.Attraction_NONE)
            {
                SendClientMessage(Color.DarkRed + "Block!");
                e.Success = false;
            }
            else
                base.OnCommandText(e);
        }
But command not stop
You can't change those lines. The first one is essential for debugging, the second one is put there by the command controller and the third one is put there by vanilla SA-MP. I can't see why you'd care, a user won't be seeing the server log anyways.

You can block the commands by overriding OnPlayerCommandText in the gamemode.
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in Go0gle Maps! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 11/03/2016, 10:12 AM   #205
xyyy018
Little Clucker
 
Join Date: Feb 2016
Posts: 27
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

Okay, I have problem with streamer.
I have this code
Code:
DynamicRaceCheckpoint dc = new DynamicRaceCheckpoint(CheckpointType.Normal, new Vector3(rCP[i].X, rCP[i].Y, rCP[i].Z), new Vector3(rCP[i + 1].X, rCP[i + 1].Y, rCP[i + 1].Z), race.CPSize, 400);
rCP is array with Race Checkpoint positions from database (it's work, I can write positions in console)
But when I create Dynamic Race Checkpoint
Quote:
[11/03/2016 12:05:26] Exception thrownOnTimerTick:
System.InvalidOperationException: native not found
at (wrapper managed-to-native) SampSharp.GameMode.Natives.Native:CallNativeArray (string,string,object[],int[])
at SampSharp.GameMode.Natives.Native.CallNative (System.String name) [0x00000] in <filename unknown>:0
at SampSharp.Streamer.Natives.StreamerNative.CreateDy namicRaceCP (CheckpointType type, Single x, Single y, Single z, Single nextx, Single nexty, Single nextz, Single size, Int32 worldid, Int32 interiorid, Int32 playerid, Single streamdistance) [0x00000] in <filename unknown>:0
at SampSharp.Streamer.World.DynamicRaceCheckpoint..ct or (CheckpointType type, Vector3 position, Vector3 nextPosition, Single size, Int32 worldid, Int32 interiorid, SampSharp.GameMode.World.GtaPlayer player, Single streamdistance) [0x00000] in <filename unknown>:0
at SSS.Attractions.Race.Start () [0x001a0] in c:\path\Race.cs:53
at SSS.Attractions.Race.startRace_Tick (System.Object sender, System.EventArgs e) [0x00001] in c:\path\Race.cs:165
at SampSharp.GameMode.SAMP.Timer.OnTick (System.EventArgs e) [0x00000] in <filename unknown>:0
at SampSharp.GameMode.Controllers.TimerController.<Re gisterEvents>b__0 (System.Object sender, System.EventArgs args) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) System.EventHandler`1<System.EventArgs>:invoke_voi d_object_TEventArgs (object,System.EventArgs)
at SampSharp.GameMode.BaseMode.OnTimerTick (Int32 timerid, System.Object args) [0x00000] in <filename unknown>:0
I load Streamer plugin in main file
Code:
Streamer.Load(this, controllers);
And I install Streamer by Nuget
xyyy018 is offline   Reply With Quote
Old 11/03/2016, 10:40 AM   #206
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,070
Reputation: 189
Default Re: SampSharp - Write gamemodes in .NET

Did you install the streamer plugin? http://forum.sa-mp.com/showthread.php?t=102865
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in Go0gle Maps! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 11/03/2016, 12:22 PM   #207
Buero
Little Clucker
 
Join Date: Jul 2015
Posts: 18
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Streamer.Load(this,this.Controllers);
new DynamicCheckpoint(new Vector3(1775.4617f, -1900.0793f, 13.3860f), 2f, 25f, new int[] { 0 }, new int[] { 0 });
Error:
Buero is offline   Reply With Quote
Old 11/03/2016, 12:24 PM   #208
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,070
Reputation: 189
Default Re: SampSharp - Write gamemodes in .NET

Maybe the plugin has been updated since I wrote the extension... (or I could have just implemented it wrong) I'll check when I've got the time.
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in Go0gle Maps! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 11/03/2016, 02:25 PM   #209
xyyy018
Little Clucker
 
Join Date: Feb 2016
Posts: 27
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

New streamer not work for me (I have Microsoft Visual C++ 2015 Redistributable Package) but I use this streamer version and this work


(And I have one error :<)
Quote:
[SampSharp] ERROR: Parameters of callback OnPlayerEnterDynamicRaceCP does not match signature (called: 1, signature: 2)
Code:
public static void dc_Enter(object sender, SampSharp.GameMode.Events.PlayerEventArgs e)
{
           //Code
}
Color AliceBlue is white :v

Last edited by xyyy018; 18/03/2016 at 03:17 PM.
xyyy018 is offline   Reply With Quote
Old 16/03/2016, 05:06 PM   #210
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Italia
Posts: 1,363
Reputation: 83
Thumbs up Re: SampSharp - Write gamemodes in .NET

Really interesting I'll check it out
Sasino97 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write on the map hejsan123 Scripting Help 3 23/09/2012 08:35 AM
How to write something in a VAR? Ihsan_Cingisiz Help Archive 4 29/05/2010 07:24 PM
How Do You Write This? sidhu123 Everything and Nothing 2 12/09/2009 04:05 AM
Write something in big and to the top TimBuk.Ekh Help Archive 3 18/04/2009 07:19 PM


All times are GMT. The time now is 11:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.