public OnPlayerText(playerid, text[])
{
new string [128];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "(( %s says: %s)) ", string, text);
SendClientMessageToAll(playerid, 0xFFFFFFFF, string);
return 1;
}
if(strcmp(string, "/lo", true) == 0)
{
object = strlen(cmdtext);
while ((idx < object) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < object) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /lo [chat]");
return 1;
}
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "((%s says: %s))", playername, result);
ProxDetector(20.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); printf(string);
}
if(strcmp(string, "/li", true) == 0)
{
object = strlen(cmdtext);
while ((idx < object) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < object) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /li [chat]");
return 1;
}
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s says: %s", playername, result);
ProxDetector(20.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); printf(string);
}
IC Chat:
pawn Код:
pawn Код:
|
new object;
new idx;
Change OnPlayerCommandText(playerid) to public OnPlayerCommandText(playerid, cmdtext[]). Write these lines beneath OnPlayerCommandText:
pawn Код:
|
public OnPlayerCommandText(playerid, cmdtext[])
{
new object;
new idx;
if(strcmp(string, "/lo", true) == 0)
{
object = strlen(cmdtext);
while ((idx < object) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < object) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /lo [chat]");
return 1;
}
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "((%s says: %s))", playername, result);
ProxDetector(20.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf(string);
}
if(strcmp(string, "/li", true) == 0)
{
object = strlen(cmdtext);
while ((idx < object) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < object) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /li [chat]");
return 1;
}
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s says: %s", playername, result);
ProxDetector(20.0, playerid, string, COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf(string);
}
return 1;
}