WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s (
/showthread.php?tid=112629)
WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s -
buonggiorno - 09.12.2009
Hi, here is my wisper cmd, i want that only if players are close that can wisper, i try but i cant do it :S
can you tell me what to edit? here is code
Код:
if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " not logged in !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "use: (/w)isper [playerid/PartOfName] [whisper text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(HidePM[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " That player block whisper !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(giveplayerid == playerid)
{
format(string, sizeof(string), "* %s mutters somthing.", sendername);
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
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: (/w)isper [playerid/PartOfName] [whisper text]");
return 1;
}
format(string, sizeof(string), "%s(ID: %d) whisper: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Wisper je poslat %s(ID: %d).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
SBizzInfo[2][sbTill] += txtcost / 2;
ExtortionSBiz(2, txtcost / 2);
return 1;
}
}
else
{
format(string, sizeof(string), " %d not active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Re: WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s -
lolumadd - 09.12.2009
Use
pawn Код:
GetPlayerPos(personwhosendsmessage, x, y, z);
for(new i=0 <MAX_PLAYERS; i++)
{
if(IsPlayerInRange(20, i, x, y, z)
SendWhisper
}
}
Re: WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s -
buonggiorno - 09.12.2009
can you please add that in my code i am confused dont know where to add :S
Re: WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s -
lolumadd - 09.12.2009
Now that I look at it, you can use the function "ProxDetector" to do what you are requesting. For an example look in your code.
Just reformat the string.
Re: WHISPER ONLY WHEN PLAYER ARE CLOSE - HERE IS CMD EDIT IT PLEASE :s -
buonggiorno - 09.12.2009
need to edit this line?
Код:
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
in what?