[SOLVED]Megaphone
#3

Код:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "USAGE: (/m)egaphone [megaphone chat]");
return 1;
}
if (gTeam[playerid] != 2)
{
SendClientMessage(playerid, COLOR_GRAD2, " you are not part of a team");
return 1;
}
if(!IsACopCar(tmpcar))
{
SendClientMessage(playerid, COLOR_GRAD2, " you are not in a police vehicle");
return 1;
}
format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
printf("%s", string);
return 1;
}
just use that. works perfect, and its a megaphone from an rrp script. so yah, should work.
edit it to your own needs
Reply


Messages In This Thread
[SOLVED]Megaphone - by JoeDaDude - 21.01.2010, 21:59
Re: Megaphone - by JoeDaDude - 21.01.2010, 22:25
Re: Megaphone - by TheGtaLover - 21.01.2010, 22:28
Re: Megaphone - by JoeDaDude - 21.01.2010, 22:31
Re: Megaphone - by JoeDaDude - 21.01.2010, 22:35
Re: Megaphone - by TheGtaLover - 21.01.2010, 22:43
Re: Megaphone - by Miguel - 21.01.2010, 23:05
Re: Megaphone - by [HiC]TheKiller - 21.01.2010, 23:09
Re: Megaphone - by JoeDaDude - 21.01.2010, 23:10
Re: Megaphone - by Miguel - 21.01.2010, 23:18

Forum Jump:


Users browsing this thread: 1 Guest(s)