Help me.
#1

Im creating server and i need /help command.like with this command you can ask help from admins.
I dont know how to do it, so can someone do it to me?im giving credit to that who make it to me, thanks

i want it to be something like this:


Код:
if(strcmp(cmd, "/help", true) == 0)
	{

SendClientMessage(playerid, ERROR, "Use: /help [MESSAGE]");

{

SendClientMessageToAdmins(string);
		SendClientMessage(playerid, GREEN, "You Message Has Been Sent To Online Admins.");
Reply
#2

You have to tell us how you define the admins, is it enum or something like that or is it just rcon admins?
Reply
#3

Use zcmd/dcmd with sscanf, it is alot faster

here it is with zcmd plus sscanf

pawn Код:
COMMAND:help(playerid, params[])
{
    new string[135], cmdtext[3];
    if(sscanf(params, "s[135]", cmdtext[2])) return SendClientMessage(playerid, ERROR, "Usage: /help [MESSAGE]");
    format(string, 135, "( HELP ) %s (ID: %d): %s",PlayerName(playerid),playerid, cmdtext[2]);
    SendClientMessageToAdmins(string);
    SendClientMessage(playerid, GREEN, "Your Message Has Been Sent To Online Admins.");
    return 1;
}
Reply
#4

@Niixie, my admins are in my gamemode so idk.it is just SendClientMessageToAdmins(string);

@xir can u make that command strcmp / cmd or something.[if(strcmp(cmd, "/help", true) == 0)]
Reply
#5

No learn DCMD or ZCMD, it's easier and better. May look harder at first but it really isn't
Reply
#6

okay Steven, tell me where i put that xir's command?
Reply
#7

First you need to include ZCMD and sscanf.(If you haven't done it yet)
And then you just put this command on the bottom of your script.
Reply
#8

Look here. This is a simple tutorial/guide i guess
Reply
#9

well i guess my brains are too little to learn but this is my code now:

Код:
 if(strcmp(cmd, "/help", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /help [MESSAGE]");
		new string[250];
		format(string, sizeof(string), "[ ! ] %s[ID:%d] asks help:%s", name, playerid, strlen(tmp));
		SendClientMessageToAdmins(string);
		SendClientMessage(playerid, GREEN, "You Message Has Been Sent To Online Admins.");
	}
Reply
#10

and my problem is....when i do /help how to use car?

it says: [ ! ] Paul_Newton asks help: ow

but if i write: /help howtousecar?

it says: [ ! ] Paul_Newton asks help: owtousecar
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)