30.12.2011, 01:06
Ok I sorted everything out now.
All i need now, is in the second part:
So when you type "wtf is this!" it will work, because currently it only works if "!" is the 2nd character, and ideas? ! needs to be in somewhere but not first, it would be best if you could use it last.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0]=='.')
{
new string[256];
format(string, sizeof(string), "((%s))",text[1]);
SetPlayerChatBubble(playerid, string, COLOR_LIGHTLIGHTBLUE, 15.0, 7000);
new string2[256];
format(string2, sizeof(string2), "[ID:%d][OOC]Oscar Gonzalez: %s",playerid,text[1]);
SendClientMessage(playerid, COLOR_WHITE, string2);
return 0;
}
if(text[1]=='!')
{
new string[256];
new sendername[MAX_PLAYER_NAME];
if(gPlayerLogged[playerid] == 0)
{
return 0;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s krzyczy: %s!!", sendername, text);
ProxDetector(40.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
return 0;
}
else
{
new string[256];
new sendername[MAX_PLAYER_NAME];
if(gPlayerLogged[playerid] == 0)
{
return 0;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s mуwi: %s", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,4,4);
return 0;
}
return 1;
}
pawn Код:
if(text[1]=='!')
{
new string[256];
new sendername[MAX_PLAYER_NAME];
if(gPlayerLogged[playerid] == 0)
{
return 0;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s krzyczy: %s!!", sendername, text);
ProxDetector(40.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
return 0;
}