need help in some cmmds!
#1

i need a pawn code for whisper command /w
and for goto command
Reply
#2

This is Scripting Help forum, not a place to request script.
Try to Search, there are many tutorials for it.
Reply
#3

try this for whisper
Код:
CMD:whisper(playerid,params[]) {
	new message,sendername[MAX_PLAYER_NAME],string[128];
	if (sscanf(params, "s", message)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /(w)hisper [message]");
	GetPlayerName(playerid, sendername, sizeof(sendername));
	format(string, MAX_CHATBUBBLE_LENGTH, "Says: %s", message);
	SetPlayerChatBubble(playerid,string,MESSAGE_COLOR,35.0,10000);
	return 1;
}
CMD:w(playerid,params[]) {
	return cmd_whisper(playerid,params[]);
}
Reply
#4

pawn Код:
CMD:whisper(playerid,params[])
{
  new name[MAX_PLAYER_NAME],string[128],msg[128]; //Taking string arrays to store name, message and to format text.
  if (sscanf(params, "s[128]", message)) //using sscanf to store the whispered text.
  {
    SendClientMessage(playerid, -1, "USAGE: /(w)hisper [message]"); //if the text is not stored in message.
    return 1;
  }
  else
  {
     new Float:x,Float:y,Float:z; //variables to get player's position
     GetPlayerPos(playerid, x, y, z); //getting the position
     GetPlayerName(playerid, name, sizeof(name)); //getting the player's name
     format(string,sizeof(string), "%s whispers: %s",name, message); //formating the text
     for(new i=0;i<MAX_PLAYERS;i++) //looping
     {
         if(IsPlayerConnected(i)) //checking if players are connected.
         {
           if(IsPlayerInRangeOfPoint(i, 10.0, x, y, z); //checking the range so that we can display the whispered message
           {
              SendClientMessage(i,-1,string); //displaying the message to the players who are nearby to the sender.
           }
         }
     }

  }
  return 1;
}
pawn Код:
CMD:w(playerid, params[])
{
  return cmd_whisper; //adding this, so that you can also whisper by using /w
}
EDIT: Added explanation. Thank you Clad
Reply
#5

Quote:
Originally Posted by ScripteRNaBEEL
Посмотреть сообщение
try this for whisper
Код:
CMD:whisper(playerid,params[]) {
	new message,sendername[MAX_PLAYER_NAME],string[128];
	if (sscanf(params, "s", message)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /(w)hisper [message]");
	GetPlayerName(playerid, sendername, sizeof(sendername));
	format(string, MAX_CHATBUBBLE_LENGTH, "Says: %s", message);
	SetPlayerChatBubble(playerid,string,MESSAGE_COLOR,35.0,10000);
	return 1;
}
CMD:w(playerid,params[]) {
	return cmd_whisper(playerid,params[]);
}
You are not helping him in giving codes, he must learn to do it by himself
Reply


Forum Jump:


Users browsing this thread: