Ajuda Name Random!
#1

PHP код:
new RandomServerName[4][] = // Nomes Server Random
{
    
"Nome do server 1",
    
"Nome do server 2",
    
"Nome do server 3",
    
"Nome do server 4"
};
SetTimer("SendMSG"1000true);//OnGameModeInit
forward SendMSG();
public 
SendMSG()
{
    new 
string[256];
    new 
randMSG random(sizeof(RandomServerName));
    
format(string,sizeof(string),"hostname %s",RandomServerName[randMSG]);
    
SendRconCommand(string);

Erros

C:\Users\Caio\Desktop\[GM]Brasil Trucker's Fire\BTF 2.0\gamemodes\BTF.pwn(16) : error 010: invalid function or declaration
C:\Users\Caio\Desktop\[GM]Brasil Trucker's Fire\BTF 2.0\gamemodes\BTF.pwn(22) : error 017: undefined symbol "random"
C:\Users\Caio\Desktop\[GM]Brasil Trucker's Fire\BTF 2.0\gamemodes\BTF.pwn(22) : error 001: expected token: ";", but found "sizeof"
C:\Users\Caio\Desktop\[GM]Brasil Trucker's Fire\BTF 2.0\gamemodes\BTF.pwn(22) : warning 215: expression has no effect
C:\Users\Caio\Desktop\[GM]Brasil Trucker's Fire\BTF 2.0\gamemodes\BTF.pwn(22) : error 001: expected token: ";", but found ")"
C:\Users\Caio\Desktop\[GM]Brasil Trucker's Fire\BTF 2.0\gamemodes\BTF.pwn(22) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

puse exбctamente el mismo cуdigo que tu y no me saliу ningъn error al compliar:

pawn Код:
#include <a_samp>

new RandomServerName[4][] = // Nomes Server Random
{
    "Nome do server 1",
    "Nome do server 2",
    "Nome do server 3",
    "Nome do server 4"
};

public OnGameModeInit()
{
    SetTimer("SendMSG", 1000, true);//OnGameModeInit
    return 1;
}

forward SendMSG();

public SendMSG()
{
    new string[256];
    new randMSG = random(sizeof(RandomServerName));
    format(string,sizeof(string),"hostname %s",RandomServerName[randMSG]);
    SendRconCommand(string);
}
Reply
#3

pawn Код:
new RandomServerName[][] = // Nomes Server Random
{
    //Te faltaron los { }
    {"Nome do server 1"},
    {"Nome do server 2"},
    {"Nome do server 3"},
    {"Nome do server 4"}
};


SetTimer("SendMSG", 1000, true);//OnGameModeInit

forward SendMSG();
public SendMSG()
{
    new string[144];
    new randMSG = random(sizeof(RandomServerName));
    format(string,sizeof(string),"hostname %s", RandomServerName[randMSG]);
    SendRconCommand(string);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)