Ok, so I messed up everything now...
THIS command, /setaccent, sets your own accent...It should set ANOTHER player's accent, not your own..
/setaccent [Player ID/Part of name] [Accent]
PHP код:
CMD:setaccent(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 1)
{
new accent[27], string[128], tmp[256];
if(sscanf(params, "s[27]", accent))
{
SendClientMessage(playerid,0xFFFFFFAA,"Usage: /setaccent {58A624}[ Accent name ]{FFFFFF}.");
return 1;
}
if(strlen(accent) <= 6 || strlen(accent) > 26) return cmd_setaccent(playerid, ""); // recall the command /setaccent
format(string,sizeof(string),"Accent: You have changed your accent to {58A624}%s.",accent);
SendClientMessage(playerid,0xFFFFFFAA,string);
strmid(pAccent[playerid],tmp,0,sizeof(tmp),255);
}
return 1;
}
Now, another problem I have is this...
This is my OnPlayerText, I have it if the player is talking on a cellphpone or not
PHP код:
public OnPlayerText(playerid, text[])
{
if(OnCall[playerid] == -1)//If the player is not talking on a cellphone then
{
if(strlen(pAccent[playerid]) > 0)
{
format(message,sizeof(message),"%s [%s accent]: %s", GetName(playerid), pAccent[playerid], text);
ProxDetector(30.0, playerid, message, -1);
Log("/logs/chat.txt", message);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
}
else
{
format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
ProxDetector(30.0, playerid, message, -1);
Log("/logs/chat.txt", message);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
}
}
if(OnCall[playerid] != -1 )//If the player is talking on a cellphone then
{
if(strlen(pAccent[playerid]) > 0)
{
format(string,sizeof(string),"%s [Muffled %s accent](cellhpone) %s", GetPlayerNameEx(playerid), pAccent[playerid], text);
ProxDetector(20.0, playerid, string, COLOR_FADE1);
Log("/logs/chat.txt", string);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
}
else
{
format(string, sizeof(string), "(cellphone) %s says: %s", GetPlayerNameEx(playerid), text);
ProxDetector(20.0, playerid, string,COLOR_FADE1);
Log("/logs/chat.txt", string);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
}
}
if(IsPlayerConnected(OnCall[playerid]))
{
if(OnCall[OnCall[playerid]] == playerid)
{
SendClientMessage(OnCall[playerid], COLOR_YELLOW, string);
Log("/logs/cellphone.txt", message);
}
}
return 0;
}
OnPlayerConnect
PHP код:
public OnPlayerConnect(playerid)
{
new string[] = " ";
strmid(pAccent[playerid],string,0,sizeof string ,255);
return 1;
}
OnPlayerDisconnect
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new string[] = " ";
strmid(pAccent[playerid],string,0,sizeof string ,255);
return 1;
}
God faken damn it, if anyone could help it would mean the world to me