08.05.2011, 11:42
pawn Код:
if(strcmp(cmd, "/sotaque", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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, "Use: /sotaque [Lнngua]");
return 1;
}
SOTAQUE[playerid] = 1;
PlayerInfo[playerid][pSotaque] = strlen(result);
}
return 1;
}
pawn Код:
if(SOTAQUE[playerid] > 0)
{
new sotaque = PlayerInfo[playerid][pSotaque];
format(string, sizeof(string), "[Sotaque %s]%s Diz: %s", sotaque, sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid, text, COLOR_FADE5, 20.0, 10000);
}
else
{
format(string, sizeof(string),"%s Diz: %s", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid, text, COLOR_FADE5, 20.0, 10000);
}