whisper cmd
#1

hi guys i'm trying to find a whisper command like /w [text] i tried to find that cmd but all my search didn't work with me so i hope you can help me thanks alote
Reply
#2

using ZCMD
pawn Код:
COMMAND:whisper(playerid,params[])
{
   new string[250];
   if(sscanf(params,"s[250]",string)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/whisper [message]");
   SetPlayerChatBubble(playerid,string,COLOR_YELLOW,35,10000);
   new Float:x,Float:y,Float:z;
   GetPlayerPos(playerid,x,y,z);
   new pName[24];
   GetPlayerName(playerid,pName,sizeof(pName));
   new string2[250];
   format(string2,sizeof(string2),"%s(%d):%s",pName,playerid,string);
   for(new i=0;i<=MAX_PLAYERS;i++)
   {
     if(IsPlayerInRangeOfPoint(i,15.0,x,y,z)) return SendClientMessage(playerid,COLOR_YELLOW,string2);
   }
 return 1;
}
Reply
#3

i need the zcmd kind this script not working with me i need one like this for explane : if (strcmp("/w", cmdtext, true, 10) == 0)
Reply
#4

First you need to download file. from ZCMD
Then copy/move file zcmd.ini to your yourserver/pawn/include.
Finally add this in top of your gamemode script.
pawn Код:
#include <zcmd>
Reply
#5

ok i will try it
Reply
#6

there is some errors
Quote:

D:\PC_GTA.SanAndreas -(rip)-(ToeD)\samp\gamemodes\AmericaVsUK.pwn(291) : warning 217: loose indentation
D:\PC_GTA.SanAndreas -(rip)-(ToeD)\samp\gamemodes\AmericaVsUK.pwn(295) : warning 217: loose indentation
D:\PC_GTA.SanAndreas -(rip)-(ToeD)\samp\gamemodes\AmericaVsUK.pwn(419) : error 029: invalid expression, assumed zero
D:\PC_GTA.SanAndreas -(rip)-(ToeD)\samp\gamemodes\AmericaVsUK.pwn(419) : error 017: undefined symbol "cmd_whisper"
D:\PC_GTA.SanAndreas -(rip)-(ToeD)\samp\gamemodes\AmericaVsUK.pwn(419) : error 029: invalid expression, assumed zero
D:\PC_GTA.SanAndreas -(rip)-(ToeD)\samp\gamemodes\AmericaVsUK.pwn(419) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#7

Quote:
Originally Posted by GGW
Посмотреть сообщение
there is some errors
Mind showing the error lines?
Reply
#8

this one
Quote:

COMMAND:whisper(playerid,params[])

and when i change it to
Quote:

if (strcmp("/w", cmdtext, true, 10) == 0)

it don't make my gamemode work
Reply
#9

ok i change it to this
Код:
if (strcmp("/w", cmdtext, true, 10) == 0)
    {
    new string[250];
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE:/whisper [message]");
    SetPlayerChatBubble(playerid,string,COLOR_YELLOW,35,10000);
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    new pName[24];
    GetPlayerName(playerid,pName,sizeof(pName));
    new string2[250];
    format(string2,sizeof(string2),"%s(%d):%s",pName,playerid,string);
    for(new i=0;i<=MAX_PLAYERS;i++)
    {
     if(IsPlayerInRangeOfPoint(i,15.0,x,y,z)) return SendClientMessage(playerid,COLOR_YELLOW,string2);
    }
    return 1;
}
to make it work with me and it don't have any errors but when i try it it says
Quote:

SERVER: Unknown command

what to do to make it work ?
Reply
#10

Quote:
Originally Posted by GGW
Посмотреть сообщение
ok i change it to this
Код:
if (strcmp("/w", cmdtext, true, 10) == 0)
    {
    new string[250];
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE:/whisper [message]");
    SetPlayerChatBubble(playerid,string,COLOR_YELLOW,35,10000);
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    new pName[24];
    GetPlayerName(playerid,pName,sizeof(pName));
    new string2[250];
    format(string2,sizeof(string2),"%s(%d):%s",pName,playerid,string);
    for(new i=0;i<=MAX_PLAYERS;i++)
    {
     if(IsPlayerInRangeOfPoint(i,15.0,x,y,z)) return SendClientMessage(playerid,COLOR_YELLOW,string2);
    }
    return 1;
}
to make it work with me and it don't have any errors but when i try it it says what to do to make it work ?
Remove the #include zcmd, because ZCMD is not compatible with strcmp.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)