[Plugin] SampSharp - Write gamemodes in .NET

Use Player.Find(id); instead.

pickups have a pickup.PickedUp event.
Reply

How to create timer or timer for one player?
Reply

Quote:
Originally Posted by Buero
Посмотреть сообщение
How to create timer or timer for one player?
To quote from an earlier PM discussion, so that other can enjoy the answer as well,

Quote:

timers are never player specific. not even in pawn.

Simply create a field of type `Timer`in, for example, your gamemode or player class and attach to the `Timer.Tick` event.

Reply

How get vehicle model id?
Reply

vehicle.Model returns a value of enum VehicleModelType. If you want it as an int, cast it. (int)vehicle.Model
Reply

When I die in car(driver) I spawn but cameta look at car
Reply

Thats must be a mistake you made. I'm still calling the same functions as you would be doing in pawn.

You probably moved the camera or something. Search for where you change the camera position. Otherwise, Try resetting the camera player.PutCameraBehindPlayer

http://api.sampsharp.timpotze.nl/htm...ce2399ad3e.htm

http://api.sampsharp.timpotze.nl/sea...rchText=Camera

Edit: if that isn't it, you are probably doing something odd in player died or player update events, judging by the arrow position on the minimap
Reply

When I die I don't see death animation but I see button "<<" ">>" "spawn" so I use Spawn() in Player. OnDeath()
Reply

That is the choose-a-class screen. Did you add any classes in your gamemode?
Reply

Quote:
Originally Posted by ikkentim
Посмотреть сообщение
That is the choose-a-class screen. Did you add any classes in your gamemode?
Yes,in BaseMode.OnInitialized -
PHP код:
AddPlayerClass(1, new Vector3(1759.0189f, -1898.1260f13.5622f), 266.4503f); 
In Player.cs
PHP код:
public override void OnRequestClass(RequestClassEventArgs e)
        {
            
e.PreventSpawning true;
            
base.OnRequestClass(e);
        }
        public 
override void OnRequestSpawn(RequestSpawnEventArgs e)
        {
            
e.PreventSpawning true;
            
base.OnRequestSpawn(e);
        } 
Reply

Well that seems rather logical then, don't you think? You're preventing the player from spawning with that code.

You are basically returning "0" in https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn
and in https://sampwiki.blast.hk/wiki/OnPlayerRequestClass
Reply

Hm. Native doesn't change font at all for me
Reply

You have to call textdraw.Show first
Reply

Oh, it works now, thank you
Reply

This plugin support new SA-MP functions? (Actors etc.)
I can run script in C# on Linux?
Reply

Yes and yes.
Reply

What is the difference in speed between the PAWN script and the script in C#?
Reply

It's been a while since I tested it, all I can remember is that c# is at least more than double the speed.
Reply

Any tutorial how to compile this plugin for Linux?
You can add FCNPC to this? I can use EntityFramework? (Migrations, Codefirst etc.)
Thanks for answers!
Reply

Wow it's great fascinating.
__________________
For Bluedart tracking, visit here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)