[HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! - 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: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! (
/showthread.php?tid=150679)
[HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Darkly_Face - 27.05.2010
I tried to make command /pm .....
i got some errors!
Код:
(672) : error 001: expected token: "-string end-", but found "-identifier-"
(672) : warning 215: expression has no effect
(672) : warning 215: expression has no effect
(672) : error 029: invalid expression, assumed zero
(672) : fatal error 107: too many error messages on one line
In this command:
Код:
dcmd_pm(playerid, params[])
{
if (strlen(params))
{
new id;
id = strval(params);
if (IsPlayerConnected(id))
{
new message[256];
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
message = "No Message";
SendClientMessage(id, 0x00FF00AA, "PM:(%s)%s:%s" playerid, name, message);
SendClientMessage(playerid, 0x00FF00AA, "PM send!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/pm <playerid> <message>\"");
}
return 1;
}
please help me!!!!
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Conroy - 27.05.2010
Which line is 672?
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Darkly_Face - 27.05.2010
Код:
SendClientMessage(id, 0x00FF00AA, "PM:(%s)%s:%s" playerid, name, message);
this!
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
coole210 - 27.05.2010
This is why your getting errors:
Код:
message = "No Message";
Replace with:
Код:
strmid(message, "No Message", 0, 255, 255);
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Darkly_Face - 27.05.2010
still errors:
Код:
(672) : error 001: expected token: "-string end-", but found "-identifier-"
(672) : warning 215: expression has no effect
(672) : warning 215: expression has no effect
(672) : warning 215: expression has no effect
(672) : error 001: expected token: ";", but found ")"
(672) : error 029: invalid expression, assumed zero
(672) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Conroy - 27.05.2010
You cannot put formats into a SendClientMessage, you need to format the string beforehand.
pawn Код:
SendClientMessage(id, 0x00FF00AA, "PM:(%s)%s:%s" playerid, name, message);
replace with:
pawn Код:
new message[128];
format(message,sizeof(message), "PM:(%d)%s:%s", playerid, name, message);
SendClientMessage(id, 0x00FF00AA, message);
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
coole210 - 27.05.2010
Quote:
Originally Posted by Conroy
You cannot put formats into a SendClientMessage, you need to format the string beforehand.
pawn Код:
SendClientMessage(id, 0x00FF00AA, "PM:(%s)%s:%s" playerid, name, message);
replace with:
pawn Код:
new message[128]; format(message,sizeof(message), "PM:(%d)%s:%s", playerid, name, message); SendClientMessage(id, 0x00FF00AA, message);
|
Lol didn't notice that at all
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Darkly_Face - 27.05.2010
THANK YOU!!!!
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Conroy - 27.05.2010
Learn from your mistakes

.
Re: [HELP]PLEASE HELP ME WITH /PM COMMAND!!!!! -
Darkly_Face - 27.05.2010
yeah i will xD