|
|
#1 |
|
Big Clucker
![]() ![]() Join Date: Aug 2011
Posts: 101
Reputation: 1
|
how i can add command /duty for admin only pls help iam two day sreach for it
|
|
|
|
|
|
#2 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2008
Location: New Zealand
Posts: 3,005
Reputation: 368
|
|
|
|
|
|
|
#3 |
|
Big Clucker
![]() ![]() Join Date: Aug 2011
Posts: 101
Reputation: 1
|
he get me error if add it pls can one this command and picture how i add it and i will comment it i need it today pls fast
|
|
|
|
|
|
#4 |
|
Banned
![]() Join Date: Apr 2012
Location: Locating....
Posts: 112
Reputation: 12
|
pawn Code:
code isnt mine i Just Copied It from Walsh credit goes to Walsh |
|
|
|
|
|
#5 |
|
Big Clucker
![]() ![]() Join Date: Aug 2011
Posts: 101
Reputation: 1
|
man how i step it
|
|
|
|
|
|
#6 |
|
Banned
![]() Join Date: Apr 2012
Location: Locating....
Posts: 112
Reputation: 12
|
step? it? ;o
i cannot understand you? what are you trying to say? please improve your english |
|
|
|
|
|
#7 |
|
Big Clucker
![]() ![]() Join Date: Aug 2011
Posts: 101
Reputation: 1
|
how i can add this command to my server
|
|
|
|
|
|
#8 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Apr 2011
Location: Romania,Brasov,Brasov
Posts: 926
Reputation: 81
|
Alking in the early years of computers advanced science there was something called copy paste,wih during time evoluated really much,AND it allows you to ADD THE command to your server.
|
|
|
|
|
|
#9 |
|
Big Clucker
![]() ![]() Join Date: Aug 2011
Posts: 101
Reputation: 1
|
iam add it and start game and i type /aduty he not work why
|
|
|
|
|
|
#10 |
|
Little Clucker
![]() Join Date: May 2010
Location: On your fence-post
Posts: 20
Reputation: 0
|
You can always optionally download administrative filter scripts and such, but if you're looking into actually learning to code and branching out on your own - It's best you script it yourself so you know how the script is setup and what you can expect of the results. It'll save you time and possibly the frustration of trying to figure a completely different system out. But don't get me wrong, simply looking at other released gamemodes and experimenting on your own while you're getting started will do you good.
I'd like to note that I only just started scripting a couple months ago, so if I appear to be wrong in some aspect, feel free to correct me as needed. So to start you off and answer the original question, we're going to create a new variable to store the said admins admin duty status. A variable in this case (Assuming that you're new to Pawn) is going to be a memory 'plot' so-to-speak, as previously mentioned to store the status. That said, we'll want to create this variable above 'OnGameInIt', or if your creating this as a filterscript, 'OnFilterScriptInit'. To create a new variable, you may use: pawn Code:
However, if you're planning on having anymore than a single administrator, you'll want to create a variable for every possible player who might be an admin. To do this, we'll make use of the "MAX_PLAYERS" tag, which will create a new variable for every player slot your server is set to allow. To do this, change the previous variable to: pawn Code:
Ok, so now that we've got that covered, we'll need to make sure that when an administrator quits, his player id isn't still set as an admin for when a non-admin joins with the same playerid. To do this, we'll go down to 'OnPlayerDisconnect'.. It should look something similar to this: pawn Code:
..and use this to set the variable to 0 (Which will later represent Off-duty, whereas 1 will represent on-duty). pawn Code:
0. We use a semicolon to close variables, meaning we've got nothing else to define/set that variable as. Wonder why there's a 'return 1' inside the brackets? Every time we run a function, you need to return something back to the main callback so it is informed that the command was executed, otherwise the compiler will give you an error message. (I'm not exactly clear on the reasons as of yet to go about preaching in detail. If I should appear wrong, please do correct me.)You should have something like this. pawn Code:
Alright, so now let's create the command and the result of what this command will be. Right then, let's scroll on down to the callback 'OnPlayerCommandText'. It should look something similar to this: pawn Code:
The line: pawn Code:
pawn Code:
Alright then, let's move on and get you started coding. First thing's first, let's check to see if the player (playerid) already has /aduty enabled or disabled. Based on this result, we can tell the script to do multiple thing's which I'll explain later. For now, we'll do something like we did earlier, setting the AdminDutyStatus variable to 0 on playerdisconnect, only instead this time we'll set the variable to 1, which will represent 'On-duty'. You should now have something like this: pawn Code:
pawn Code:
pawn Code:
pawn Code:
pawn Code:
Good luck. If you've got any questions or would like to hear more, feel free to send me a forum PM or hit me up on skype/MSN. MSN: redgamefreaks_staff@ymail.com Skype: hawkseye95 ps. Wrote this up @ 3am, expect grammar fails. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [HelpPls] iam need make command for admin name /duty | alking282 | Scripting Help | 4 | 13/04/2012 10:19 PM |
| Admin Duty Command | State_Trooper | Scripting Help | 5 | 29/10/2011 03:33 AM |
| Admin Duty help | SpiderWalk | Help Archive | 3 | 04/04/2011 02:14 AM |
| Admin On Duty command help | darkknight123 | Help Archive | 2 | 12/01/2011 02:59 PM |