Sendclient message!!!
#1

Hello

how do you make a line that a player types

/open
that a message will send to other players around him like
(player} opened garagedoor 1

Need realy help!!
Reply
#2

BUMP
Reply
#3

pawn Код:
new string[128],PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
format(string,128,"%s opened the garagebar 1",PlayerName);
SendClientMessageToAll(-1,string);
Reply
#4

PHP код:
new string[128]; new Name[MAX_PLAYER_NAME];
GetPlayerName(playeridNamesizeof(Name));
format(stringsizeof(string), "%s has opened Garage 1"Name);
SendNearbyMessage(playerid10stringCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOW);
stock SendNearbyMessage(playeridFloat:radiusstring[], col1col2col3col4col5)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    new 
Float:ixFloat:iyFloat:iz;
    new 
Float:cxFloat:cyFloat:cz;
    foreach(
Playeri)
    {
        if(
IsPlayerLoggedIn(i))
        {
            if(
GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                
GetPlayerPos(iixiyiz);
                
cx = (ix);
                
cy = (iy);
                
cz = (iz);
                if(((
cx radius/16) && (cx > -radius/16)) && ((cy radius/16) && (cy > -radius/16)) && ((cz radius/16) && (cz > -radius/16)))
                {
                    
SendClientMessage(icol1string);
                }
                else if(((
cx radius/8) && (cx > -radius/8)) && ((cy radius/8) && (cy > -radius/8)) && ((cz radius/8) && (cz > -radius/8)))
                {
                    
SendClientMessage(icol2string);
                }
                else if(((
cx radius/4) && (cx > -radius/4)) && ((cy radius/4) && (cy > -radius/4)) && ((cz radius/4) && (cz > -radius/4)))
                {
                    
SendClientMessage(icol3string);
                }
                else if(((
cx radius/2) && (cx > -radius/2)) && ((cy radius/2) && (cy > -radius/2)) && ((cz radius/2) && (cz > -radius/2)))
                {
                    
SendClientMessage(icol4string);
                }
                else if(((
cx radius) && (cx > -radius)) && ((cy radius) && (cy > -radius)) && ((cz radius) && (cz > -radius)))
                {
                    
SendClientMessage(icol5string);
                }
            }
        }
    }
    return 
1;

Reply
#5

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
PHP код:
new string[128]; new Name[MAX_PLAYER_NAME];
GetPlayerName(playeridNamesizeof(Name));
format(stringsizeof(string), "%s has opened Garage 1"Name);
SendNearbyMessage(playerid10stringCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOW);
stock SendNearbyMessage(playeridFloat:radiusstring[], col1col2col3col4col5)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    new 
Float:ixFloat:iyFloat:iz;
    new 
Float:cxFloat:cyFloat:cz;
    foreach(
Playeri)
    {
        if(
IsPlayerLoggedIn(i))
        {
            if(
GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                
GetPlayerPos(iixiyiz);
                
cx = (ix);
                
cy = (iy);
                
cz = (iz);
                if(((
cx radius/16) && (cx > -radius/16)) && ((cy radius/16) && (cy > -radius/16)) && ((cz radius/16) && (cz > -radius/16)))
                {
                    
SendClientMessage(icol1string);
                }
                else if(((
cx radius/8) && (cx > -radius/8)) && ((cy radius/8) && (cy > -radius/8)) && ((cz radius/8) && (cz > -radius/8)))
                {
                    
SendClientMessage(icol2string);
                }
                else if(((
cx radius/4) && (cx > -radius/4)) && ((cy radius/4) && (cy > -radius/4)) && ((cz radius/4) && (cz > -radius/4)))
                {
                    
SendClientMessage(icol3string);
                }
                else if(((
cx radius/2) && (cx > -radius/2)) && ((cy radius/2) && (cy > -radius/2)) && ((cz radius/2) && (cz > -radius/2)))
                {
                    
SendClientMessage(icol4string);
                }
                else if(((
cx radius) && (cx > -radius)) && ((cy radius) && (cy > -radius)) && ((cz radius) && (cz > -radius)))
                {
                    
SendClientMessage(icol5string);
                }
            }
        }
    }
    return 
1;

Hmm thx but 1 question do i need to place this wole under the command ??
(i got the command a few times )
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)