SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 16/11/2009, 10:20 PM   #1
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Posts: 7,035
Reputation: 103
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)
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 534 28/07/2014 06:52 AM
[HowTo] Fast command processor: DCMD (0.3 Ready) DracoBlue Help Archive 9 28/11/2010 12:13 PM
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 10:02 PM


All times are GMT. The time now is 10:41 PM.


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