SA-MP Forums Archive
SendClientMessage(їnick?... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: SendClientMessage(їnick?... (/showthread.php?tid=319974)



SendClientMessage(їnick?... - TiNcH010 - 21.02.2012

Verбn, al responder en un dialog (OnDialogResponse) quiero que le envie el mensaje pero a un determinado nick.
Ejemplo:
SendClientMessage(Nick_Nick, Color, String);
Se entiende? Gracias!


Respuesta: SendClientMessage(їnick?... - xSeveNx - 21.02.2012

A ver a ver, no entendн D: da un ejemplo mas claro


Respuesta: SendClientMessage(їnick?... - Kurama - 21.02.2012

Haber em..
pawn Код:
bool:SendClientMessageFromName(name[], color, message[])
{
    static playername[21];
    #if defined _FOREACH_LOCAL_VERSION
        #if _FOREACH_LOCAL_VERSION == 14
            foreach(Player, i)
        #endif
    #else
        for(new i, l = GetMaxPlayers();i<l;i++) if(IsPlayerConnected(i))
    #endif
    {
        GetPlayerName(i, playername, sizeof playername);
        if(strcmp(playername, name, false) == 0) return true;
    }
    return false;
}



Respuesta: SendClientMessage(їnick?... - TheChaoz - 21.02.2012

Quote:
Originally Posted by Kurama
Посмотреть сообщение
Haber em..
pawn Код:
bool:SendClientMessageFromName(name[], color, message[])
{
    static playername[21];
    #if defined _FOREACH_LOCAL_VERSION
        #if _FOREACH_LOCAL_VERSION == 14
            foreach(Player, i)
        #endif
    #else
        for(new i, l = GetMaxPlayers();i<l;i++) if(IsPlayerConnected(i))
    #endif
    {
        GetPlayerName(i, playername, sizeof playername);
        if(strcmp(playername, name, false) == 0) return true;
    }
    return false;
}
Te olvidaste la parte mas simple, enviar el mensaje (pero buena funcion xD)


Respuesta: SendClientMessage(їnick?... - TiNcH010 - 21.02.2012

Pero si pruebo lo que dice Kurama me funcionara?


Respuesta: SendClientMessage(їnick?... - Kurama - 21.02.2012

Estaba dormido esa noche, disculpame, me olvidй del mensaje xd.
pawn Код:
bool:SendClientMessageFromName(name[], color, message[])
{
    static playername[21];
    #if defined _FOREACH_LOCAL_VERSION
        #if _FOREACH_LOCAL_VERSION == 14
            foreach(Player, i)
        #endif
    #else
        for(new i, l = GetMaxPlayers();i<l;i++) if(IsPlayerConnected(i))
    #endif
    {
        GetPlayerName(i, playername, sizeof playername);
        if(strcmp(playername, name, false) == 0) return SendClientMessage(i, color, message),true;
    }
    return false;
}
El cуdigo deberнa funcionar.


- TiNcH010 - 21.02.2012

Gracias Kurama!
Pruebo y te digo

Si, funciona perfecto gracias
+rep.


Respuesta: SendClientMessage(їnick?... - Kurama - 21.02.2012

De nada, me alegro que te haya funcionado. Saludos.