Ayuda con este error
#1

Es mi segundo post pidiendo ayuda hoy, me siento muy apenado.

El problema esta en que he hecho un comando de /teles y al hacer click en "Las Venturas" quiero que diga:
Jugador ha ido a Las Venturas

Para ello esta esto:
pawn Код:
SendClientMessageToAll(playerid, COLOR_WHITE, pString, "%s ha ido a Las Venturas", pName );
Pero al compilar me arroja este error:
error 035: argument type mismatch (argument 2)

No entiendo cual es el mal uso del argumento 2.. ayuda por favor
Reply
#2

tendrнa que ser asн:

pawn Код:
new pString[47], pName[24]; //creas la cadena de texto y donde se va a almacenar el nombre
GetPlayerName(playerid, pName, sizeof(pName));
format(pString, sizeof(pString), "%s ha ido a Las Venturas", pName);
SendClientMessageToAll(COLOR_WHITE, pString); //da el mensaje almacenado en pString a todos los jugadores
GetPlayerName
SendClientMessageToAll
Reply
#3

SendClientMessageToAll solamente tiene 2 parбmetros, 1 el color y 2 el mensaje.

La forma correcta serнa:

Quote:

format(pString, sizeof(pString), "%s ha ido a Las Venturas", pName);
SendClientMessageToAll(COLOR_WHITE, pString);

Reply
#4

Quote:
Originally Posted by LatinZ
Посмотреть сообщение
SendClientMessageToAll solamente tiene 2 parбmetros, 1 el color y 2 el mensaje.

La forma correcta serнa:
si lo siento no habнa borrado ese parбmetro, justo lo habнa editado xD
Reply
#5

Gracias a los dos
Reply
#6

Disculpen este doble-post pero es para revivir..

Ahora me ocurre lo siguiente, al hacer teleport a Las Venturas, sale "Player ha ido a Las Venturas", pero al hacer teleport a Los Santos o a San Fierro sale " ha ido a Los Santos/San Fierro" o sea, no sale el nombre. asн tengo el cуdigo:

pawn Код:
if(dialogid == 24) //Chekea que sea el dialogo 24, que es el que mostramos anteriormente al jugador
    {
    if(response) //Chekea que la respuesta haya sido "Aceptar"
        {
            if(listitem == 0) //Si selecciono la primera opcion
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, 1683.2749, 1447.6974, 10.7715); //Coordenadas de Las Venturas
                    format(pString, sizeof(pString), "%s ha ido a Las Venturas", pName);
                    SendClientMessageToAll(COLOR_WHITE, pString);
            }
            if(listitem == 1)
            {
                    new sName[24];
                    new sString[80];
                    SetPlayerPos(playerid, 1683.8539,-2327.5725,13.5469);
                    format(sString, sizeof(sString), "%s ha ido a Los Santos", sName);
                    SendClientMessageToAll(COLOR_WHITE, sString);
            }
            if(listitem == 2)
            {
                    new aName[24];
                    new aString[80];
                    SetPlayerPos(playerid, -1418.5383,-295.9330,14.1484);
                    format(aString, sizeof(aString), "%s ha ido a San Fierro", aName);
                    SendClientMessageToAll(COLOR_WHITE, aString);
            }
Reply
#7

Quote:
Originally Posted by FlavioCesar
Посмотреть сообщение
Disculpen este doble-post pero es para revivir..

Ahora me ocurre lo siguiente, al hacer teleport a Las Venturas, sale "Player ha ido a Las Venturas", pero al hacer teleport a Los Santos o a San Fierro sale " ha ido a Los Santos/San Fierro" o sea, no sale el nombre. asн tengo el cуdigo:

pawn Код:
if(dialogid == 24) //Chekea que sea el dialogo 24, que es el que mostramos anteriormente al jugador
    {
    if(response) //Chekea que la respuesta haya sido "Aceptar"
        {
            if(listitem == 0) //Si selecciono la primera opcion
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, 1683.2749, 1447.6974, 10.7715); //Coordenadas de Las Venturas
                    format(pString, sizeof(pString), "%s ha ido a Las Venturas", pName);
                    SendClientMessageToAll(COLOR_WHITE, pString);
            }
            if(listitem == 1)
            {
                    new sName[24];
                    new sString[80];
                    SetPlayerPos(playerid, 1683.8539,-2327.5725,13.5469);
                    format(sString, sizeof(sString), "%s ha ido a Los Santos", sName);
                    SendClientMessageToAll(COLOR_WHITE, sString);
            }
            if(listitem == 2)
            {
                    new aName[24];
                    new aString[80];
                    SetPlayerPos(playerid, -1418.5383,-295.9330,14.1484);
                    format(aString, sizeof(aString), "%s ha ido a San Fierro", aName);
                    SendClientMessageToAll(COLOR_WHITE, aString);
            }
Te faltу almacenar el nombre del jugador en sName (Los Santos) y en aName(San Fierro)

pawn Код:
GetPlayerName(playerid,sName,sizeof(sName));
GetPlayerName(playerid,aName,sizeof(aName));
Reply
#8

Estas definiendo para que chequee el nombre en una sola funciуn, que es la que te lleva a Las Venturas, lo definiste en local.
pawn Код:
if(dialogid == 24) //Chekea que sea el dialogo 24, que es el que mostramos anteriormente al jugador
    {
    if(response) //Chekea que la respuesta haya sido "Aceptar"
        {
            if(listitem == 0) //Si selecciono la primera opcion
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, 1683.2749, 1447.6974, 10.7715); //Coordenadas de Las Venturas
                    format(pString, sizeof(pString), "%s ha ido a Las Venturas", pName);
                    SendClientMessageToAll(COLOR_WHITE, pString);
            }
            if(listitem == 1)
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, 1683.8539,-2327.5725,13.5469);
                    format(pString, sizeof(pString), "%s ha ido a Los Santos", pName);
                    SendClientMessageToAll(COLOR_WHITE, sString);
            }
            if(listitem == 2)
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, -1418.5383,-295.9330,14.1484);
                    format(pString, sizeof(pString), "%s ha ido a San Fierro", pName);
                    SendClientMessageToAll(COLOR_WHITE, aString);
            }
PD: Evita el doble post, edita el mensaje y pon tus dudas.
Reply
#9

Quote:
Originally Posted by xTexTx
Посмотреть сообщение
Estas definiendo para que chequee el nombre en una sola funciуn, que es la que te lleva a Las Venturas, lo definiste en local.
pawn Код:
if(dialogid == 24) //Chekea que sea el dialogo 24, que es el que mostramos anteriormente al jugador
    {
    if(response) //Chekea que la respuesta haya sido "Aceptar"
        {
            if(listitem == 0) //Si selecciono la primera opcion
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, 1683.2749, 1447.6974, 10.7715); //Coordenadas de Las Venturas
                    format(pString, sizeof(pString), "%s ha ido a Las Venturas", pName);
                    SendClientMessageToAll(COLOR_WHITE, pString);
            }
            if(listitem == 1)
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, 1683.8539,-2327.5725,13.5469);
                    format(pString, sizeof(pString), "%s ha ido a Los Santos", pName);
                    SendClientMessageToAll(COLOR_WHITE, sString);
            }
            if(listitem == 2)
            {
                    new pName[24];
                    new pString[80];
                    GetPlayerName(playerid, pName, 24);
                    SetPlayerPos(playerid, -1418.5383,-295.9330,14.1484);
                    format(pString, sizeof(pString), "%s ha ido a San Fierro", pName);
                    SendClientMessageToAll(COLOR_WHITE, aString);
            }
PD: Evita el doble post, edita el mensaje y pon tus dudas.
Aъn sigue dando lo mismo, es por eso que habia intentado cambiandolas. No se porque pasa esto
Reply
#10

їUtilizaste el cуdigo que te puse?, no es que intentes cambiando, no tenнas definido la funciуn de GetPlayerName
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)