SA-MP Forums Archive
[Ajuda] O Que Esta Errado ? - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] O Que Esta Errado ? (/showthread.php?tid=468650)



O Que Esta Errado ? - Alisson Silva Alves - 09.10.2013

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64], Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,MAX_PLAYER_NAME);
    format(string,sizeof string,"Criador/Dono/Scripter: DreeH_Knight");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"Sub-Dono: LadeN_Knight");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"Ajudante De Sub-Dono: Jon_Knight");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"Forum: ---");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"TeamSpeak: [EM BREVE]");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"%s Servidor seja bem vindo ao nosso servidor  !",Nome);
    SendClientMessage(0xFFFFFFAA,string);

    return 1;
}
pawn Код:
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(29) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(31) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(33) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(35) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(37) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(39) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.



Re: O Que Esta Errado ? - Dr_Pawno - 09.10.2013

Edite seu 'sizeof string' para sizeof(string).


Re: O Que Esta Errado ? - Alisson Silva Alves - 09.10.2013

Pode Explicar Melhor Por favor ?


Re: O Que Esta Errado ? - Petrick™ - 09.10.2013

Quote:
Originally Posted by Alisson Silva Alves
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64], Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,MAX_PLAYER_NAME);
    format(string,sizeof string,"Criador/Dono/Scripter: DreeH_Knight");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"Sub-Dono: LadeN_Knight");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"Ajudante De Sub-Dono: Jon_Knight");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"Forum: ---");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"TeamSpeak: [EM BREVE]");
    SendClientMessage(0xFFFFFFAA,string);
    format(string,sizeof string,"%s Servidor seja bem vindo ao nosso servidor  !",Nome);
    SendClientMessage(0xFFFFFFAA,string);

    return 1;
}
pawn Код:
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(29) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(31) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(33) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(35) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(37) : error 035: argument type mismatch (argument 2)
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(39) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Tenta

PHP код:
    GetPlayerName(playeridsendernamesizeof(sendername));
    
SendClientMessage(playerid0xFFFFFFAA"Criador/Dono/Scripter: DreeH_Knight");
    
SendClientMessage(playerid0xFFFFFFAA"Sub-Dono: LadeN_Knight");
    
SendClientMessage(playerid0xFFFFFFAA"Ajudante De Sub-Dono: Jon_Knight");
    
SendClientMessage(playerid0xFFFFFFAA"Forum: ---");
    
SendClientMessage(playerid0xFFFFFFAA"TeamSpeak: [EM BREVE]");
    
format(string,sizeof string,"%s Servidor seja bem vindo ao nosso servidor  !"sendername);
    
SendClientMessage(0xFFFFFFAA,string); 



Re: O Que Esta Errado ? - zPain - 09.10.2013

Quote:
Originally Posted by Dr_Pawno
Посмотреть сообщение
Edite seu 'sizeof string' para sizeof(string).
Isso nгo й necessбrio.



---

pawn Код:
native SendClientMessage(playerid, color, const message[]);


Vocк estб fazendo:
pawn Код:
SendClientMessage(color, const message[]);



Re: O Que Esta Errado ? - Dr_Pawno - 09.10.2013

sizeof й uma funзгo, vocк precisa colocar os () para definir os parametros.

pawn Код:
/* Errado: */ format(string, sizeof string, "Sub-Dono: LadeN_Knight");
/* Correto: */ format(string, sizeof(string), "Sub-Dono: LadeN_Knight");
Achei outro erro:
SendClientMessage requer o parametro playerid, vocк esqueceu dele.

pawn Код:
/* Errado: */ SendClientMessage(0xFFFFFFAA, string);
/* Correto: */ SendClientMessage(playerid, 0xFFFFFFAA, string);
Vocк nгo precisa formatar um texto para mandar mensagens definidas, seu codigo funcionaria exatamente igual apenas com
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64],
        Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,MAX_PLAYER_NAME);

    SendClientMessage(playerid, 0xFFFFFFAA, "Criador/Dono/Scripter: DreeH_Knight");
    SendClientMessage(playerid, 0xFFFFFFAA, "Sub-Dono: LadeN_Knight");
    SendClientMessage(playerid, 0xFFFFFFAA, "Ajudante De Sub-Dono: Jon_Knight");
    SendClientMessage(playerid, 0xFFFFFFAA, ,"Forum: ---");
    SendClientMessage(playerid, 0xFFFFFFAA, "TeamSpeak: [EM BREVE]");

    format(string, sizeof(string),"%s Servidor seja bem vindo ao nosso servidor  !", Nome);
    SendClientMessage(playerid, 0xFFFFFFAA, string);

    return 1;
}
Quote:
Originally Posted by zPain
Посмотреть сообщение
Isso nгo й necessбrio.
Serio? '-'
Depois de tanto tempo so agora que me falam ;-;


Re: O Que Esta Errado ? - zPain - 09.10.2013

Quote:
Originally Posted by Dr_Pawno
Посмотреть сообщение
sizeof й uma funзгo, vocк precisa colocar os () para definir os parametros.

pawn Код:
/* Errado: */ format(string, sizeof string, "Sub-Dono: LadeN_Knight");
/* Correto: */ format(string, sizeof(string), "Sub-Dono: LadeN_Knight");
sizeof й um operador.


Re: O Que Esta Errado ? - Alisson Silva Alves - 09.10.2013

pawn Код:
GetPlayerName(playerid, sendername, sizeof(sendername));

pawn Код:
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(26) : error 017: undefined symbol "sendername"
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(26) : error 017: undefined symbol "sendername"
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(26) : error 029: invalid expression, assumed zero
C:\Users\Acer\Downloads\[GM] Brasil Knight Games\gamemodes\BKG.pwn(26) : 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.



Re: O Que Esta Errado ? - zPain - 09.10.2013

O cуdigo de Dr. Pawno й funcional.


Re: O Que Esta Errado ? - Alisson Silva Alves - 09.10.2013

Aeee Deu Certo Vlw Galera