SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/12/2019, 05:00 AM   #1
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 678
Reputation: 64
Default Unshow message for specif player?

PHP Code:
            format(strsizeof(str), "* You're on killstreak of %d kills!",KillStreak);
            
SendClientMessage(playerid, -1str);
            
format(strsizeof(str), "* %s(%d) is on a killstreak of %d kills!"pNamekilleridKillStreak);
            
SendClientMessageToAll(-1str); 
I want player to only see the message of his killstreak instead of the message sent to all.

PHP Code:
stock CMDMessageToAdmins(playerid,command[])
{
    if(
ServerInfo[AdminCmdMsg] == 0)
        return 
1;
        
    new 
string[128]; 
    
format(stringsizeof(string), "(A-CMD): '%s(%d)' has used the command '/%s'"pName(playerid), playeridcommand);
    return 
MessageToAdmins(greystring);

I want to make other admins see this message instead of admin himself using it.

How do I do it?
KayJ is offline   Reply With Quote
Old 15/12/2019, 06:07 AM   #2
xRadical3
Gangsta
 
xRadical3's Avatar
 
Join Date: May 2017
Location: Iran
Posts: 546
Reputation: 20
Default Re: Unshow message for specif player?

....

Last edited by xRadical3; 15/12/2019 at 12:21 PM.
xRadical3 is offline   Reply With Quote
Old 15/12/2019, 07:09 AM   #3
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 678
Reputation: 64
Default Re: Unshow message for specif player?

If you see then you'll notice these 2 are different scripts.
I want player who's on kill streak can only see the SendClientMessage and not SendClientMessageToAll
and I also want player who's admin can't see the command message he used. But all other admin can see it.

Last edited by KayJ; 15/12/2019 at 07:57 AM.
KayJ is offline   Reply With Quote
Old 15/12/2019, 08:42 AM   #4
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 627
Reputation: 54
Default Re: Unshow message for specif player?

pawn Code:
SendClientMessageToAllExcept(const color[], const message[], exceptid)
{
    for (new i,j=GetPlayerPoolSize(); i <= j && i != exceptid; i++)// i != exceptid, 'i' will never be equal to exceptid
        SendClientMessage(i,color,message); //that means this message will not be send to exceptid.
}
__________________
coool is offline   Reply With Quote
Old 15/12/2019, 09:19 AM   #5
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 678
Reputation: 64
Default Re: Unshow message for specif player?

Quote:
Originally Posted by coool View Post
pawn Code:
SendClientMessageToAllExcept(const color[], const message[], exceptid)
{
    for (new i,j=GetPlayerPoolSize(); i <= j && i != exceptid; i++)// i != exceptid, 'i' will never be equal to exceptid
        SendClientMessage(i,color,message); //that means this message will not be send to exceptid.
}
PHP Code:
    switch(KillStreak[killerid])
    {
        case 
5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120:
        {
            
format(strsizeof(str), "* You're on killstreak of %d kills!",KillStreak);
            
SendClientMessage(playerid, -1str);
            
format(strsizeof(str), "* %s(%d) is on a killstreak of %d kills!"pNamekilleridKillStreak);
            
SendClientMessageToAllExcept(const color[], const message[], exceptid)
            {
                for (new 
i,j=GetPlayerPoolSize(); <= && != exceptidi++)
                
SendClientMessage(i, -1str);
            }
        }
    } 
Code:
(134) : error 017: undefined symbol "SendClientMessageToAllExcept"
(134) : error 029: invalid expression, assumed zero
(134) : error 017: undefined symbol "color"
(134) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
KayJ is offline   Reply With Quote
Old 15/12/2019, 09:41 AM   #6
Orbit21
Little Clucker
 
Orbit21's Avatar
 
Join Date: May 2018
Location: Pakistan
Posts: 33
Reputation: 8
Default Re: Unshow message for specif player?

Quote:
Originally Posted by KayJ View Post
PHP Code:
    switch(KillStreak[killerid])
    {
        case 
5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120:
        {
            
format(strsizeof(str), "* You're on killstreak of %d kills!",KillStreak);
            
SendClientMessage(playerid, -1str);
            
format(strsizeof(str), "* %s(%d) is on a killstreak of %d kills!"pNamekilleridKillStreak);
            
SendClientMessageToAllExcept(const color[], const message[], exceptid)
            {
                for (new 
i,j=GetPlayerPoolSize(); <= && != exceptidi++)
                
SendClientMessage(i, -1str);
            }
        }
    } 
Code:
(134) : error 017: undefined symbol "SendClientMessageToAllExcept"
(134) : error 029: invalid expression, assumed zero
(134) : error 017: undefined symbol "color"
(134) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
You are using it wrong. Put it outside the callback, and use it the same way you use SendClientMessage.
PHP Code:
    switch(KillStreak[killerid])
    {
        case 
5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120:
        {
            
format(strsizeof(str), "* You're on killstreak of %d kills!",KillStreak);
            
SendClientMessage(playerid, -1str);
            
format(strsizeof(str), "* %s(%d) is on a killstreak of %d kills!"pNamekilleridKillStreak);
            
SendClientMessageToAllExcept(-1strplayerid);
        }
    } 
Orbit21 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get a specif number value. audriuxxx Scripting Help 1 01/03/2014 06:18 AM
Send to admin other message and to player other message lonako45 Scripting Help 10 24/04/2012 12:35 PM
Send Message to player when Tachibana Help Archive 3 22/06/2011 12:58 AM
message about player Headshot1108 Help Archive 13 19/03/2010 11:07 PM
Welcome to [Player] - Welcome message help nickbugun Help Archive 2 15/04/2009 01:32 PM


All times are GMT. The time now is 02:10 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.