HELPREQ - Commands
#1

NOTE: PEOPLE WHO CAN'T HELP AND ASK ME TO USE THE SEARCH FUNCTION IS NOT WELCOME!
This is a scripting discussion section, and I have been searching, but I get Server Advertisments only. If you can't help and know everything, gtfo.


First, 'FAQ':

Are you a n00b? Yes, I am.
Why don't you use the search function?: Bullshit. I have tried.
Are you gonna pay me for my help?: No.

Note: I'm creating a completly new script, from scratch.
================================================== ======================================
Question: How do I create a command, such as /duty works in PEN1LS, and Godfather, in the easiest way?

(I'm talking about a commands, that gives you the rights to use certain command, that you cannot use as a normal civilian).

================================================== ======================================


If I got the question above answered, I would like to know the following:
================================================== ======================
Question: How do I create a command, that makes the player a normal civilian again?

(I'm talking about a command, that removes your right to use the certain commands you got the right to, when you typed the command above. (Like a logoff command)..

================================================== ======================

================================================== ======================================
Question: How do i Create a command that sends a message to a person who have logged in to a group with the command above?

(I'm talking about a command, that can be used to send messages to a certain group, that have logged in with the command I asked for above. (Like a /report command)).

================================================== ======================================


[color=red]OBS! I do NOT want the command change your skin, and I do not want a Team that you can select where you browse between classes.

Thank you for your time, reading this. If you can help me, you cant imagine how happy I'd be!

Yes, It's supposed to be a Admin login system.
Reply
#2

first we would be needing to see your script as far as you made it, if you didn't make anything at all, start scripting and make the CORE, than come back post the script and maybe we can help.

as for report:

pawn Код:
new string[128];
if(!strcmp(cmdtext, "/report", true))
{
  if(cmdtext[8] == 0)
  {
    SendClientMessage(playerid, GRAY, "Fill something in.");
  }
  new playername[26];
  GetPlayerName(playerid, playername, 26);
  format(string, sizeof(string),"%s reported: %s", playername, cmdtext[8]);
  for(new i=0;i<MAX_PLAYERS;i++)
  {
    if(PlayerInfo[i][Admin] > 0) {
    SendClientMessage(i, RED ,string);
  }
  return 1;
}
Reply
#3

new string[128]; What does new string[128]; do?
if(!strcmp(cmdtext, "/report", true))
{
if(cmdtext[8] == 0)
{
SendClientMessage(playerid, GRAY, "Fill something in.");
}
new playername[26]; What does it do? (New Playername, and What does the '26' stand for?
GetPlayerName(playerid, playername, 26);
format(string, sizeof(string),"%s reported: %s", playername, cmdtext[8]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerInfo[i][Admin] > 0) {
SendClientMessage(i, RED ,string); Is it only sent to RCON admins? I mean, No, I haven't done anything so no Admins system yet.
}
return 1;
}
Reply
#4

Quote:
Originally Posted by mavtias
new string[128]; What does new string[128]; do?
if(!strcmp(cmdtext, "/report", true))
{
if(cmdtext[8] == 0)
{
SendClientMessage(playerid, GRAY, "Fill something in.");
}
new playername[26]; What does it do? (New Playername, and What does the '26' stand for?
GetPlayerName(playerid, playername, 26);
format(string, sizeof(string),"%s reported: %s", playername, cmdtext[8]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerInfo[i][Admin] > 0) {
SendClientMessage(i, RED ,string); Is it only sent to RCON admins? I mean, No, I haven't done anything so no Admins system yet.
}
return 1;
}
Also the first two questions show us that you have no (or not much) clue about basics in pawn
So I recommend you to read a tutorial and they can be founded in wiki => Click
And if you dont know what you should click in the wiki, its "Scripting Basics"

To your third question about "SendClientMessage", you can find information about that function there, too
For that you just need to select "Scripting Functions" on the main page and then search for the function name

To your first post you said that you want an easy Admin system, for that you go again to wiki main page
And look to the right site where stands "Tutorials", there you can find "PAWN tutorial" and "Creating an Admin Script"
I suggest to read both, they will help you creating an admin system

If you have any other questions, use search, the wiki, pawn-lang.pdf, or the irc channel (#samp, #samp-scripting)
Reply
#5

You're right, I'm a n00b. I know what SendClientMessage does, but Where do it send it was my question (cuz of the " if(PlayerInfo[Admin]" on the line above)

I've tried doing the tutorials there, but I just don't get it :S I maybe starting too late, I'm 16.... lol I dunno why I just cant get it, when I was like 11 I learned a little HTML, but that was very very easy to learn, Even tho i thought it was as difficult as Pawn feels for me today. Even if Pawn seems to be one of the most obvious code-languages. :/
Reply
#6

Quote:
Originally Posted by mavtias
Even if Pawn seems to be one of the most obvious code-languages. :/
Yes thats right.

Quote:
Originally Posted by mavtias
I know what SendClientMessage does, but Where do it send it was my question (cuz of the " if(PlayerInfo[Admin]" on the line above)
Ah, ok. You see that PlayerInfo is an array, so it sends the message to all if "Admin" is more than 0.
I think he wrote it in hurry and so it have this mistakes, like the missing bracket ofter SendClientMessage.
And no, it doesnt send it to Rcon admins, if you want know if a person is a rcon admin you need to use "IsPlayerAdmin"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)