/whisper [ID] [message] help!
#9

Quote:
Originally Posted by YouHack
Посмотреть сообщение
Enjoy it
PHP код:
CMD:wisper(playeridparams[])
{
        new 
string[128],id,mess[250],giveplayer[25],sendername[25];
        if(
sscanf(params"us[250]",id,mess)) return SendClientMessage(playerid, -1"{FFFFFF}Syntax: {FFFFFF}/w <Name/Playerid> <Message>");
          if(
id != INVALID_PLAYER_ID)
          {
                if(
GetDistanceBetweenPlayers(playerid,id) > 5) return SendClientMessage(playerid,-1,"{FFFFCC}This player is not near you.");
                if(
id == playerid) return SendClientMessage(playerid, -1,"{FFB870}You can not send a message to yourself.");
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
GetPlayerName(idgiveplayersizeof(giveplayer));
                
format(stringsizeof(string), "{00DBDB}%s whispers: %s"sendernamemess);
                
SendClientMessage(id, -1string);
                
format(stringsizeof(string), "{00DBDB}Whisper to %s: %s"giveplayermess);
                
SendClientMessage(playerid,  -1string);
                return 
1;
        }
}
alias:wisper("w"); 
Quote:
Originally Posted by Imbalo
Посмотреть сообщение
Thank's, Rep + for you all

But, have 2 error


how fix ?
Well..
PHP код:
CMD:whisper(playeridparams[])
{
    new 
string[128],
        
playerName[MAX_PLAYER_NAME],
        
target,
        
Float:x,
        
Float:y,
        
Float:z;
    if(
sscanf(params"us[128]"targetstring))
        return 
SendClientMessage(playerid, -1"Syntax: /w <Name/Playerid> <Message>"); 
    if(!
IsPlayerConnected(target))
        return 
SendClientMessage(playerid, -1"This player is not connected.");
    if(
target == playerid)
        return 
SendClientMessage(playerid0xFFB870ff"You can not send a message to yourself.");
    
GetPlayerPos(playeridxyz);
    if(!
IsPlayerInRangeOfPoint(target3.0xyz))  
        return 
SendClientMessage(playerid0xFFFFCCff"This player is not near you.");
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    
format(stringsizeof(string), "%s whispers: %s"playerNamestring); 
    
SendClientMessage(target0x00DBDBffstring);
    
GetPlayerName(targetplayerNamesizeof(playerName));
    
format(stringsizeof(string), "Whisper to %s: %s"playerNamestring); 
    
SendClientMessage(playerid0x00DBDBffstring);
    return 
1;

EDIT: Dutheil was faster than me >.<
Depuis quand Dutheil parcourt le forum de SAMP Anglais?
Reply


Messages In This Thread
/whisper [ID] [message] help! - by Imbalo - 15.03.2017, 04:19
Re: /whisper [ID] [message] help! - by Toroi - 15.03.2017, 06:33
Re: /whisper [ID] [message] help! - by Imbalo - 15.03.2017, 08:04
Re: /whisper [ID] [message] help! - by Kane - 15.03.2017, 08:14
Re: /whisper [ID] [message] help! - by Imbalo - 15.03.2017, 08:21
Re: /whisper [ID] [message] help! - by Flamehaze7 - 15.03.2017, 10:06
Re: /whisper [ID] [message] help! - by YouHack - 15.03.2017, 13:42
Re: /whisper [ID] [message] help! - by Imbalo - 15.03.2017, 15:40
Re: /whisper [ID] [message] help! - by Dayrion - 15.03.2017, 20:11
Re: /whisper [ID] [message] help! - by Dutheil - 15.03.2017, 22:26

Forum Jump:


Users browsing this thread: 4 Guest(s)