Why this crash the server? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why this crash the server? (
/showthread.php?tid=541969)
Why this crash the server? -
alanhutch - 15.10.2014
Hi.
I have a command that crashes the server.
If you write /staff, you can insert a write, that appears on your head.
But when you insert the write in the dialog, and press OK, the server crashes.
Here's the code!
pawn Код:
if(dialogid == DIALOG_STAFF)
{
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_INPUT, "Inserisci il testo", "Inserisci il testo che vuoi nel tuo titolo.", "Vai!", "Annulla");
}
Delete3DTextLabel(PlayerLabel[playerid]);
new stringa[256];
format(stringa, sizeof(stringa), "{62b382}• %s •", inputtext);
PlayerLabel[playerid] = Create3DTextLabel(stringa, WHITE, 0.0, 0.0, 0.0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.4);
SendClientMessage(playerid, WHITE, "SERVER: Messaggio %s messo sopra la tua testa.");
}
}
//And the cmd
if (strcmp(cmd, "/staff", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid, WHITE, "Inserisci il testo che vuoi.");
ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_INPUT, "Inserisci il testo", "Inserisci il testo che vuoi nel tuo titolo.", "Vai!", "Annulla");
}
return 1;
}
Thanks...
Re: Why this crash the server? -
IceCube! - 15.10.2014
I can't see anything wrong with it? Can you post a log with CrashDetect?
https://sampforum.blast.hk/showthread.php?tid=262796
Re: Why this crash the server? -
Salva2000 - 16.10.2014
Код:
if(dialogid == DIALOG_STAFF)
{
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_INPUT, "Inserisci il testo", "Inserisci il testo che vuoi nel tuo titolo.", "Vai!", "Annulla");
}
Delete3DTextLabel(PlayerLabel[playerid]);
new stringa[256];
format(stringa, sizeof(stringa), "{62b382}• %s •", inputtext);
PlayerLabel[playerid] = Create3DTextLabel(stringa, WHITE, 0.0, 0.0, 0.0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.4);
new string2[128];
format(string2,sizeof(string2),"Messaggio %s messo sopra la tua testa.",inputtext);
SendClientMessage(playerid, WHITE, string2);
}
}