Hallo mein Laptop System will net -.- Erst hatte ich das Problem das wenn ich /laden gemacht haben , der Laptop den Register und Login Dialog angezeigt hat.
Das habe ich gefixt jedoch wenn ich /laden mache öffnet sich der ganz normale Dialog auf dem ich dann auf "JA" klicke
So und dann passiert nichts mehr -.-
Bitte um hilfe hier der Code:
#include <a_samp>
public InternetBrowser(playerid, url[]);
public InternetBrowser(playerid, url[])
{
public InternetBrowser(playerid, url[])
{
if(CheckURL(url, "www.google.de"))
{
SendClientMessage(playerid, 0xFFFF00AA, "Google ist im Aufbau!");
return 1;
}
if(CheckURL(url, "www.google.de", true))
{
SendClientMessage(playerid, 0xFFFF00AA, "Google ist im Aufbau!");
return 1;
}
return ERROR_404(playerid, url);
}
//---------------------------------------
{
SendClientMessage(playerid, 0xFFFF00AA, "Google ist im Aufbau!");
return 1;
}
if(CheckURL(url, "www.google.de", true))
{
SendClientMessage(playerid, 0xFFFF00AA, "Google ist im Aufbau!");
return 1;
}
return ERROR_404(playerid, url);
}
//---------------------------------------
#define COLOR_GREEN (0x33AA33AA)
#define COLOR_RED (0xAA3333AA)
#define COLOR_YELLOW (0xFFFF00AA)
#define COLOR_RED (0xAA3333AA)
#define COLOR_YELLOW (0xFFFF00AA)
new bool: pLaptop[MAX_PLAYERS];
new pMail[MAX_PLAYERS][MAX_PLAYER_NAME];
new pChat[MAX_PLAYERS][MAX_PLAYER_NAME];
new pChatID[MAX_PLAYERS];
new pChatMSG[MAX_PLAYERS][2048];
new pMail[MAX_PLAYERS][MAX_PLAYER_NAME];
new pChat[MAX_PLAYERS][MAX_PLAYER_NAME];
new pChatID[MAX_PLAYERS];
new pChatMSG[MAX_PLAYERS][2048];
public OnPlayerDisconnect(playerid, reason)
{
pLaptop[playerid] = false;
return 1;
}
{
pLaptop[playerid] = false;
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(newinteriorid == 4 || newinteriorid == 6 || newinteriorid == 18 || newinteriorid == 17)
{
SendClientMessage(playerid, COLOR_YELLOW, "Kauf dir ein Laptop! (/buy laptop)");
}
if((oldinteriorid == 4 || oldinteriorid == 6 || oldinteriorid == 18 || oldinteriorid == 17) && pLaptop[playerid] == false)
{
SendClientMessage(playerid, COLOR_YELLOW, "Warum kaufst du kein Laptop?");
}
return 1;
}
{
if(newinteriorid == 4 || newinteriorid == 6 || newinteriorid == 18 || newinteriorid == 17)
{
SendClientMessage(playerid, COLOR_YELLOW, "Kauf dir ein Laptop! (/buy laptop)");
}
if((oldinteriorid == 4 || oldinteriorid == 6 || oldinteriorid == 18 || oldinteriorid == 17) && pLaptop[playerid] == false)
{
SendClientMessage(playerid, COLOR_YELLOW, "Warum kaufst du kein Laptop?");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/buy laptop", cmdtext, true))
{
new string[128];
new int = GetPlayerInterior(playerid);
if(int == 4 || int == 6 || int == 18 || int == 17)
{
if(GetPlayerMoney(playerid) >= 500)
{
if(pLaptop[playerid] == true) return 1;
GivePlayerMoney(playerid, GetPlayerMoney(playerid)-500);
pLaptop[playerid] = true;
SendClientMessage(playerid, COLOR_GREEN, "[LAPTOP]: Du hast ein Laptop gekauft!");
} else {
format(string, 128, "Dein Geld reicht nicht aus! (%d$)", 500);
SendClientMessage(playerid, COLOR_RED, string);
}
} else {
SendClientMessage(playerid, COLOR_RED, "Du kannst einen Laptop im 24/7 Shop kaufen!");
}
return 1;
}
if(!strcmp("/laden", cmdtext, true))
{
if(pLaptop[playerid] == true)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Laden", "Willst du Windows laden?", "Ok", "Abbrechen");
} else {
SendClientMessage(playerid, COLOR_RED, "Du hast kein Laptop!");
}
return 1;
}
return 0;
}
{
if(!strcmp("/buy laptop", cmdtext, true))
{
new string[128];
new int = GetPlayerInterior(playerid);
if(int == 4 || int == 6 || int == 18 || int == 17)
{
if(GetPlayerMoney(playerid) >= 500)
{
if(pLaptop[playerid] == true) return 1;
GivePlayerMoney(playerid, GetPlayerMoney(playerid)-500);
pLaptop[playerid] = true;
SendClientMessage(playerid, COLOR_GREEN, "[LAPTOP]: Du hast ein Laptop gekauft!");
} else {
format(string, 128, "Dein Geld reicht nicht aus! (%d$)", 500);
SendClientMessage(playerid, COLOR_RED, string);
}
} else {
SendClientMessage(playerid, COLOR_RED, "Du kannst einen Laptop im 24/7 Shop kaufen!");
}
return 1;
}
if(!strcmp("/laden", cmdtext, true))
{
if(pLaptop[playerid] == true)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Laden", "Willst du Windows laden?", "Ok", "Abbrechen");
} else {
SendClientMessage(playerid, COLOR_RED, "Du hast kein Laptop!");
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
{
if(dialogid == 1)
{
if(response)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95:", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herunterfahren");
}
return 1;
}
{
if(response)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95:", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herunterfahren");
}
return 1;
}
else if(dialogid == 2)
{
switch(listitem)
{
case 0: ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Addresse", "Spieler Name:", "Ok", "Abbrechen");
case 1: ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "MSN address", "Spieler Name:", "Ok", "Abbrechen");
case 2: ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "Internet Explorer", "URL:", "Ok", "Abbrechen");
}
return 1;
}
{
switch(listitem)
{
case 0: ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Addresse", "Spieler Name:", "Ok", "Abbrechen");
case 1: ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "MSN address", "Spieler Name:", "Ok", "Abbrechen");
case 2: ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "Internet Explorer", "URL:", "Ok", "Abbrechen");
}
return 1;
}
//---- E-mail --------------------------------------------------------------
else if(dialogid == 3)
{
if(response)
{
format(pMail[playerid], MAX_PLAYER_NAME, "%s", inputtext);
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Message", "Gib deine Nachricht ein:", "Senden", "Abbrechen");
} else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herunterfahren");
}
return 1;
}
else if(dialogid == 4)
{
if(response)
{
new string[128], pName[MAX_PLAYER_NAME], giveplayerid;
for(new i; i <= MAX_PLAYERS; i++)
{
GetPlayerName(i, pName, MAX_PLAYER_NAME);
if(strfind(pName, pMail[playerid], false) != -1)
{
giveplayerid = i;
break;
}
}
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, 128, "Nachricht von %s (%i): %s", pName, playerid, inputtext);
SendClientMessage(giveplayerid, 0xFFFF22AA, string);
GetPlayerName(giveplayerid, pName, MAX_PLAYER_NAME);
format(string, 128, "Nachricht gesenden an %s (%i): %s", pName, giveplayerid, inputtext);
SendClientMessage(playerid, 0xFFCC2299, string);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~ Nachricht Gesendet!", 3000, 3);
GameTextForPlayer(giveplayerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Nachricht Erhalten", 3000, 3);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(giveplayerid, 1057, 0.0, 0.0, 0.0);
} else {
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "Speichern", "Änderungen Speichern?", "Sichern", "Abbrechen");
}
return 1;
}
else if(dialogid == 5)
{
if(response)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "Speichern", "Speichern Fehlgeschlagen!", "Ok", "Abbrechen");
} else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herrunterfahren");
}
return 1;
}
else if(dialogid == 6)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herrunterfahren");
return 1;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//---- Internet Explorer ---------------------------------------------------
else if(dialogid == 7)
{
if(response)
{
CallRemoteFunction("InternetBrowser", "ds", playerid, inputtext);
} else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herrunterfahren");
}
return 1;
}
else if(dialogid == 8)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "Internet Explorer", "URL:", "Ok", "Abbrechen");
return 1;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//---- MSN -----------------------------------------------------------------
else if(dialogid == 9)
{
if(response)
{
new pName[MAX_PLAYER_NAME];
format(pChat[playerid], MAX_PLAYER_NAME, "%s", inputtext);
for(new i; i <= MAX_PLAYERS; i++)
{
GetPlayerName(i, pName, MAX_PLAYER_NAME);
if(strfind(pName, pChat[playerid], false) != -1)
{
pChatID[playerid] = i;
pChatID[i] = playerid;
strdel(pChatMSG[playerid], 0, strlen(pChatMSG[playerid]));
strdel(pChatMSG[pChatID[playerid]], 0, strlen(pChatMSG[pChatID[playerid]]));
break;
}
}
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_INPUT, "Nachricht", "Gib deine Nachricht ein:", "Senden", "Abbrechen");
}
return 1;
}
else if(dialogid == 10)
{
if(response)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(pChatMSG[playerid], 2048, "%s%s's Nachricht:\n * %s\n", pChatMSG[pChatID[playerid]], pName, inputtext);
ShowPlayerDialog(pChatID[playerid], 11, DIALOG_STYLE_LIST, "Windows Live Messenger", pChatMSG[playerid], "Antworten", "Abbrechen");
}
}
else if(dialogid == 11)
{
if(response)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "Message", "Gib deine Nachricht ein:", "Senden", "Abbrechen");
}
}
else if(dialogid == 12)
{
if(response)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(pChatMSG[playerid], 2048, "%s%s's Nachricht:\n * %s\n", pChatMSG[pChatID[playerid]], pName, inputtext);
ShowPlayerDialog(pChatID[playerid], 13, DIALOG_STYLE_LIST, "Windows Live Messenger", pChatMSG[playerid], "Antworten", "Abbrechen");
}
}
else if(dialogid == 13)
{
if(response)
{
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_INPUT, "Nachricht", "Gib deine Nachricht ein:", "Sendeb", "Abbrechen");
}
}
return 1;
}
else if(dialogid == 3)
{
if(response)
{
format(pMail[playerid], MAX_PLAYER_NAME, "%s", inputtext);
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Message", "Gib deine Nachricht ein:", "Senden", "Abbrechen");
} else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herunterfahren");
}
return 1;
}
else if(dialogid == 4)
{
if(response)
{
new string[128], pName[MAX_PLAYER_NAME], giveplayerid;
for(new i; i <= MAX_PLAYERS; i++)
{
GetPlayerName(i, pName, MAX_PLAYER_NAME);
if(strfind(pName, pMail[playerid], false) != -1)
{
giveplayerid = i;
break;
}
}
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, 128, "Nachricht von %s (%i): %s", pName, playerid, inputtext);
SendClientMessage(giveplayerid, 0xFFFF22AA, string);
GetPlayerName(giveplayerid, pName, MAX_PLAYER_NAME);
format(string, 128, "Nachricht gesenden an %s (%i): %s", pName, giveplayerid, inputtext);
SendClientMessage(playerid, 0xFFCC2299, string);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~ Nachricht Gesendet!", 3000, 3);
GameTextForPlayer(giveplayerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Nachricht Erhalten", 3000, 3);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(giveplayerid, 1057, 0.0, 0.0, 0.0);
} else {
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "Speichern", "Änderungen Speichern?", "Sichern", "Abbrechen");
}
return 1;
}
else if(dialogid == 5)
{
if(response)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "Speichern", "Speichern Fehlgeschlagen!", "Ok", "Abbrechen");
} else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herrunterfahren");
}
return 1;
}
else if(dialogid == 6)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herrunterfahren");
return 1;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//---- Internet Explorer ---------------------------------------------------
else if(dialogid == 7)
{
if(response)
{
CallRemoteFunction("InternetBrowser", "ds", playerid, inputtext);
} else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Menu - Windows 95", "Microsoft Office Outlook 1995\nWindows Live Messenger 1.0\nInternet Explorer BETA1", "Auswählen", "Herrunterfahren");
}
return 1;
}
else if(dialogid == 8)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "Internet Explorer", "URL:", "Ok", "Abbrechen");
return 1;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//---- MSN -----------------------------------------------------------------
else if(dialogid == 9)
{
if(response)
{
new pName[MAX_PLAYER_NAME];
format(pChat[playerid], MAX_PLAYER_NAME, "%s", inputtext);
for(new i; i <= MAX_PLAYERS; i++)
{
GetPlayerName(i, pName, MAX_PLAYER_NAME);
if(strfind(pName, pChat[playerid], false) != -1)
{
pChatID[playerid] = i;
pChatID[i] = playerid;
strdel(pChatMSG[playerid], 0, strlen(pChatMSG[playerid]));
strdel(pChatMSG[pChatID[playerid]], 0, strlen(pChatMSG[pChatID[playerid]]));
break;
}
}
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_INPUT, "Nachricht", "Gib deine Nachricht ein:", "Senden", "Abbrechen");
}
return 1;
}
else if(dialogid == 10)
{
if(response)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(pChatMSG[playerid], 2048, "%s%s's Nachricht:\n * %s\n", pChatMSG[pChatID[playerid]], pName, inputtext);
ShowPlayerDialog(pChatID[playerid], 11, DIALOG_STYLE_LIST, "Windows Live Messenger", pChatMSG[playerid], "Antworten", "Abbrechen");
}
}
else if(dialogid == 11)
{
if(response)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "Message", "Gib deine Nachricht ein:", "Senden", "Abbrechen");
}
}
else if(dialogid == 12)
{
if(response)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(pChatMSG[playerid], 2048, "%s%s's Nachricht:\n * %s\n", pChatMSG[pChatID[playerid]], pName, inputtext);
ShowPlayerDialog(pChatID[playerid], 13, DIALOG_STYLE_LIST, "Windows Live Messenger", pChatMSG[playerid], "Antworten", "Abbrechen");
}
}
else if(dialogid == 13)
{
if(response)
{
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_INPUT, "Nachricht", "Gib deine Nachricht ein:", "Sendeb", "Abbrechen");
}
}
return 1;
}
ERROR_404(playerid, url[])
{
new string[64];
format(string, sizeof(string), "%s - 404", url);
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, string, "Seite nicht Gefunden!", "Ok", "Abbrechen");
return 1;
}
{
new string[64];
format(string, sizeof(string), "%s - 404", url);
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, string, "Seite nicht Gefunden!", "Ok", "Abbrechen");
return 1;
}
stock CheckURL(string[], url[], bool: search = false)
{
if(search == false)
{
for(new i; i <= strlen(string); i++)
{
if(string[i] != url[i])
{
return false;
}
}
} else {
if(strfind(string, url, false) != -1)
{
return true;
} else {
return false;
}
}
return true;
}
{
if(search == false)
{
for(new i; i <= strlen(string); i++)
{
if(string[i] != url[i])
{
return false;
}
}
} else {
if(strfind(string, url, false) != -1)
{
return true;
} else {
return false;
}
}
return true;
}
Danke an Alle die mir Helfen!!!