SA-MP Forums Archive
[Ajuda] /cnn em TextDraw - 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] /cnn em TextDraw (/showthread.php?tid=487437)



/cnn em TextDraw - TorresPutado - 13.01.2014

Estou tentando desenvolver uma CNN em TextDraw, Obs: Eu ja procurei no SEARCH,

Codigo:
pawn Код:
//CNN
CNN = TextDrawCreate(184.5 ,351 , "cnn");
TextDrawFont(CNN , 1);
TextDrawLetterSize(CNN,0.2999, 1.4);
TextDrawColor(CNN , 0xffffffFF);
TextDrawSetOutline(CNN , false);
TextDrawSetProportional(CNN , true);
TextDrawSetShadow(CNN , 1);
Comando:
pawn Код:
if(strcmp(cmdtext,"/cnn",true))
    {
    if(IsPlayerAdmin(playerid)){
    new str[256],nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,nome,sizeof(nome));
    format(str, sizeof(str), "~y~%s: ~w~%s",nome,cmdtext[5]);
    TextDrawShowForAll(CNN);
    SetTimer("apagarcnn",5000,false);
    }else{
    SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
    }
    return 1;
    }
Obs: ao digitar "/cnn lelek" apareзe na tela "cnn"



Re: /cnn em TextDraw - PT - 13.01.2014

testa isso:

pawn Код:
if(strcmp(cmdtext,"/cnn",true))
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
    new cnntextpt[80], str[128];
    if(sscanf(cmdtext, "s[5]s[80]", cmdtext, cnntextpt))
        return SendClientMessage(playerid, -1, "uso: /cnn [texto]");
    GetPlayerName(playerid,str,sizeof(str));
    format(str, sizeof(str), "~y~%s: ~w~%s", str, cmdtext[5]);
    TextDrawSetString(CNN, str);  
    TextDrawShowForAll(CNN);
    SetTimer("apagarcnn",5000,false);
    return 1;
}



Respuesta: Re: /cnn em TextDraw - TorresPutado - 13.01.2014

Quote:
Originally Posted by PT
Посмотреть сообщение
testa isso:

pawn Код:
if(strcmp(cmdtext,"/cnn",true))
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
    new cnntextpt[80], str[128];
    if(sscanf(cmdtext, "s[5]s[80]", cmdtext, cnntextpt))
        return SendClientMessage(playerid, -1, "uso: /cnn [texto]");
    GetPlayerName(playerid,str,sizeof(str));
    format(str, sizeof(str), "~y~%s: ~w~%s", str, cmdtext[5]);
    TextDrawSetString(CNN, str);  
    TextDrawShowForAll(CNN);
    SetTimer("apagarcnn",5000,false);
    return 1;
}
Apareзe no servidor: Uso: /cnn [TEXTO], mais eu ja pus o Texto!!!


Re: /cnn em TextDraw - PT - 13.01.2014

tenta so assim:

pawn Код:
if(strcmp(cmdtext,"/cnn",true))
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
    new cnntextpt[80], str[128];
    if(sscanf(cmdtext, "s[80]", cnntextpt))
        return SendClientMessage(playerid, -1, "uso: /cnn [texto]");
    GetPlayerName(playerid,str,sizeof(str));
    format(str, sizeof(str), "~y~%s: ~w~%s", str, cmdtext[5]);
    TextDrawSetString(CNN, str);  
    TextDrawShowForAll(CNN);
    SetTimer("apagarcnn",5000,false);
    return 1;
}



Respuesta: Re: /cnn em TextDraw - TorresPutado - 13.01.2014

Quote:
Originally Posted by PT
Посмотреть сообщение
tenta so assim:

pawn Код:
if(strcmp(cmdtext,"/cnn",true))
{
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
    new cnntextpt[80], str[128];
    if(sscanf(cmdtext, "s[80]", cnntextpt))
        return SendClientMessage(playerid, -1, "uso: /cnn [texto]");
    GetPlayerName(playerid,str,sizeof(str));
    format(str, sizeof(str), "~y~%s: ~w~%s", str, cmdtext[5]);
    TextDrawSetString(CNN, str);  
    TextDrawShowForAll(CNN);
    SetTimer("apagarcnn",5000,false);
    return 1;
}
Nгo deu continua a mesma coisa, Obs: desculpa sobre a demora, estou passando mal, estou fomitando e etc, to com dor de cabeзa, e fraco,


Re: /cnn em TextDraw - XxSemNickxX - 13.01.2014

Код:
if(strcmp("/cnn", cmd, true) == 0)
	{
		if(pAdmin[playerid] > 0)
		{
			new texto[64];

			if(sscanf(cmdtext, "s[5]s[64]", cmd, texto))
			{
				SendClientMessage(playerid, Vermelho, "Digite: /cnn [texto]");
				return 1;
			}
			format(string, sizeof(string), "%s diz:~n~~g~] ~w~%s ~g~]", GetPlayerNameEx(playerid), texto);
			GameTextForAll(string, 5000, 3);
		}
		else
		{
			SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo para usar este comando!");
		}
		return 1;
	}
ta ai, Ajudei? +rep - Pff .


Respuesta: /cnn em TextDraw - TorresPutado - 13.01.2014

Obs: Mals pela "SUPER DEMORA", Ei, deu esses errinhos:
PHP код:
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(307) : error 017undefined symbol "cmd"
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : error 017undefined symbol "pAdmin"
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : warning 215expression has no effect
C
:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : error 001expected token";"but found "]"
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : error 029invalid expressionassumed zero
C
:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

Oobs: QUERO EM TEXTDRAW