How do i use DCMD?
#1

I put this into OnPlayerCommandText. It's suppose to send what you type in /notice to the server log.

Код:
dcmd_notice(playerid,params[])
{
  new string[128];
  if(sscanf(params,"s",string)) {
    SendClientMessage(playerid,COLOR,"[USAGE] /notice [text] (this will text something in the server log)");
  }
  else {
    printf("[PLAYER NOTICE] %s",string);
    SendClientMessage(playerid,COLOR,"[SUCCESFULL] You have successfully printed something into the servers log");
  }
  return 1;
}
Код:
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(91) : error 017: undefined symbol "dcmd_notice"
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(92) : warning 217: loose indentation
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(94) : error 017: undefined symbol "sscanf"
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(95) : error 017: undefined symbol "COLOR"
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(99) : error 017: undefined symbol "COLOR"
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(103) : warning 225: unreachable code
E:\Documents and Settings\salim\My Documents\Sa-mp\filterscripts\print.pwn(103) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

https://sampwiki.blast.hk/wiki/Sscanf_code
https://sampwiki.blast.hk/wiki/Dcmd

Reply
#3

1. Put it outside your callbacks
2. Use the sscanf link KnooL provided
3. Put dcmd(notice, 6, cmdtext); in OnPlayerCommandText
4. Replace COLOR with 0xFFFFFFFF

Just to get you going
Btw still use the links KnooL provided..
Reply
#4

He sended me a PM with his 'starting' GM and helped him and fixed the whole thing as he told that he is a beginnner at PAWN. I'am happy to help.

Consider this as solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)