SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/11/2014, 09:12 PM   #41
Dr0n
Little Clucker
 
Join Date: Nov 2014
Posts: 3
Reputation: 0
Question Re: SampSharp - Write gamemodes in .NET

Hello guys,
I've got a little problem with SendClientMessage. When I want to send letters "č,ř" etc., server shows it like "Y,...". Have anyone some idea how to solve it?
Dr0n is offline   Reply With Quote
Old 09/11/2014, 09:21 PM   #42
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by Dr0n View Post
Hello guys,
I've got a little problem with SendClientMessage. When I want to send letters "č,ř" etc., server shows it like "Y,...". Have anyone some idea how to solve it?
What charset is this? Cyrillic or Greek or something? There is currently an open issue on github about the plugin not supporting Cyrillic characters.

I am willing to fix it, but I can't get the characters to display in my client when I use pawn's SendClientMessage. It just shows some jibberish. If someone can explain how I change sa-mp's charset, then I can fix it.
__________________
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 G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 09/11/2014, 09:29 PM   #43
Dr0n
Little Clucker
 
Join Date: Nov 2014
Posts: 3
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by ikkentim View Post
What charset is this? Cyrillic or Greek or something? There is currently an open issue on github about the plugin not supporting Cyrillic characters.

I am willing to fix it, but I can't get the characters to display in my client when I use pawn's SendClientMessage. It just shows some jibberish. If someone can explain how I change sa-mp's charset, then I can fix it.
These letters are from czech language ( UTF-8 ).
Game mode written in pawno shows them properly.
Dr0n is offline   Reply With Quote
Old 09/11/2014, 11:11 PM   #44
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by Dr0n View Post
These letters are from czech language ( UTF-8 ).
Game mode written in pawno shows them properly.
thanks, I'll see what I can do.

Edit: fixed it, see last post of https://github.com/ikkentim/SampSharp/issues/29
__________________
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 G00GLE MAPS! | Topic Github Sample

Last edited by ikkentim; 13/11/2014 at 09:09 PM.
ikkentim is offline   Reply With Quote
Old 16/11/2014, 10:08 PM   #45
Dr0n
Little Clucker
 
Join Date: Nov 2014
Posts: 3
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by ikkentim View Post
thanks, I'll see what I can do.

Edit: fixed it, see last post of https://github.com/ikkentim/SampSharp/issues/29
Dude youre awesome!
Works perfect!
Dr0n is offline   Reply With Quote
Old 05/12/2014, 06:47 PM   #46
AmirSlaYeR
Big Clucker
 
AmirSlaYeR's Avatar
 
Join Date: Apr 2014
Location: IraN
Posts: 106
Reputation: 7
Default Re: SampSharp - Write gamemodes in .NET

Pawno Language is Beeter to C# And Pawno is Very Easy !!!
__________________
Yahoo!: wolf.trin
Line: Amirslayers
Viber: +989368291181 (09368291181)
********: hasan ebrahimi Or(wolf.trin@yahoo.com)
Skype: Forgot

IraN Is LiFe
AmirSlaYeR is offline   Reply With Quote
Old 05/12/2014, 06:51 PM   #47
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by AmirSlaYeR View Post
Pawno Language is Beeter to C# And Pawno is Very Easy !!!
That's your opinion, not a fact.
__________________
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 G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 25/02/2015, 08:37 PM   #48
_DoLpHiN_
Little Clucker
 
Join Date: Jan 2011
Location: Volgograd
Posts: 12
Reputation: 0
Default Re: SampSharp - Write gamemodes in .NET

Hi. Good work.
I want to create a pickup that can be pick up in the vehicle, and respawn it after a specified period of time.
Standard pickups are not suitable, as they can not be "in air", they simply fall to the level of water or other object. I do not quite understand of architecture SAMP# (MVC or MVVM easly ), so you can tell me how to implement this correctly?
In Pawn I just used an array of information about the pickups, pickup created with type 23, and checked every 300 ms player's position relative to the pickup. Not very effective variant, but works perfectly.
_DoLpHiN_ is offline   Reply With Quote
Old 25/02/2015, 11:30 PM   #49
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by _DoLpHiN_ View Post
Hi. Good work.
I want to create a pickup that can be pick up in the vehicle, and respawn it after a specified period of time.
Standard pickups are not suitable, as they can not be "in air", they simply fall to the level of water or other object. I do not quite understand of architecture SAMP# (MVC or MVVM easly ), so you can tell me how to implement this correctly?
In Pawn I just used an array of information about the pickups, pickup created with type 23, and checked every 300 ms player's position relative to the pickup. Not very effective variant, but works perfectly.
The Controllers in SAMP# are mainly for keeping your code for different things separately; This way you don't have to put tons of code in your main GameMode class. In my gamemode I have a controller for buildings, loading of static vehicles, loading of teams and so on.

If you really want to tag it with some name, it'd be MC, since there are no views. The models would be the player, vehicle, pickup classes and so forth.

Best for you would be to create a class, e.g. VehiclePickup, in which you add a private Pickup field which you populate in the contructor. Either you also create a timer to check the player's position at every interval -or- you use the streamer plugin with a dynamic area. (I'd suggest the latter)

Something to get you started

Code:
class VehiclePickup
{
    private DynamicPickup _pickup; // Using a streamer pickup here, you can change it to Pickup if you like that better.
    private DynamicArea _area;
    private Timer _timer;

    public VehiclePickup(int model, Vector2 position)
    {
        _pickup = new DynamicPickup(...); //todo: fill parameters
        _area = DynamicArea. CreateSphere(...); //todo: fill parameters

        _area.Enter += (sender, args) => _area_Enter;

        //todo: store the parameters passed in the constructor in private fields.
    }

    public event EventHandler<PlayerEventArgs> PickedUp;

    protected void OnPickedUp(PlayerEventArgs e)
    {
        if(PickedUp != null)
            PickedUp(e);
    }

    private void _area_Enter(object sender, PlayerEventArgs e)
    {
        if(_pickup != null)
        {
            OnPickedUp(e);
            
            //todo: _pickup.Dispose(); set _pickup to null; set Timer _timer which respawns the _pickup.
        }
    }
}
__________________
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 G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 26/02/2015, 04:02 AM   #50
muzammilfreeman
Huge Clucker
 
muzammilfreeman's Avatar
 
Join Date: Dec 2014
Location: In The World Of Roleplay.
Posts: 242
Reputation: 44
Default Re: SampSharp - Write gamemodes in .NET

That's easy.. thanks for release
__________________
Server Information:

SA-MP: samp.ne-rp.net
FORUMS: www.ne-rp.net/forums
TeamSpeak3: ts.ne-rp.net
UCP: cp.ne-rp.net
Shop: shop.ne-rp.net

JOIN NOW TO EXPLORE AMAZING FEATURES[STABLE 40+ DAILY PLAYERBASE]
muzammilfreeman 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 09:35 AM
How to write something in a VAR? Ihsan_Cingisiz Help Archive 4 29/05/2010 08:24 PM
How Do You Write This? sidhu123 Everything and Nothing 2 12/09/2009 05:05 AM
Write something in big and to the top TimBuk.Ekh Help Archive 3 18/04/2009 08:19 PM


All times are GMT. The time now is 06:24 AM.


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