TextDraws -
ZaturN - 15.01.2014
#RESOLVIDO.
O erro era meu mesmo (KkKkKKKK)
em vez de new Text:NaoTem[MAX_PLAYERS]; o correto й new Text:NaoTem;
Respuesta: TextDraws -
cantiliano - 15.01.2014
pawn Код:
new Text:NaoTem[ MAX_PLAYERS ] ;
for( new i = 0; i < MAX_PLAYERS; ++i )
{
NaoTem[ i ] = TextDrawCreate(248.000000, 351.000000,"Voce nao tem");
TextDrawAlignment(NaoTem[ i ], 0);
TextDrawBackgroundColor(NaoTem[ i ], 0x000000ff);
TextDrawFont(NaoTem[ i ], 1);
TextDrawLetterSize(NaoTem[ i ],0.299999, 1.100000);
TextDrawColor(NaoTem[ i ], 0xffffffff);
TextDrawSetOutline(NaoTem[ i ], 1);
TextDrawSetProportional(NaoTem[ i ], 1);
TextDrawSetShadow(NaoTem[ i ], 1);
}
if(strcmp(cmdtext,"/naotem", true)==0)
{
TextDrawShowForPlayer ( playerid, NaoTem[ playerid ]);
return 1;
}
tente assim
Re: TextDraws -
ZaturN - 15.01.2014
Sim agora compilou, mas quando vou abrir o server ele fecha e criando um arquivo crashinfo
Respuesta: Re: TextDraws -
cantiliano - 15.01.2014
A Cara ai e seu gm nao e o codigo nao vejo nada de errado com ele ! veja o que e
Re: TextDraws -
ZaturN - 15.01.2014
Eu Comecei um outro gm e nele so tem armas pelo addmenuitem e pickups de entrada e saida, e mapa icones, e um checkpoint
Re: TextDraws -
ZaturN - 15.01.2014
#Cantiliano achei o erro й aki olha, mas serб que vocк poderia ver para mim o que pode ser? eu nгo sei !
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:Menu;
new grana;
Menu = GetPlayerMenu(playerid);
grana = GetPlayerGrana(playerid);
if(Menu == Lista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(PistolasLista, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(MicroLista, playerid);
}
case 2:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(EscopetaLista, playerid);
}
case 3:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(SMGLista, playerid);
}
case 4:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(RifleLista, playerid);
}
case 5:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(AssaltoLista, playerid);
}
}
}
if(Menu == PistolasLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(PistolasLista,playerid);
ShowMenuForPlayer(Pistola9mm, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(PistolasLista,playerid);
ShowMenuForPlayer(Pistola9mms, playerid);
}
case 2:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(PistolasLista,playerid);
ShowMenuForPlayer(DesertEagle, playerid);
}
}
}
if(Menu == MicroLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(MicroLista,playerid);
ShowMenuForPlayer(Tec9, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(MicroLista,playerid);
ShowMenuForPlayer(MicroSMG, playerid);
}
}
}
if(Menu == EscopetaLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(EscopetaLista,playerid);
ShowMenuForPlayer(Escopeta, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(EscopetaLista,playerid);
ShowMenuForPlayer(EscopetaCS, playerid);
}
case 2:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(EscopetaLista,playerid);
ShowMenuForPlayer(EscopetaC, playerid);
}
}
}
if(Menu == SMGLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(SMGLista,playerid);
ShowMenuForPlayer(SMG, playerid);
}
}
}
if(Menu == RifleLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(RifleLista,playerid);
ShowMenuForPlayer(Rifle, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(RifleLista,playerid);
ShowMenuForPlayer(RifleS, playerid);
}
}
}
if(Menu == AssaltoLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(AssaltoLista,playerid);
ShowMenuForPlayer(Ak47, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(AssaltoLista,playerid);
ShowMenuForPlayer(M4, playerid);
}
}
}
if(Menu == Pistola9mm)
{
switch(row)
{
case 0:
{
if(grana > 148)
{
GivePlayerGrana(playerid, -149);
GivePlayerWeapon(playerid, 22, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Pistola9mms)
{
switch(row)
{
case 0:
{
if(grana > 168)
{
GivePlayerGrana(playerid, -169);
GivePlayerWeapon(playerid, 23, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == DesertEagle)
{
switch(row)
{
case 0:
{
if(grana > 348)
{
GivePlayerGrana(playerid, -349);
GivePlayerWeapon(playerid, 24, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Tec9)
{
switch(row)
{
case 0:
{
if(grana > 448)
{
GivePlayerGrana(playerid, -449);
GivePlayerWeapon(playerid, 32, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == MicroSMG)
{
switch(row)
{
case 0:
{
if(grana > 398)
{
GivePlayerGrana(playerid, -399);
GivePlayerWeapon(playerid, 28, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Escopeta)
{
switch(row)
{
case 0:
{
if(grana > 448)
{
GivePlayerGrana(playerid, -449);
GivePlayerWeapon(playerid, 25, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == EscopetaCS)
{
switch(row)
{
case 0:
{
if(grana > 548)
{
GivePlayerGrana(playerid, -549);
GivePlayerWeapon(playerid, 26, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == EscopetaC)
{
switch(row)
{
case 0:
{
if(grana > 398)
{
GivePlayerGrana(playerid, -399);
GivePlayerWeapon(playerid, 27, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == SMG)
{
switch(row)
{
case 0:
{
if(grana > 388)
{
GivePlayerGrana(playerid, -389);
GivePlayerWeapon(playerid, 29, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Rifle)
{
switch(row)
{
case 0:
{
if(grana > 248)
{
GivePlayerGrana(playerid, -249);
GivePlayerWeapon(playerid, 33, 9999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == RifleS)
{
switch(row)
{
case 0:
{
if(grana > 998)
{
GivePlayerGrana(playerid, -999);
GivePlayerWeapon(playerid, 34, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Ak47)
{
switch(row)
{
case 0:
{
if(grana > 698)
{
GivePlayerGrana(playerid, -699);
GivePlayerWeapon(playerid, 30, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == M4)
{
switch(row)
{
case 0:
{
if(grana > 748)
{
GivePlayerGrana(playerid, -749);
GivePlayerWeapon(playerid, 31, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
return 1;
}
Respuesta: Re: TextDraws -
cantiliano - 15.01.2014
Ja que vocк achou manda o erro para mim ver se nao e impossivel e tbm tente indenta seus codigos tente assim se nao der mande os erros que deu
pawn Код:
public OnPlayerSelectedMenuRow ( playerid , row )
{
new Menu:Menu;
new grana;
Menu = GetPlayerMenu(playerid);
grana = GetPlayerGrana(playerid);
if(Menu == Lista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(PistolasLista, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(MicroLista, playerid);
}
case 2:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(EscopetaLista, playerid);
}
case 3:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(SMGLista, playerid);
}
case 4:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(RifleLista, playerid);
}
case 5:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(Lista,playerid);
ShowMenuForPlayer(AssaltoLista, playerid);
}
}
}
if(Menu == PistolasLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(PistolasLista,playerid);
ShowMenuForPlayer(Pistola9mm, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(PistolasLista,playerid);
ShowMenuForPlayer(Pistola9mms, playerid);
}
case 2:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(PistolasLista,playerid);
ShowMenuForPlayer(DesertEagle, playerid);
}
}
}
if(Menu == MicroLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(MicroLista,playerid);
ShowMenuForPlayer(Tec9, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(MicroLista,playerid);
ShowMenuForPlayer(MicroSMG, playerid);
}
}
}
if(Menu == EscopetaLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(EscopetaLista,playerid);
ShowMenuForPlayer(Escopeta, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(EscopetaLista,playerid);
ShowMenuForPlayer(EscopetaCS, playerid);
}
case 2:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(EscopetaLista,playerid);
ShowMenuForPlayer(EscopetaC, playerid);
}
}
}
if(Menu == SMGLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(SMGLista,playerid);
ShowMenuForPlayer(SMG, playerid);
}
}
}
if(Menu == RifleLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(RifleLista,playerid);
ShowMenuForPlayer(Rifle, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(RifleLista,playerid);
ShowMenuForPlayer(RifleS, playerid);
}
}
}
if(Menu == AssaltoLista)
{
switch(row)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(AssaltoLista,playerid);
ShowMenuForPlayer(Ak47, playerid);
}
case 1:
{
TogglePlayerControllable(playerid, 0);
HideMenuForPlayer(AssaltoLista,playerid);
ShowMenuForPlayer(M4, playerid);
}
}
}
if(Menu == Pistola9mm)
{
switch(row)
{
case 0:
{
if(grana > 148)
{
GivePlayerGrana(playerid, -149);
GivePlayerWeapon(playerid, 22, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Pistola9mms)
{
switch(row)
{
case 0:
{
if(grana > 168)
{
GivePlayerGrana(playerid, -169);
GivePlayerWeapon(playerid, 23, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == DesertEagle)
{
switch(row)
{
case 0:
{
if(grana > 348)
{
GivePlayerGrana(playerid, -349);
GivePlayerWeapon(playerid, 24, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Tec9)
{
switch(row)
{
case 0:
{
if(grana > 448)
{
GivePlayerGrana(playerid, -449);
GivePlayerWeapon(playerid, 32, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == MicroSMG)
{
switch(row)
{
case 0:
{
if(grana > 398)
{
GivePlayerGrana(playerid, -399);
GivePlayerWeapon(playerid, 28, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Escopeta)
{
switch(row)
{
case 0:
{
if(grana > 448)
{
GivePlayerGrana(playerid, -449);
GivePlayerWeapon(playerid, 25, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == EscopetaCS)
{
switch(row)
{
case 0:
{
if(grana > 548)
{
GivePlayerGrana(playerid, -549);
GivePlayerWeapon(playerid, 26, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == EscopetaC)
{
switch(row)
{
case 0:
{
if(grana > 398)
{
GivePlayerGrana(playerid, -399);
GivePlayerWeapon(playerid, 27, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == SMG)
{
switch(row)
{
case 0:
{
if(grana > 388)
{
GivePlayerGrana(playerid, -389);
GivePlayerWeapon(playerid, 29, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Rifle)
{
switch(row)
{
case 0:
{
if(grana > 248)
{
GivePlayerGrana(playerid, -249);
GivePlayerWeapon(playerid, 33, 9999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == RifleS)
{
switch(row)
{
case 0:
{
if(grana > 998)
{
GivePlayerGrana(playerid, -999);
GivePlayerWeapon(playerid, 34, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == Ak47)
{
switch(row)
{
case 0:
{
if(grana > 698)
{
GivePlayerGrana(playerid, -699);
GivePlayerWeapon(playerid, 30, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
if(Menu == M4)
{
switch(row)
{
case 0:
{
if(grana > 748)
{
GivePlayerGrana(playerid, -749);
GivePlayerWeapon(playerid, 31, 99999);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк nгo tem dinheiro suficiente");
TogglePlayerControllable(playerid, 1);
}
}
}
}
return 1;
}
Re: TextDraws -
ZaturN - 15.01.2014
Vlw arrumo, eu nгo sei identar direito ;/
#EDIT Eu coloquei isto:
pawn Код:
new Text:NaoTem[ MAX_PLAYERS ] ;
for( new i = 0; i < MAX_PLAYERS; ++i )
{
NaoTem[ i ] = TextDrawCreate(248.000000, 351.000000,"Voce nao tem");
TextDrawAlignment(NaoTem[ i ], 0);
TextDrawBackgroundColor(NaoTem[ i ], 0x000000ff);
TextDrawFont(NaoTem[ i ], 1);
TextDrawLetterSize(NaoTem[ i ],0.299999, 1.100000);
TextDrawColor(NaoTem[ i ], 0xffffffff);
TextDrawSetOutline(NaoTem[ i ], 1);
TextDrawSetProportional(NaoTem[ i ], 1);
TextDrawSetShadow(NaoTem[ i ], 1);
}
if(strcmp(cmdtext,"/naotem", true)==0)
{
TextDrawShowForPlayer ( playerid, NaoTem[ playerid ]);
return 1;
}
e voltou a dar crash.
O erro ainda continuar no OnPlayerSelectedMenuRow
Re: TextDraws -
Wellington1999 - 15.01.2014
coloca na Ongamemodeinit
Re: TextDraws -
ZaturN - 16.01.2014
Mas eu coloco na OnGameModeInit