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



Warning - matheusspohr - 21.04.2015

Fala galera boa do forum, por "recomendaзхes" baixei o GM PPC_Trucking para estudos, so q ele veio com 4 warnings, 3 jб removi, mais tem 1 que nгo estou conseguindo, se puderem me ajudar, fico grato...
PHP код:
//Warning
H:\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(182) : warning 225unreachable code 
PHP код:
if (APlayerData[playerid][RulesRead] == false) return SendClientMessage(playerid0xFFFFFFFF"{FF0000}You haven't accepted the {FFFF00}/rules{FF0000} yet"); 
Abraзos...


Re: Warning - Whoo - 21.04.2015

Quote:
Originally Posted by matheusspohr
Посмотреть сообщение
Fala galera boa do forum, por "recomendaзхes" baixei o GM PPC_Trucking para estudos, so q ele veio com 4 warnings, 3 jб removi, mais tem 1 que nгo estou conseguindo, se puderem me ajudar, fico grato...
PHP код:
//Warning
H:\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(182) : warning 225unreachable code 
PHP код:
if (APlayerData[playerid][RulesRead] == false) return SendClientMessage(playerid0xFFFFFFFF"{FF0000}You haven't accepted the {FFFF00}/rules{FF0000} yet"); 
Abraзos...
manda as linhas antes dessa deve haver algum return


Re: Warning - Vegassilva - 21.04.2015

Manda o comando todo ..


Re: Warning - DiegoCosta - 21.04.2015

Quote:
Originally Posted by matheusspohr
Посмотреть сообщение
Fala galera boa do forum, por "recomendaзхes" baixei o GM PPC_Trucking para estudos, so q ele veio com 4 warnings, 3 jб removi, mais tem 1 que nгo estou conseguindo, se puderem me ajudar, fico grato...
PHP код:
//Warning
H:\PPC_Trucking6\gamemodes\PPC_Trucking.pwn(182) : warning 225unreachable code 
PHP код:
if (APlayerData[playerid][RulesRead] == false) return SendClientMessage(playerid0xFFFFFFFF"{FF0000}You haven't accepted the {FFFF00}/rules{FF0000} yet"); 
Abraзos...
Tente dessa forma:

PHP код:
if (APlayerData[playerid][RulesRead] == false)
SendClientMessage(playerid0xFFFFFFFF"{FF0000}You haven't accepted the {FFFF00}/rules{FF0000} yet"); 



Re: Warning - matheusspohr - 21.04.2015

Nao й comando, isto fica na public onplayerconnect, postei a public no Pastebin:

Public

Abraзos.


Re: Warning - DiegoCosta - 21.04.2015

Quote:
Originally Posted by matheusspohr
Посмотреть сообщение
Nao й comando, isto fica na public onplayerconnect, postei a public no Pastebin:

Public

Abraзos.
E quem disse que estou postando algum comando O que postei estб na OnPlayerConnect, faзa o que eu disse e veja se funciona.

Quando vc coloca o "If" vc jб da a condiзгo "SE", ou seja, vc declara que "SE" o playr nгo leu as regras, automaticamente serб mostrada a mensagem а ele, nгo precisa fazer o "return".


Re: Warning - DiegoCosta - 21.04.2015

E tem mais um "erro" ali na sua OnPlayerConnect:

Quote:

// MissionText TextDraw setup
APlayerData[playerid][MissionText] = TextDrawCreate(321.0, 430.0, " ");// Setup the missiontext at the bottom of the screen
TextDrawAlignment(APlayerData[playerid][MissionText], 2); // Align the missiontext to the center
TextDrawUseBox(APlayerData[playerid][MissionText], 1); // Set the missiontext to display inside a box
TextDrawBoxColor(APlayerData[playerid][MissionText], 0x00000066); // Set the box color of the missiontext

return 1;

// Display a message if the player hasn't accepted the rules yet
if(APlayerData[playerid][RulesRead] == false) return SendClientMessage(playerid, 0xFFFFFFFF, "Vocк Ainda Nгo Aceitou As Regras...");
return 1;
Esses dois returns em vermelho sгo desnecessarios.


Re: Warning - matheusspohr - 21.04.2015

Quote:
Originally Posted by Vegassilva
Посмотреть сообщение
Manda o comando todo ..
Foi Este Que Falo Para Mandar O Comando Todo, sei oque significa "If"...

Bom, retirei o 1є Return que vocк falou, e ja esta funcionando, Obrigado...

Abraзos.


Re: Warning - DiegoCosta - 21.04.2015

Quote:
Originally Posted by matheusspohr
Посмотреть сообщение
Foi Este Que Falo Para Mandar O Comando Todo, sei oque significa "If"...

Bom, retirei o 1є Return que vocк falou, e ja esta funcionando, Obrigado...

Abraзos.
Desculpe, й que eu estava postando, pra mim ainda nгo havia aparecido os outros 2 posts. Verifique se o outro return "extra" nгo vai bugar o restante depois (as missiontext, no caso)


Re: Warning - matheusspohr - 21.04.2015

Bom, eu acho que nгo pois:
PHP код:
if (APlayerData[playerid][RulesRead] == false)//Verifica Se O Player 'X' Leu As Regras
return // Vai retornar
SendClientMessage(playerid0xFFFFFFFF"{FF0000}You haven't accepted the {FFFF00}/rules{FF0000} yet");//Mensagem Ao Player 'X' Na cor 'Branca'

//Apуs:
     
Return 1;
}
//Apуs isto ele irб retornar o fim de uma parte da Callback 
Abraзos.