Ajuda Name Random! - 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: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ajuda Name Random! (
/showthread.php?tid=495343)
Ajuda Name Random! -
OrNot - 16.02.2014
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", 1000, true);//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.
Respuesta: Ajuda Name Random! -
Porta0123 - 16.02.2014
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);
}
Respuesta: Ajuda Name Random! -
hotspicytaco - 16.02.2014
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);
}