Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 5,706
» Latest member: r1zco
» Forum threads: 2,130
» Forum posts: 11,918

Full Statistics

Online Users
There are currently 64 online users.
» 0 Member(s) | 60 Guest(s)
Bing, Facebook, Google, Yandex

Latest Threads
I think open.mp forums sh...
Forum: Chat
Last Post: janaoamaoan83
3 hours ago
» Replies: 11
» Views: 6,408
Trunk open
Forum: Pawn Scripting
Last Post: Kriso37
Yesterday, 05:14 PM
» Replies: 1
» Views: 11
Is it safe to get assignm...
Forum: Tech
Last Post: luchkabody
Yesterday, 09:36 AM
» Replies: 1
» Views: 76
someone crashing my serve...
Forum: Programming
Last Post: itayuss
Yesterday, 08:52 AM
» Replies: 1
» Views: 16
Client-side scripts
Forum: Questions and Suggestions
Last Post: loverrhoan85
Yesterday, 06:01 AM
» Replies: 3
» Views: 720
helfen
Forum: Chat
Last Post: carlosgucci777
Yesterday, 01:03 AM
» Replies: 1
» Views: 17
Malena Summer Mobile Nota...
Forum: General Discussions
Last Post: malenasummermobilenotary
2024-04-26, 08:11 PM
» Replies: 0
» Views: 10
Caribbean Island Festival...
Forum: Chat
Last Post: caribbeanislandf
2024-04-26, 05:23 PM
» Replies: 0
» Views: 5
Is this a silly question....
Forum: Questions and Suggestions
Last Post: KILLERDOG
2024-04-26, 12:12 PM
» Replies: 0
» Views: 19
Discover
Forum: General Discussions
Last Post: fwjkgehwh
2024-04-26, 06:52 AM
» Replies: 0
» Views: 9

 
  64-bit Support
Posted by: Double-O-Seven - 2019-04-18, 06:32 AM - Forum: Questions and Suggestions - Replies (8)

Hi there



Will there be any 64-bit server builds? For lots of languages other than PAWN that would be amazing!



I?d love to start up a JVM without having to keep the 4GB memory in mind.


  open.mp storms
Posted by: m1n1vv - 2019-04-18, 06:18 AM - Forum: Videos and Screenshots - Replies (1)

Please add COUB-player



Video:? https://coub.com/view/1slcpx

[Image: vWDnEhM.png]


  git.io/open.mp
Posted by: Y_Less - 2019-04-18, 02:39 AM - Forum: Development Updates - Replies (21)

https://git.io/open.mp



This is the direct (nice) link to our github organisation, on which most development will be hosted. There is one notable absence for now - the actual mod. However, all graphics, operations, and modes are being put on there.



Interested in graphics? Star the graphics repo and make some issues.



Want to improve the forums? They're there as well.



Got a simple mode you want including with the server? We'd love to see it.





Note that everything will be MPL 2.0 or CC-BY-SA 3.0. We are setting up CLAs, which is basically just a way of enabling you to say you agree to let us use the things you submit.


  Very Basic SAMP UCP
Posted by: iSpark - 2019-04-18, 02:17 AM - Forum: Videos and Screenshots - Replies (4)

This is just a simple ucp which connects to the gamemode's database and shows the stats of the user.



Just started it. Thinking of adding many more features like online players, ban players etc.



[Video: https://youtu.be/XUtCa5Ckcuc]



Funny thing is, a year ago I was struggling to find a decent UCP tutorial for SAMP so now when I'm completely done with this project I'll be setting up a tutorial so that the readers can make their own user control panel.



Will share the code for this too very soon.


  How to Create Basic Commands
Posted by: DTV - 2019-04-18, 01:50 AM - Forum: Tutorials - Replies (3)

Note: I'm by no means a professional at scripting but what I'm going to tell is what I've learned through the years. I'm going to explain it how I understand it so apologizes if how I describe something isn't correct. This also won't be using sampctl for obtaining the proper include/plugin files, I've simply haven't learned it yet so please don't haze me for not using it here.







How to Create Basic Commands

Last Updated: 17/04/19





This tutorial is aimed at beginners who have little experience with coding. It will go over what you'll need, how to create a command, what you can do within a command, etc.





I. Requirements





- Improved ZCMD

- sscanf





II. Getting started





First thing you'll need to do is get your script ready. If you use the default IDE that comes with the SA-MP server package, you can press ?New? and it will create this for you. However, the following will work as well:





PHP Code:
#include <a_samp>





public OnGameModeInit()

{

? ??return 
1;

}





public 
OnGameModeExit()

{

? ? return 
1;







The first thing we'll need to do is add I-ZCMD and sscanf to our script so that we can access their functions. We do this by typing #include <include_name_here>?at the top of your script. It should look something like this:





PHP Code:
#include <a_samp> //any native samp includes should be above all user-made includes

#include <izcmd>

#include <sscanf2> 





Now you should compile the script to make sure no errors occur. If done right, you should have no errors or warnings. Next step is creating the commands.





III. Creating a Command





Creating a command in the early days of SA-MP required use of public OnPlayerCommandText(playerid, cmdtext[]) along with using strcmp and strtok to understand what commands were being typed and to gather command parameters that the player typed alongside the command. This is no longer used by most scripters as its been shown time and time again to be very inefficient compared to other command processors made today. We'll be using izcmd as our command processor as its (or the original zcmd) the one that most scripters use today. We create a command by doing the following:





PHP Code:
CMD:examplecmd(playeridparams[])

{

? ? return 
1;







The example above is one of the common ways scripters will create a command, however izcmd allows you to create a command a few more ways such as:





PHP Code:
COMMAND:examplecmd(playeridparams[])

{

? ? return 
1;

}

command(examplecmd,playeridparams[])

{

? ??return 
1;

}

cmd(examplecmd,playeridparams[])

{

? ??return 
1;







For the rest of the tutorial, we'll be using the first example. Commands can be placed anywhere in the script below the #include?lines. Now when a player types in /examplecmd, it won't do anything as there's no code to go along with it however the script will recognize it as a command. Let's made this command send out a simple message:





PHP Code:
CMD:examplecmd(playeridparams[])

{

? ??
SendClientMessage(playerid, -1, ?Hello worldI made a command!?); //sends a message to the client (the player)

? ??return 1;







Now when a player types /examplecmd, it will show them the message ?Hello world, I made a command!?. This is a very simple command however, so let's make it give the player full health and armour:





PHP Code:
CMD:examplecmd(playeridparams[])

{

? ??
SendClientMessage(playerid, -1, ?Hello worldI made a command!?); //sends a message to the client (the player)

? ??SetPlayerHealth(playerid100.0); //sets the player's health value to 100 (full health)

? ??SetPlayerArmour(playerid100.0); //sets the player's armor value to 100 (full armour)

? ??return 1;







Now when the player types /examplecmd, it will set the player's health and armour values to 100 along with sending them a message. Now, making commands like this will work fine but what if a player needs to type in additional information that the command requires from the player?





IV: Dealing with parameters





Parameters are what the player will type after the command so that the script can use them. Not all commands will require parameters but when they do, you'll need something to discern if the player's typed any parameters after the command, what those parameters are, how many there are, etc. This is what sscanf will help us do. Here's an example command where the player needs to type in a number to set their health to a specific value:





PHP Code:
CMD:sethealth(playeridparams[])

{

? ??new 
Float:hpstring[128]; //we declare a float variable that will hold the specific value typed by the player along with a string variable that'll be used to display a formatted message

? ??if(sscanf(params,?f?,hp)) //here, sscanf is used to tell the script the values it should expect from the player. In this case, its checking if anything besides the command name was typed or if the value provided will work (i.e. if a letter was typed in place of a number)

? ??{

? ??? ??return 
SendClientMessage(playerid, -1, ?Syntax: /sethealth [value]?); //this is where you tell the player how to use the command properly

? ??}



? ??
SetPlayerHealth(playerid,hp); //assuming that sscanf found nothing wrong with the value the player provided, it will store that value in our `hp` variable, ready to be used in our command here.

? ??format(string,sizeof(string),?You have set your health value to %f.?,hp); //format is used here to have the string variable store a message where the message needs additional information to finish, in this case the value the player typed in for the command

? ??SendClientMessage(playerid, -1string); //instead of typing a message, we put our `string` variable in place as its already storing a message to be used

? ??return 1;







When the player types /sethealth, the script will see that no parameters have been typed in and will give a message to the player on how to use the command. The same will happen if the player was to type something like `/sethealth f` as its looking for a decimal number. Once the player types in a number, the script will see that and (assuming there's no other parameters to deal with) continue with the command with the information given by the player. If the player typed `/sethealth 100`, it will set their health to 100, if they typed `/sethealth 1`, it will set their health to 1 and so on.





V: Further Examples





For the final section, I'm going to leave a few basic commands that do various things to give an idea of how creating a command goes. If there's something I'm doing that I haven't covered earlier, it will be mentioned in the examples.





a. /freezeplayer

PHP Code:
CMD:freezeplayer(playeridparams[])

{

? ??new 
targetidstring[128], name[MAX_PLAYER_NAME]; //name string is to store player's name, the  is to account for null character

? ??if(sscanf(params,?r?,targetid)) //?r? specifier tells sscanf to look for a playerid. Some will tell you to use ?u? but that looks for both players AND npcs, either way it will work but if you don't want npcs to be included, use ?r? for playerid parameters

? ??{

? ??? ??return 
SendClientMessage(playerid, -1, ?Syntax:?/freezeplayer [playerid/name]?);

? ??}

? ??
TogglePlayerControllable(targetidfalse); //this function will toggle the player's ability to move, depending on whether its toggled true or false (1 or 0)

? ??GetPlayerName(targetidnamesizeof(name)); //this is used to get the player's name and store it in the `name` variable

? ??format(stringsizeof(string), ?You have frozen %s.?, name);

? ??
SendClientMessage(playerid, -1string);

? ??return 
1;







b. /givedeagle

PHP Code:
CMD:givedeagle(playeridparams[])

{

? ??new 
targetidammo,string[128],name[MAX_PLAYER_NAME];

? ??if(
sscanf(params,?rd?,targetid,ammo)) //the ?d? specifier is meant for integers, you can use ?i? in place of it as well

? ??{

? ??? ??return 
SendClientMessage(playerid, -1, ?Syntax:?/givedeagle [playerid/name] [ammo]?);

? ??}

? ??
GivePlayerWeapon(targetidWEAPON_DEAGLEammo); //gives the targetid a desert eagle with the ammo the player specified (you can use 24 in place of WEAPON_DEAGLE and it will work the same).

? ??GetPlayerName(targetidnamesizeof(name));

? ??
format(stringsizeof(string), ?You have given %s a Desert Eagle with %d ammo.?, nameammo);

? ??
SendClientMessage(playerid, -1string);

? ??return 
1;







c. /setserverhour

PHP Code:
CMD:setserverhour(playeridparams[])

{

? ??new 
hourstring[128];

? ??if(
sscanf(params,?d?,hour)) 

? ??{

? ??? ??return 
SendClientMessage(playerid, -1, ?Syntax:?/setserverhour [hour]?);

? ??}

? ??if(
hour || hour 23//checking to see if the hour inputted is either below 0 or above 23

? ??{

? ??? ??return 
SendClientMessage(playerid, -1, ?You can only set the server hour between 0 to 23.?);

? ??}

? ??
SetWorldTime(hour); //this is used to set the server's time and thus whether its day or night, it only accepts an hour parameter

? ??format(stringsizeof(string), ?You have set the server hour to %d.?, hour);

? ??
SendClientMessage(playerid, -1string);

? ??return 
1;







d. /setmoney

PHP Code:
CMD:setmoney(playeridparams[])

{

? ??new 
amountstring[128];

? ??if(
sscanf(params,?d?,amount))

? ??{

? ??? ??return 
SendClientMessage(playerid, -1, ?Syntax:?/setmoney [amount]?);

? ??}

? ??
ResetPlayerMoney(playerid); //resets any money the player has to 0

? ??GivePlayerMoney(playeridamount); //gives the player the amount of money they specify

? ??format(stringsizeof(string), ?You have set your money to $%d.?, amount);

? ??
SendClientMessage(playerid, -1string);

? ??return 
1;







This concludes the tutorial. I've never really written anything like this so feedback is appreciated, I hope one of you learns something from this!


  TDEditor - New TextDraw creator with Preview models.
Posted by: Rafael_Rosse - 2019-04-18, 01:12 AM - Forum: Filterscripts - Replies (5)

Moved to GitHub: https://github.com/adri1samp/TDEditor

[Image: W6qNTlDSkYA.jpg]



The authors:

Romzes is the developer of the current modification.

adri1 is the author of the original version.





Current version TDEditor v2.3 ? Download: Yandex Disk



Right-click, click, open, preview, model, color. by text or color






Change fix

Everything is fully translated into Russian.

Added the ability to add comments to each of the textdraw separately.

(You need to click the mouse wheel on the Text icon)

Added the ability to hide each textdraw separately.

(You need to press SHIFT H)

Added a list of standard sprites.

Added support for Russian text in textdraw.

(Only for input through the dialog box, only English text is typed from the keyboard.)

Added the ability to select or deselect all textdraw at once.

A confirmation window has been added for exporting, deleting and copying.

The group editing mode has been reworked, it has become more convenient and more features have appeared.

(To enter it, right-click on the Manage icon)

Fixed a bug when buttons from the keyboard were pressed in a minimized game.

In view mode, the toolbar is completely hidden.

Fixed a bug with the transfer toolbar.

Reworked the appearance of some dialog boxes.

Many small and not only bug fixes.

Fixed bug with saving Russian text to files.

Added support for Russian titles for projects.

Slightly improved export projects.

You can set your own name for variables when exporting.

Added support for custom objects 0.3.8.





Control

CTRL N - Create a TextDraw.

CTRL X - Delete TextDraw.

CTRL C - Copy TextDraw.

CTRL H - Hide TextDraw.

CTRL I - Information about TextDraw.

CTRL R - Turn on the red line.

CTRL B - Move Control Panel.

END - Enter the view mode.

HOME - Enable pixel lock. (The position of the text of the game when moving will be rounded to a whole number

DELETE - Turn off group edit mode. (Only works if multiple textframes are selected)





[Video: https://www.youtube.com/watch?v=cYxV6S-sjbE]



Download

https://github.com/adri1samp/TDEditor







Installation

You have to install Microsoft Visual C 2010 Redistributable Package (x86) to run TDE



1. Download TDEditor

2. Copy TDE.pwn and TDE.amx to your filterscripts server folder.

3. Copy TDE.dll and sscanf.dll to your plugins server folder (create if you haven't)

4. Edit your server.cfg and add TDE in filterscripts, TDE and sscanf in plugins lines, example here.

5. Copy TDE.txd to C:/.../GTA San Andreas/models/txd

6. Download and install Microsoft Visual C 2010 Redistributable Package (x86)

7. Copy all .dll files from DLL Files folder to your main server folder

8. Open your server.[/LEFT]





Old versions

- (1.17) MediaFire (Contains .txd, plugins, source, TDEditor)

- (1.16) MediaFire (Contains .txd, plugins, source, TDEditor)

- (1.15) SolidFiles (Contains .txd, plugins, source, TDEditor)

- (1.14) SolidFiles (Contains .txd, plugins, source, TDEditor)

- (1.13) SolidFiles (Contains .txd, plugins, source, TDEditor)

- (1.12) SolidFiles (Contains .txd, plugins, source, TDEditor)

- (1.1) SolidFiles (Contains .txd, plugins, source, TDEditor)











Changelog

1.18 - Add paths for projects and exports in scriptfiles

1.18 - AFK checker

1.18 - Negative objects models id in preview models for support 0.3.8 custom objects

1.18 - Export project system improved



1.17 - New edit mode (delta, group textdraw move)

1.17 - BUG FIXED: Sometimes, when you duplicate a TextDraw, duplicated textdraw disappears.

1.16 - PixelLock now works with TextDrawSize

1.16 - New and better GameTextPlayers info

1.16 - Textdraw duplication fixed

1.16 - /TDE Box fixed

1.16 - Position edition and dialog box size fixed

1.16 - Improvement on box sizing

1.15 - YSF is not necessary now, then, TDEditor works on 0.3.7 now.

1.14 - Added mirror feature when duplicating textdraw.

1.14 - Added pixel lock feature (Mouse movement will round to nearest whole values).

1.14 - Removed gametext display and changed with textdraw (gametext can get hidden behind textdraws).

1.14 - Pixel lock is home key.

1.13 - Add Key 'END' (/tde cursor if not works) to enable/disable SelectTextDraw on TDE.

1.13 - Fixed some bugs.

1.13 - If no more bugs, this is the latest version.

1.12 - Fixed 2 bugs with outline and shadow levels.

1.1 - Initial version 23/10/14





Tutorial



Button: Manage

[Image: 3vlkSbpBtWw.jpg]



Left click

Show all created TextDraws, and you can select a TextDraw to edit.



Right click

Right click doesn't perform any action.



Button: Export

[Image: JgEatXYupZg.jpg]



Left click

This button will create a Normal TextDraw.



Right click

Show dialog with more options (Sprites, preview models, box).



Button: Delete

[Image: Ys7zopvrK54.jpg]



Left click

Delete the selected TextDraw.

When you remove a TextDraw will be selected previous TextDraw.



Right click

Right click doesn't perform any action.





Button: Duplicate

[Image: uo4Mxl0MNdA.jpg]



Left click

This button will duplicate the selected TextDraw.



Right click

Right click doesn't perform any action.





Button: Font

[Image: KvjlDo2JpYc.jpg]



Left click

When you press this button, TextDraw will change the font.



Right click

Right click doesn't perform any action.





Button: Position

[Image: acnDxEN9mL4.jpg]





Left click

When this mode is enabled, you can move the TextDraw with mouse or keys.

You can ajust movement speed with the keys:



Right click

Will display a dialog for introduce exact cords.





Button: Size

[Image: cjoZtjIup5Q.jpg]





Left click

When this mode is enabled, you can edit the TextDraw text with the keyboard keys.

This script recognizes most of all keys, but it doesn't perform, you've a possibility to use right click.

The script will recognize most of the keys pressed, but if it does not works good, look right click.

[Image: BfEo.gif]



Right click

Will display a dialog for introduce text.





Button: Color





Left click

When this mode is enabled, you can edit the colors by moving the mouse at the corners (with left click pressed).



Right click

Will display a dialog with some functions (principal colors, exact color and combine colors).





Button: BG Color





Left click

It work like the 'Color' button (BoxColor).



Right click

Will display a dialog with some functions (principal colors, exact color and combine colors).





Button: LetterSize



Left click

When this mode is enabled, you can edit the letter size of the TextDraw with mouse or keys.

You can ajust movement speed with the keys:



Right click

Will display a dialog for introduce exact cords.





Button: Outline





Left click

When this mode is enabled, you can edit the Outline with mouse or keys.



Right click

Will display a dialog for introduce Outline level.





Button: Shadow





Left click

When this mode is enabled, you can edit the shadow with mouse or keys.

If outline is on you can't see the shadow.



Right click

Will display a dialog for introduce shadow level.





Button: Use Box



Left click

Enable/Disable the box of a normal TextDraw.



Right click

Right click doesn't perform any action.





Button: Alignment



Left click

Switches between different alignment types.



Right click

Right click doesn't perform any action.





The tutorial will continue down.



Button: Global/Player





Left click

Switches between Global TextDraw or PlayerTextDraw.

This function hasn't effect on TDEditor, only on the exported project.



Right click

Right click doesn't perform any action.





Button: Selectable





Left click

Enable/Disable the 'selectable mode' of the TextDraw.

This function hasn't effect on TDEditor, only on the exported project.



Right click

Right click doesn't perform any action.





Button: Proportionality



Left click

Enable/Disable the 'proportion' of the TextDraw.



Right click

Right click doesn't perform any action.





Button: Models



Left click

When this mode is enable, you can edit RotX, RotY, RotZ, Zoom (see video) by moving the mouse at the corners (with left click pressed).



Right click

Will display a dialog with some functions (change modelid, edit rotx, edit roty, edit rotz, edit zoom, edite vehicle color 1, edit vehicle color 2).





Button: Modelid


  distributed enumerators - enums
Posted by: hastlaking - 2019-04-18, 12:34 AM - Forum: Pawn Scripting - Replies (3)

example:



Code:
enum E_ADMIN_DATA



{

? ? ? e_admin_position_none = 0,

? ? ? e_admin_position_admin = 1

}



enum E_PLAYER_DATA



{

? ? ?e_id,

? ? ?e_name[MAX_PLAYER_NAME],

? ? ?E_ADMIN_DATA:e_admin,

}



new player[MAX_PLAYERS][E_PLAYER_DATA];

....



public OnPlayerConnect(playerid)

{

? ? ?// will it be like so.....?

? ? ?player[playerid][e_admin] = E_ADMIN_DATA:e_admin_position_none;

? ? ?return 1;

}



RetrieveAdminLevel(playerid, E_ADMIN_DATA:level)

{

? ? ? ?switch(level) { .... }

? ? ? ?return level;

}



can any of the code i gave as an example will help distributing data into enums/arrays to its usage?


  A logo I created years ago for my community
Posted by: JustMichael - 2019-04-18, 12:20 AM - Forum: Art - Replies (14)

The Story



So around about 5 - 6 years ago, after I had just left college and had gotten myself my first job as a UI/UX designer, at a fairly big company in the middle of Leicester. At this time I was also part time managing a game community I had previous started a year ago. So having been at this company for around 6 - 7 months I felt I had?learned enough that I started giving Logo design a chance, now this being my first time at it, it didn't go too well. Some of my designs were kinda crazy, and it wasn't until around about 3 months after I started trying to learn the process, I got stuck. I had hit a brick wall, for the life of me I wasn't able to get any further, my designs were all right?at this point but nothing creatively amazing.?



So at this?point in time my gaming community needed to be expanded, and it really did need a complete makeover, I had a decent website, but it was looking outdated (This was about the time I really pushed myself into web development). At this point I had been trying to perfect logo design and I had a community that needed work, so this is where I merged the two together and decided I was going to use my newly found talent for logo design, to come up with a logo that would take my community to the next level, of course at first this was anything but next level, they lacked the creativity and branding it needed. Which made me work harder and longer.



So I had just finished bringing my web development skills up to par with the latest trends at the time, and decided to take another go at designing a logo for my community, I had just watched about 8 - 9 videos on the process of designing a logo and how branding works. So I finally felt I?was ready, and I went to work designing and re-designing my logo, and it took a couple of revisions (12 to be exact)?before finally I got what I wanted. I had?finally created a logo that I felt I was very happy with, it fitted well with my current community and the colours were the correct fit. I had done it, given life back to my community. So this is where my story ends, and down below you can see the final outcome of my efforts.



The Final Outcome



[Image: logo-full.png]



I hope this inspires others to share their story as well as their designs :)


  Burgershot Outage Post-mortem
Posted by: Southclaws - 2019-04-18, 12:06 AM - Forum: Tech - Replies (2)

Hey everyone!



This is a post-mortem of the forum outage. This was reported?2019-04-17 at 21:28 GMT and resolved 2019-04-18 at 00:56 GMT.



The outage was caused by a disk filling up with logs from another service running on the same machine.



Cause of why the logs of this service reached 335237897538 bytes are currently unknown. It seems that Docker does not rotate logs for services that run indefinitely. The service in question has been online since October 2018 and log output has built up substantially.





Code:
-rw-r-----? 1 root root 335237897538 Apr 17 23:45 384a7fd0aff65a82d3dfb406767edcbf5a16d321404a5b1848cfdc3ead95f624-json.log



The node is configured with the default logging driver: https://docs.docker.com/config/container...json-file/



Steps to Prevent



So, to prevent this happening again I am going to do something I have been meaning to do for a long time and move logging aggregation to an external service. This is yet to be decided but I should have some time before this happens again.



In the meantime, I will be configuring AlertManager (Prometheus) to properly alert me (and potentially other staff members) of these issues ahead of time so we can mitigate these events before they happen.



-



Thank you for your understanding, we live and learn!


  I need some help with my /whois command.
Posted by: Stefhan - 2019-04-17, 07:20 PM - Forum: Pawn Scripting - Replies (2)

So I am trying to create a /whois command that does the following:



You type '/whois character Sean_Johnson' for example.



As a result, you get this string/msgbox:



SQLID: 10

Account: Stefhan

Characters: Sean_Johnson, Carl_Johnson, Kendl_Johnson

CHRIDS: 40, 41, 49

Level: 10, 5, 8



However, the info required is in two seperate tables (accounts & characters), which is where I get stuck. I simply don't know how to proceed. Can anyone guide me further? What is an?efficient way to do this??Am I even doing it right? I appreciate the assistance.



PHP Code:
CMD:whois(playeridparams[])

{

? ? if(
Account[playerid][Admin] >= 2)

? ? {

? ? ? ? new 
subcmd[30], scmd_params[30];



? ? ? ? if(
sscanf(params"s[30]S()[30]",subcmdscmd_params))

? ? ? ? ? ? return 
SendClientMessage(playeridCOLOR_INFO"/whois [character/chrid/account/sqlid]");





? ? ? ? 
// whois character subcmd

? ? ? ? if(strmatch(subcmd"character"))

? ? ? ? {

? ? ? ? ? ? new 
target[MAX_PLAYER_NAME], str[128];



? ? ? ? ? ? if(
sscanf(params"s[30]s[24]",subcmdtarget))

? ? ? ? ? ? ? ? return 
SendClientMessage(playeridCOLOR_INFO"/whois character [Character_Name(case sensitive)]");



? ? ? ? ? ? new 
query[250];

? ? ? ? ? ? 
mysql_format(MHRP_SQLquerysizeof(query), "SELECT SQLID FROM characters WHERE CharName = '%e'",target);

? ? ? ? ? ? 
mysql_tquery(MHRP_SQLquery"OnWhoIsCharacter""is"playeridtarget);

? ? ? ? }



? ? ? ? 
// whois chrid subcmd

? ? ? ? if(strmatch(subcmd"chrid"))

? ? ? ? {



? ? ? ? }



? ? ? ? 
// whois account subcmd

? ? ? ? if(strmatch(subcmd"account"))

? ? ? ? {

? ? ? ? ? ??

? ? ? ? }



? ? ? ? 
// whois sqlid subcmd

? ? ? ? if(strmatch(subcmd"sqlid"))

? ? ? ? {

? ? ? ? ? ??

? ? ? ? }



? ? ? ? 
// if no strmatch

? ? ? ? else return SendClientMessage(playeridCOLOR_ERROR"That subcommand does not exist.");

? ? }



? ? else return 
SendClientMessage(playerid,COLOR_ERROR,"You do not have the required access to execute this command.");



? ? return 
1;

}



forward OnWhoIsCharacter(playeridtarget[]);

public 
OnWhoIsCharacter(playeridtarget[])

{

? ? if(
cache_num_rows() != 1)

? ? ? ? return 
SendClientMessage(playeridCOLOR_ERROR"That character does not exist.");



? ? new 
targetid;

? ? 
cache_get_value_name_int(0"SQLID"targetid);



? ? 
mysql_format(MHRP_SQLquerysizeof(query), "SELECT CHRID, CharName, Level FROM characters WHERE SQLID = %d LIMIT 3"targetid);

? ? 
mysql_tquery(MHRP_SQLquery"OnWhoIsCharacterProcess""ii"playeridtargetid);

? ? return 
1;

}



forward OnWhoIsCharacterProcess(playeridtargetid);

public 
OnWhoIsCharacterProcess(playeridtargetid)

{

? ? new 
str[500], C_IDC_Name[MAX_PLAYER_NAME], C_LVL;

? ? for( new 
id 0id cache_num_rows(); id)

? ? {

? ? ? ? 
cache_get_value_name_int(id"CHRID"C_ID);

? ? ? ? 
cache_get_value_name(id"CharName"C_Name);

? ? ? ? 
cache_get_value_name_int(id"Level"C_LVL);



? ? ? ? 
format(strsizeof(str), "%d %s %d\n"C_IDC_NameC_LVL);

? ? ? ? 
SendClientMessage(playeridstr);

? ? }



? ? new 
query[250];

? ? 
mysql_format(MHRP_SQLquerysizeof(query), "SELECT Username FROM accounts WHERE SQLID = %d"targetid);

? ? 
mysql_tquery(MHRP_SQLquery);



? ? new 
A_Name[MAX_PLAYER_NAME];

? ? 
cache_get_value_name(0"Username"A_Name[24]);

? ? return 
1;