23.08.2010, 21:37
Well, since I need a PM command in my script anyway, let me create one real fast and you can edit it to your needs....
2 - 3 minutes later:
ReturnPlayerName:
2 - 3 minutes later:
pawn Код:
COMMAND:pm(playerid, params[])
{
new user, yourmessage[128], string[128];
if(!sscanf(params, "us", user, yourmessage))
{
if(user != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "[Private Message from %s]: %s", ReturnPlayerName(playerid), yourmessage);
SendClientMessage(user, sc_Lime, string);
format(string, sizeof(string), "[Private Message to %s]: %s", ReturnPlayerName(playerid), yourmessage);
SendClientMessage(playerid, sc_Lime, string);
}
else return SendClientMessage(playerid, sc_LightRed, "ERROR: Invalid Player ID.");
}
else return SendClientMessage(playerid, sc_White, "COMMAND: /pm [playerid] [message]");
return 1;
}
pawn Код:
stock ReturnPlayerName(playerid)
{
var1="Invalid_Player_ID";
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, var1, sizeof(var1));
for(new i = 0; i < sizeof(var1); i++)
{ if(var1[i] == '_') { var1[i] = ' '; } }
}
return var1;
}