20.03.2010, 13:54
Код:
//----------------------------------[Shout]-----------------------------------------------
if(strcmp(cmd, "/doorshout", true) == 0 || strcmp(cmd, "/ds", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[640];
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: (/ds)hout [local chat]");
return 1;
}
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
format(string, sizeof(string), "*%s shouts from outside: %s.", sendername,result);
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(PlayerToPoint(60, p, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
format(string, sizeof(string), "*(door)%s shouts %s.", sendername,result);
SendClientMessage(p, COLOR_WHITE,string);
}
ProxDetector(30.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
printf("%s", string);
return 1;
}
}
}
}
return 1;
}
if(!strcmp(cmdtext, "/knock", true)) // By Frank
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
format(string, sizeof(string), "* %s knocks on the house door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(PlayerToPoint(60, p, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
SendClientMessage(p, COLOR_PURPLE, "*Knock Knock ((Door))");
}
}
}
}
}
return 1;
}
Lots of people wanted this command so i just wanted to release it.

