15.10.2014, 21:16
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!
Thanks...
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;
}