SA-MP Forums Archive
OOC CHAT!!! - 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: OOC CHAT!!! (/showthread.php?tid=125642)



OOC CHAT!!! - mrbubl3s - 04.02.2010

*sighs* I can't get any chats working besides the one thats already there, so can someone give me a filterscript with at least a GOoc chat that I can work on from?


Re: OOC CHAT!!! - mansonh - 04.02.2010

->Script Request Thread

Basic pm found on samp wiki,
pawn Код:
if(!strcmp("/pm", cmdtext, true))
{
  tmp = strtok(cmdtext,idx);
  if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
  new id = strval(tmp);
  gMessage = strrest(cmdtext,idx);
  if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");     
  if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");  
  GetPlayerName(id,iName,sizeof(iName));
  GetPlayerName(playerid,pName,sizeof(pName));
  format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
  SendClientMessage(playerid,0xFFD720FF,Message);
  format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
  SendClientMessage(id,0xFFD720FF,Message);
  PlayerPlaySound(id,1085,0.0,0.0,0.0);
  return 1;
}
In another thread you managed to get /me working, so between that and this it shouldn't be to tough.


Re: OOC CHAT!!! - mrbubl3s - 04.02.2010

I put it in and i get this...

Код:
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(169) : error 017: undefined symbol "tmp"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(170) : error 017: undefined symbol "tmp"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(171) : error 017: undefined symbol "tmp"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(172) : error 017: undefined symbol "gMessage"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(172) : error 017: undefined symbol "strrest"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(173) : error 017: undefined symbol "gMessage"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(175) : error 017: undefined symbol "iName"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(175) : error 017: undefined symbol "iName"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(175) : error 029: invalid expression, assumed zero
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(175) : fatal error 107: too many error messages on one line



Re: OOC CHAT!!! - mansonh - 04.02.2010

Wow the exampe from the wiki is terrible.

So here is one using dcmd, if you don't know dcmd you should learn it now, its much better than strcmp.

pawn Код:
dcmd_pm(playerid, params[])
{
  new msg[128], rpid, iname[128], pname[128];
  if(!sscanf(params, "ds", rpid, msg) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
  if(!IsPlayerConnected(rpid)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");

  GetPlayerName(rpid,iName,sizeof(iName));
  GetPlayerName(playerid,pName,sizeof(pName));
  new Message[128];
  format(Message,sizeof(Message),">> %s(%i): %s",iName,id,msg);
  SendClientMessage(playerid,0xFFD720FF,Message);
  format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,msg);
  SendClientMessage(rpidid,0xFFD720FF,Message);
  return 1;
}



Re: OOC CHAT!!! - mrbubl3s - 04.02.2010

Код:
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(270) : error 017: undefined symbol "dcmd_pm"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(273) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(273) : error 001: expected token: ")", but found "return"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(276) : error 017: undefined symbol "iName"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(276) : error 017: undefined symbol "iName"
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(276) : error 029: invalid expression, assumed zero
C:\Documents and Settings\urmum\My Documents\samp03asvr_R4_win32\gamemodes\Creative-RP.pwn(276) : fatal error 107: too many error messages on one line
I am ashamed I don't know how to fix this...


Re: OOC CHAT!!! - mansonh - 04.02.2010

Some links on how to use dcmd.

https://sampwiki.blast.hk/wiki/Fast_Commands#dcmd

[Tutorial] Dcmd Usage!
quick rundown on using DCMD
[Tut] How to make ... using dcmd!