OOC CHAT!!!
#1

*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?
Reply
#2

->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.
Reply
#3

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
Reply
#4

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;
}
Reply
#5

Код:
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...
Reply
#6

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)