Admin cmds
#1

Hello scripters,
I was wondering if I am able to script my own admin commands,
I'm new to scripting so please explain me a bit detailed please.
Do I need to get a basic admin system script? And can I change th CMDS then to how I want?

Regards,
tamara
Reply
#2

well a good start would be to atleast LOOK at an admin system

learn how to use an ini system such as y_ini, d_ini or a mysql system
learn how to use a command processor such as YCMD,ZCMD,DCMD
learn to use sscanf2 and learn the basics about the pawn language.

from there youll have no trouble.
Reply
#3

Well I think looking at a admin system is temping to just say fuck it and give up, Then use the one you downloaded I would rather give you some examples on skype so feel free to add me: hewlett_t

However the basics of a admin system is a save system, To create a save system you need A enum, A saving system. Now the save system is down to you and I cant help you with that until you state clearly which system you choose to use. However I can give some examples of enums and a save function, I presonally recommend MySQL if you want a user control panel or Y_INI for a flat file format.

So enums.

pawn Код:
enum pInfo // This declares to the script that its a enum so there is more for it to do, pInfo states the nums name so it can be used in a array.
{
       pPass,
       pAdmin// These are where you delcare the variables for the array.
}
new PlayerInfo[MAX_PLAYERS][pInfo]; // THis declares what the array is 'PlayerInfo' So it can be referd to in a command. 'MAX_PLAYERS' tells the array how meny there is. 'pInfo' tells the array to look into that enum

Usage of an array, Using ZCMD

pawn Код:
CMD:makemeadmin(playerid)
{
       PlayerInfo[playerid][pAdmin] = level; // level being the level you want set however this i basic and for a read up on it or a tutorial properly I'd rather show you an example through TeamViewer or somthing.
      return 1; // The end of the command
}
The saving I will have to show you later if you add me or you can read up on this tutorial

https://sampforum.blast.hk/showthread.php?tid=273088

P.S If you do add me on Skype do not spam me as i'm helping other people. If you do spam me I will block you and I will not help you directly through skype.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)