SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Archive

 
 
Thread Tools Display Modes
Old 16/11/2009, 09:20 PM   #1
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Posts: 7,012
Reputation: 83
Default [HR/SR:FS] Fast rcon command processor: RCMD (modified DCMD)

Ovo sam napravio već neko vrijeme nazad ali kad sam vidio ovo onda sam se odlućio da ću i ja postat svoju verziju.

Znaći, ovo radi isto kao dcmd ali samo je razlika da je ova funkcija za rcon komande.

Funkcija:
Code:
#if !defined RCMD_PREFIX
#define RCMD_PREFIX "/"
#endif
Code:
#if !defined rcmd
#define rcmd(%1,%2,%3) if((strcmp((%3), RCMD_PREFIX #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (rcmd_%1(""))) || (((%3)[(%2) + 1] == 32) && (rcmd_%1((%3)[(%2) + 2]))))) return 1
#endif
Primjer:
Code:
public OnRconCommand(cmd[])
{
  rcmd(amsg, 4, cmd); // because amsg has 4 characters.
  return 0;
}

// EXAMPLE RCON-CONSOLE COMMAND:
rcmd_amsg(command[])
{
  if(!strlen(command))
  {
    printf("Correct usage: '%samsg [text]'", RCMD_PREFIX);
    return 1;
  }
  SendClientMessageToAll(0xFF0000AA, command);
  printf("Admin: %s", command);
  return 1;
}
Zasluge:
DracoBlue - [HowTo] Fast command processor: DCMD (0.2 Ready)
__________________
I'm still working on the LI-RP script and I'm not answering the PMs related to it. I don't need any beta-testers, so don't send me any PMs about it.

I also don't script for the money, so don't send me PMs about that, too.
Correlli is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] zcmd 0.3.1 | Fast & Simple Command Processor (updated 30/10/2009) Zeex Includes 500 15/04/2013 09:05 AM
[HowTo] Fast command processor: DCMD (0.3 Ready) DracoBlue Help Archive 9 28/11/2010 11:13 AM
fast command processor [mad]MLK Help Archive 1 22/08/2009 01:32 AM
Fast rcon command processor: RCMD (modified DCMD) Correlli Filterscripts 7 01/08/2009 12:02 PM
rcmd, like dcmd but for rcon commands! Daren_Jacobson Help Archive 4 02/03/2009 09:02 PM


All times are GMT. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.