Uma variavei dentro de outra new -
-iLusioN- - 23.01.2011
Galera eu tavo com um problema aki mais eu sei como e mais nao seu fazer tipo crie uma
pawn Код:
new classparaotime[11][1] = {
"Bope",
"Exercito",
"Playboys",
"Noias",
"Frangos",
"Argentes",
"Chineses",
"Marfia",
"Gang Vip 1",
"Gang Vip 2",
"Gang Vip 3"
};
e uma
esse otime e pra definir os ids das gangs no classparaotime tipo
pawn Код:
if(classid == 0)
{
GameTextForPlayer(playerid,"~n~~r~Equipe do B.O.P.E",2000,3);
SetPlayerPos(playerid, 2013.164184, -1199.702026, 20.023437);
SetPlayerCameraPos(playerid, 2020.164184, -1199.702026, 20.023437);
SetPlayerCameraLookAt(playerid, 2013.164184, -1199.702026, 20.023437);
SetPlayerColor(playerid, 0x0000BBAA);
otime [playerid] = 0;
}
if(classid == 1)
{
GameTextForPlayer(playerid,"~n~~r~Faccao das Tropas~n~Armadas Exercito",2000,3);
SetPlayerPos(playerid, 2013.164184, -1199.702026, 20.023437);
SetPlayerCameraPos(playerid, 2020.164184, -1199.702026, 20.023437);
SetPlayerCameraLookAt(playerid, 2013.164184, -1199.702026, 20.023437);
SetPlayerColor(playerid, 0xDC143CAA);
otime [playerid] = 1;
}
em uma linha como essa
oque deveria colocar pra definir o id da gang?
pawn Код:
else if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == 15) //passou 30 segundos dentro do checkpoint
{
GameTextForPlayer(i, "~w~Area dominada +2 score", 4000, 1);
SetPlayerScore(i, GetPlayerScore(i) + 2);
GetPlayerName(i, playername, MAX_PLAYER_NAME);
new string[256];
format(string, sizeof(string), "|GANGZONE| A Gang %s domino mais um territуrio!", otime[classparaotime[playerid]]);//Assim que deveria ficar essa linha?
SendClientMessageToAll(COLOR_RED, string);
gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));
}
Mais a linha da erro e o erro esta nisso
pawn Код:
otime[classparaotime[playerid]]
Re: Uma variavei dentro de outra new -
duany123 - 23.01.2011
LoL Mostra Que Erro Aparece '-'
Re: Uma variavei dentro de outra new -
-iLusioN- - 23.01.2011
pawn Код:
C:\Documents and Settings\Leo\Desktop\TDm\2\gamemodes\Gol.pwn(51) : error 018: initialization data exceeds declared size
C:\Documents and Settings\Leo\Desktop\TDm\2\gamemodes\Gol.pwn(405) : error 025: function heading differs from prototype
C:\Documents and Settings\Leo\Desktop\TDm\2\gamemodes\Gol.pwn(438) : error 033: array must be indexed (variable "classparaotime")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Re: Uma variavei dentro de outra new -
duany123 - 23.01.2011
Me Manda A Linha 51 - 405 - 438
Re: Uma variavei dentro de outra new -
-iLusioN- - 23.01.2011
esqueci pra isso nem precisa mandar a linha n -.-
pq o erro ta ai no
pawn Код:
otime[classparaotime[playerid]]
Re: Uma variavei dentro de outra new - rjjj - 23.01.2011
Isto deve resolver o seu problema:
pawn Код:
new classparaotime[11][50] = {
"Bope",
"Exercito",
"Playboys",
"Noias",
"Frangos",
"Argentes",
"Chineses",
"Marfia",
"Gang Vip 1",
"Gang Vip 2",
"Gang Vip 3"
};
E:
pawn Код:
classparaotime[otime[playerid]]
O cуdigo acima corresponderб ao nome da equipe do jogador, ou seja, serб a variбvel de texto (string) da equipe do jogador.
Espero ter ajudado
Re: Uma variavei dentro de outra new -
-iLusioN- - 23.01.2011
cra vlw eu compliei e n deu erro
vo testar
@@@@@@@@@@@@@@
Valeu manoo vlw mesmo *-*