їQue he hecho mal? -> SOLUCIONADO -
SAMPGammer - 24.11.2010
SA-MP Server: 0.3b R2
Exception At Address: 0x004A4104
Registers:
EAX: 0x00000000 EBX: 0x00000400 ECX: 0x00000100 EDX: 0x7EFEFEFF
ESI: 0x00000000 EDI: 0x01A12EB8 EBP: 0x00000005 ESP: 0x0012F614
EFLAGS: 0x00010206
Stack:
+0000: 0x01490020 0x01062718 0x01A12EB8 0x0047CF0B
+0010: 0x01A12EB8 0x00000000 0x00000400 0x010441A0
+0020: 0x00000000 0x0012F66C 0x01056374 0x00000005
+0030: 0x0048C19E 0x425C0000 0x425C0000 0x00000000
+0040: 0x010441A0 0x010441A0 0x01051DE4 0x01490020
+0050: 0x00000000 0x01056384 0x01052144 0x00401096
+0060: 0x010441A0 0x01056374 0x0105238C 0x00402BB3
+0070: 0x010441A0 0x00000008 0x0012F6A4 0x01056374
+0080: 0x00000000 0x0000000B 0x00F6F1C8 0x00AAD3E0
+0090: 0x425C0000 0x00003FE8 0x00003FE8 0x00004204
+00A0: 0x0000023C 0x000041F0 0x0000023C 0x01051DE4
+00B0: 0x0105238C 0x00000000 0x010518A8 0x000005A8
+00C0: 0x00484EA8 0x010441A0 0x0012F714 0x00000005
+00D0: 0x010441A0 0x00000000 0x010441A0 0x0012F720
+00E0: 0x0012F718 0x00AAD3E0 0x01052594 0x00000000
+00F0: 0x00000000 0x00AAD3E0 0x00000000 0x0B00A801
+0100: 0x00000000 0x01052594 0x0049C5AD 0x00000208
+0110: 0x00000005 0x0012F860 0x00AAAF40 0x0012FC8C
+0120: 0x0000000C 0x00000088 0x00000088 0x00000080
+0130: 0x0012F860 0x7C91E900 0x7C920460 0x7C990600
-------------------------------------------------------------------------------------
Cуdigo que creo que ocasiona el error:
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
new string[126];
TextDrawCreate(55, 55, string);
return 1;
}
return 0;
--------------------------------------------------------------------------------------
Y el compiler dice:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
El log no dice nada,, їїїїїїїQue he hecho mal



Se cierra el server tras el comando.
------
-------
------
---
-----
Comando bien hecho:
pawn Код:
if(strcmp(cmdtext, "/decir", true, 6) == 0){
if(IsPlayerAdmin(playerid))return GameTextForAll(cmdtext[7], 10, 0);
else
{
return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Debes ser admin rcon para usar este comando");
}
Respuesta: їQue he hecho mal? -
SuperMarioRol - 24.11.2010
Ese TextDraw estб mal hecho.
Y el string no significa nada, es normal.
PD: No estoy seguro.-
Respuesta: їQue he hecho mal? -
TheChaoz - 24.11.2010
crea el textdraw dentro de OnGameModeInit y luego tras el comando usa
TextDrawShowForPlayer para mostrarlo.
Respuesta: їQue he hecho mal? -
MrDeath537 - 24.11.2010
1) Un textdraw sin texto creo que crashea, ademбs, al no tener texto no se verнa nada.
2) No lo estбs mostrando, otra razуn para no verlo.
EDIT:
Un textdraw sin texto harб crashear, fнjate en la
wiki.
Important Note: text[] must NOT be empty or the server will crash! If you need a textdraw that shows nothing, use " "
(a space) or _ (underscore)
Re: їQue he hecho mal? -
zSuYaNw - 24.11.2010
Head my tutorials.
https://sampforum.blast.hk/showthread.php?tid=155569
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
new string[126] = "you Text is here";
//TextDrawCreate(55, 55, string);
return 1;
}
return 0;
}
Re: їQue he hecho mal? -
SAMPGammer - 25.11.2010
es que queria que al poner /mycommand ALALALALA
salga
ALALALALALA
Respuesta: їQue he hecho mal? -
TheChaoz - 25.11.2010
pawn Код:
new Text:pText[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
pText[playerid] = TextDrawCreate(55, 55, "a");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/comando", true)){
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, 0xFFFFFFFF, "Uso: /comando <texto>");
TextDrawSetString(pText[playerid], tmp);
TextDrawShowForPlayer(playerid, pText[playerid]);
return 1;
}
return 0;
}
lo q ese comando va a hacer, es mostrar el texto que se le indica (solo al jugador que ejecute el comando)
Re: їQue he hecho mal? -
The_Moddler - 25.11.2010
the_chaoz, te falto TextDrawDestroy en OnPlayerDisconnect.
Aca te dejo una version que muestra el textdraw a todos y no nesecitas strtok:
pawn Код:
new Text:Texto;
forward OcultarTextdraw();
public OnGameModeInit()
{
Texto = TextDrawCreate(320.0, 240.0, " "); //Tus X e Y estaban mal, no se iba a ver.
TextDrawAlignment(Texto, 2); //Lo centramos con esto.
TextDrawSetOutline(Texto, 1); //Le pone un contorno negro.
TextDrawSetShadow(Texto, 0); //Le saca la sombra, porque queda fea para mi gusto.(borra esto si queres la sombra)
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/say", false, 4))
{
if(!strlen(cmdtext[4])) return SendClientMessage(playerid, 0xF0F0F0FF, "USO: /say [texto]");
{
new string[129];
format(string, 129, "%s", cmdtext[4]);
TextDrawSetString(Texto, string);
TextDrawShowForAll(Texto);
SetTimer("OcultarTextdraw", 6500, true);
}
return 1;
}
return 0;
}
public OcultarTextdraw()
{
TextDrawHideForAll(Texto);
TextDrawSetString(Texto, " ");
return 1;
}