SA-MP Forums Archive
How do i use DCMD? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do i use DCMD? (/showthread.php?tid=122603)



How do i use DCMD? - Sal_Kings - 22.01.2010

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.



Re: How do i use DCMD? - KnooL - 22.01.2010

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




Re: How do i use DCMD? - JoeDaDude - 22.01.2010

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..


Re: How do i use DCMD? - KnooL - 22.01.2010

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