SA-MP Forums Archive
[Ajuda] Warnings no GM - 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] Warnings no GM (/showthread.php?tid=468490)



Warnings no GM - N3XTMapper - 08.10.2013

Ola, antes de me criticar por vir aqui pedir ajuda , vou logo dizendo que ja resolvi 3 erros no mesmo codigo , mais ficou esses 3 warnings que nao consigo retirar, entao quem puder me ajudar , eu agradeceria


Warnings :

PHP код:
C:\Users\moises\Desktop\GM FANTASTIC WORLD\SFGANGSN3XT.pwn(3161) : warning 219local variable "stringx" shadows a variable at a preceding level
C
:\Users\moises\Desktop\GM FANTASTIC WORLD\SFGANGSN3XT.pwn(420) : warning 204symbol is assigned a value that is never used"MSGTimer"
C:\Users\moises\Desktop\GM FANTASTIC WORLD\SFGANGSN3XT.pwn(420 -- 4014) : warning 203symbol is never used"StringTable"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
3 Warnings

AS WARNINGS ESTAO NESSAS LINHAS ::

PHP код:
MSGTimer SetTimer("RandomMSGs",150000,1);
//E NESTAS AKI , QUE ESTAO NO FIM DO GM
public RandomMSGs()
{
new 
random1 random(sizeof(MSGs));
new 
random2 random(sizeof(COLORS));
format(stringxsizeof(stringx), "%s"MSGs[random1]);
SendClientMessageToAll(COLORS[random2],stringx);
return 
1;

E TAMBEM ...

PHP код:
if (strcmp("/mudar"cmdtexttrue10) == 0)
{
new 
Nome[MAX_PLAYER_NAME];
new 
stringx[256];  // warning esta nesta linha <<<
GetPlayerName(playerid,Nome,sizeof Nome);
format(stringxsizeof stringx,  "%s FOI MUDAR DE GANG {FF0000}( /MUDAR )",Nome);
SendClientMessageToAll(0xFFFF00FF,stringx);
ForceClassSelection(playerid); //--- isso que faz o player voltar na seleзгo de skin igual apertar "F4"
SetPlayerHealth(playerid0);
return 
1;




Re: Warnings no GM - ThuuGLif3 - 08.10.2013

pawn Код:
MSGTimer = SetTimer("RandomMSGs",1500,1);
pawn Код:
if (strcmp("/mudar", cmdtext, true, 10) == 0)
{
new Nome[MAX_PLAYER_NAME];
new stringx[100];  // warning esta nesta linha <<<
GetPlayerName(playerid,Nome,sizeof Nome);
format(stringx, sizeof stringx,  "%s FOI MUDAR DE GANG {FF0000}( /MUDAR )",Nome);
SendClientMessageToAll(0xFFFF00FF,stringx);
ForceClassSelection(playerid); //--- isso que faz o player voltar na seleзгo de skin igual apertar "F4"
SetPlayerHealth(playerid, 0);
return 1;
}



Re: Warnings no GM - N3XTMapper - 08.10.2013

Quote:
Originally Posted by ThuuGLif3
Посмотреть сообщение
pawn Код:
MSGTimer = SetTimer("RandomMSGs",1500,1);
pawn Код:
if (strcmp("/mudar", cmdtext, true, 10) == 0)
{
new Nome[MAX_PLAYER_NAME];
new stringx[100];  // warning esta nesta linha <<<
GetPlayerName(playerid,Nome,sizeof Nome);
format(stringx, sizeof stringx,  "%s FOI MUDAR DE GANG {FF0000}( /MUDAR )",Nome);
SendClientMessageToAll(0xFFFF00FF,stringx);
ForceClassSelection(playerid); //--- isso que faz o player voltar na seleзгo de skin igual apertar "F4"
SetPlayerHealth(playerid, 0);
return 1;
}
Desculpe mais , continua com as mesmas warnings


Re: Warnings no GM - Duduzinho - 08.10.2013

Quote:
Originally Posted by N3XTMapper
Посмотреть сообщение
Desculpe mais , continua com as mesmas warnings
Код:
        if (strcmp("/mudar", cmdtext, true, 10) == 0)
	{
		new Nome[MAX_PLAYER_NAME];
		new StringC[256];  // warning esta nesta linha <<<
		GetPlayerName(playerid,Nome,sizeof Nome);
		format(StringC, sizeof StringC,  "%s FOI MUDAR DE GANG {FF0000}( /MUDAR )",Nome);
		SendClientMessageToAll(0xFFFF00FF,StringC);
		ForceClassSelection(playerid); //--- isso que faz o player voltar na seleзгo de skin igual apertar "F4"
		SetPlayerHealth(playerid, 0);
		return 1;
	}
Tenta!


Re: Warnings no GM - Zivo - 08.10.2013

Problema 1:

Delete o que estб escrito na seguinte frase:

pawn Код:
new stringx[100];
provavelmente jб existe uma variavel stringx anteriormente...

Problema 2:

Coloque MSGTimer = blбblбblб no OnGameModeInit()
[pawn]OnGameModeInit()
{
MSGTimer = bбblбblб
}


Re: Warnings no GM - N3XTMapper - 08.10.2013

Quote:
Originally Posted by Duduzinho
Посмотреть сообщение
Код:
        if (strcmp("/mudar", cmdtext, true, 10) == 0)
	{
		new Nome[MAX_PLAYER_NAME];
		new StringC[256];  // warning esta nesta linha <<<
		GetPlayerName(playerid,Nome,sizeof Nome);
		format(StringC, sizeof StringC,  "%s FOI MUDAR DE GANG {FF0000}( /MUDAR )",Nome);
		SendClientMessageToAll(0xFFFF00FF,StringC);
		ForceClassSelection(playerid); //--- isso que faz o player voltar na seleзгo de skin igual apertar "F4"
		SetPlayerHealth(playerid, 0);
		return 1;
	}
Tenta!

Vlw , agora falta resolver as outras 2 warnings que eu postei , voce me ajudou a resolver o do /mudar , ainda tem o do MSG TIMER E Tals


Re: Warnings no GM - N3XTMapper - 08.10.2013

Quote:
Originally Posted by Zivo
Посмотреть сообщение
Problema 1:

Delete o que estб escrito na seguinte frase:

pawn Код:
new stringx[100];
provavelmente jб existe uma variavel stringx anteriormente...

Problema 2:

Coloque MSGTimer = blбblбblб no OnGameModeInit()
[pawn]OnGameModeInit()
{
MSGTimer = bбblбblб
}
Ja esta em OnGameModeInit

PHP код:
public OnGameModeInit()
{
SetGameModeText("TDM || SF v1.0 |");
SendRconCommand("mapname SanFierro");
ShowNameTags(1);
SetNameTagDrawDistance(80);
AllowInteriorWeapons(1);
UsePlayerPedAnims();
SetTimer("ZoneCheckpointChecker"5001);
MSGTimer SetTimer("RandomMSGs",1500,1);
SetTimer("PlayerObjectsUpdate",500,1);
LoadTextDraws(); 



Re: Warnings no GM - Duduzinho - 08.10.2013

Quote:
Originally Posted by N3XTMapper
Посмотреть сообщение
Desculpe mais , continua com as mesmas warnings
Quote:
Originally Posted by N3XTMapper
Посмотреть сообщение
Vlw , agora falta resolver as outras 2 warnings que eu postei , voce me ajudou a resolver o do /mudar , ainda tem o do MSG TIMER E Tals
Код:
//USe na public OngamModeint
MSGTimer = SetTimer("RandomMSGs",150000,1);

//E NESTAS AKI , QUE ESTAO NO FIM DO GM

public RandomMSGs()
{
new random1 = random(sizeof(MSGs));
new random2 = random(sizeof(COLORS));
format(StringC, sizeof(StringC), "%s", MSGs[random1]);
SendClientMessageToAll(COLORS[random2],StringC);
return 1;
}
Tenta ai!


Re: Warnings no GM - ThuuGLif3 - 08.10.2013

Existe algum:

pawn Код:
new StringTable
No seu GM? Se sim, Pode apagar-lo...



Re: Warnings no GM - PT - 08.10.2013

pawn Код:
// coloca isto em OnGameModeInt
MSGTimer = SetTimer("RandomMSGs",150000, true);

//E NESTAS AKI , QUE ESTAO NO FIM DO GM

public RandomMSGs()
{
    new pt[120], random1, random2;

    random1 = random(sizeof(MSGs));
    random2 = random(sizeof(COLORS));

    format(pt, sizeof(pt), "%s", MSGs[random1]);
    SendClientMessageToAll(COLORS[random2], pt);
    return 1;
}