Textdraw com string random
#1

Opa, jб ouvi falar muito do Text Draw Editor do Zamaroth, e hoje resolvi testa-lo e percebi, que tudo que falam sobre ele eh bom mesmo, muito bom o FS, ai ta neh, criei 3 textdraw, salvei como filterscript, mas um desses textdraws, tem que ser uma string random, olha como esta o FS:
pawn Код:
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;

new pegarRandom;
new string[256];

new CmdRandom[4][256] =
{
    "/teste1",
    "/teste2",
    "/teste3",
    "/teste4"
};

pegarRandom = random(sizeof(CmdRandom)); // Linha 36
format(string, sizeof(string), "%s", CmdRandom[pegarRandom]);

public OnFilterScriptInit()
{
    // Crear los textdraws:
    Textdraw0 = TextDrawCreate(69.000000, 429.000000, "use any cmd ~>~");
    TextDrawAlignment(Textdraw0, 2);
    TextDrawBackgroundColor(Textdraw0, -1);
    TextDrawFont(Textdraw0, 3);
    TextDrawLetterSize(Textdraw0, 0.449898, 1.500000);
    TextDrawColor(Textdraw0, -16776961);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 0);

    Textdraw1 = TextDrawCreate(495.000000, 427.000000, "Master League Server 4 Fun");
    TextDrawAlignment(Textdraw1, 2);
    TextDrawBackgroundColor(Textdraw1, -1);
    TextDrawFont(Textdraw1, 3);
    TextDrawLetterSize(Textdraw1, 0.519899, 1.700000);
    TextDrawColor(Textdraw1, 255);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 0);
   
    Textdraw2 = TextDrawCreate(154.000000, 425.000000, string);
    TextDrawBackgroundColor(Textdraw2, 65535);
    TextDrawFont(Textdraw2, 2);
    TextDrawLetterSize(Textdraw2, 0.449999, 2.099999);
    TextDrawColor(Textdraw2, -1);
    TextDrawSetOutline(Textdraw2, 1);
    TextDrawSetProportional(Textdraw2, 1);

//Daqui pra frente so tem os TextDrawShowForPlayer ...
Mas dб 1 erro e 2 warnings:

Код:
C:\Documents and Settings\Marxista\Meus documentos\Servers\SAMP SERVER 0.3b R2\scriptfiles\teste.pwn(36) : error 010: invalid function or declaration
C:\Documents and Settings\Marxista\Meus documentos\Servers\SAMP SERVER 0.3b R2\scriptfiles\teste.pwn(98) : warning 203: symbol is never used: "CmdRandom"
C:\Documents and Settings\Marxista\Meus documentos\Servers\SAMP SERVER 0.3b R2\scriptfiles\teste.pwn(98) : warning 203: symbol is never used: "pegarRandom"
Mas nгo estou conseguindo resolver o erro, alguem sabe o que estб errado

OBS: a linha 98 й uma depois da ultima (97)
Reply
#2

ah ta vo edita o post intao kkkk
й ke eu nao li
eu pensei ke vc posto o codigo intero ali
Reply
#3

por acaso tu eh cego eu botei la // Linha 36
Reply
#4

nao sei c й isso mais tem
3 text draw e 4 random
Reply
#5

nao eh isso (eu acho), pq o random eh pra setar um dos textdraw (TextDraw2)
Reply
#6

a linha 98 й a TextDrawSetProportional(Textdraw2, 1); ou a ke vem dps dela?
Reply
#7

a linha 98 nao existe, a ultima do FS inteiro eh a 97, ali eu so postei ate uma parte, a outra parte nao precisa


OFF:
Este foro requiere que tъ esperes 120 segundos entre mensajes. Por favor intenta de nuevo en 1 segundos.
Reply
#8

ah aki aconteceu uma ves de aparece tipo erro na linha 201 e te 200 linha
nao lembro kem mi ajudo
sei ke eu tinha eskecido de bota um dakeles bagulhetzin eskeci o nome ( } )
da uma olhada c nao й isso ae
Reply
#9

nao, a warning eh pq eu nunca usei a variavel, mas eu usei, isso que nao entendo !!! Alguem mais
Reply
#10

pawn Код:
new Text:msgs;
forward chamarbagjgm();
new mensagens[3][128] = {
"iOOOOOOOOOOOOOOOOO",
"JumpTFucker HAhaha",
"OLOLOLO"
};
public OnGameModeInit()
{
SetTimer("chamarbagjgm", 18000, true);//tempo que mudas as msgs
TextDrawCreate................
return 1;
}
public chamarbagjgm()
{
  new string[128];
  new rand = random(sizeof(mensagens));
  format(string,sizeof(string),"%s",mensagens[rand][0]);
  SetTextDrawString(msgs, string);
  TextDrawShowForAll(msgs);
  return 1;
}
Bieel Use tags [AJUDA],[DUV] etc...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)