Not only PM.. all of the chats, like LS-RP
pawn Код:
if(strcmp(cmd, "/pm", true) == 0) // By Daniel
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[USAGE] /pm [playerid/PartOfName] [text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(HidePM[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "** That player is blocking messages!");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
new h, mi, s;
new y1, m, d;
gettime(h,mi,s);
getdate(y1, m, d);
if(giveplayerid == playerid)
{
format(string, sizeof(string), "* %s mutters something to himself.", sendername);
ProxDetector(5.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "[USAGE] (/pm) [playerid/PartOfName] [text]");
return 1;
}
format(string, sizeof(string), "* PM From %s (%d): %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
PlayerPlaySound(giveplayerid, 1055, x,y,z);
format(string, sizeof(string), "* PM Sent to %s (%d): %s", giveplayer, giveplayerid, (result));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [PM] to %s: (%s)",d,m,y1,h,mi,s, sendername,giveplayer, result);
PMLog(string);
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pViewPms] == 1 && PlayerInfo[i][pAdmin] >= 1)
{
format(string, sizeof(string), "[ADMIN]: %s (%d) Has sent a PM to %s (%d) - (%s)",sendername, playerid, giveplayer, giveplayerid, (result));
SendClientMessage(i, COLOR_LIGHTRED, string);
}
}
}
return 1;
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
I want it to be ex. /pm 1 "LINE1"hey bro blabla bla[max limit]" so it will go to next line and it will contunie, "LINE2:blabla."
Can you help me do this ? and can you show me the code that you put in ? becuase i want to /ad and more.