Hallo Leute,
und zwar habe ich ein Problem am Script da mein Computer nach einer Virusattacke komplett im Arsch war habe ich mich nach einiger Zeit nochmal neu ans Scripten drangesetzt.
Jetzt habe ich aber das Problem das der Server keine SendClientMessage mehr sendet ich versteh jetzt auch nicht wo dran es liegt villeicht bin ich auch nur zu blind das Problem zu finden.
Es wäre toll wenn Ihr da was findet
/* BIG CITY REALLIFE SCRIPT
erstellt von DarkAngel*/
//INCLUDE
#include <a_samp>
#include <ocmd>
#include <sscanf2>
#include <a_mysql>
//MYSQL Datenbank
#define db_host "----"
#define db_user "---"
#define db_pass "----"
#define db_db "-----"
//FARBEN
#define Willkommen 0x00FF78FF
#define PN 0x787878FF
#define INFO 0xFFA000FF
#define ABBRUCH 0xFF4600FF
#define OK 0x21C000FF
#define FEHLER 0xFF0A00FF
#define ADMIN 0xB400FFFF
#define ERFOLG 0x0FFF00FF
//DIALOG
#define DRegistrierung 1
#define DLogin 2
#define DTeleport 3
//ENUMS
enum SpielerInfo{
eingeloggt,
level,
id,
alevel
}
//GLOBALE VARIABLEN
new MySQL;
new sInfo[MAX_PLAYERS][SpielerInfo];
//FORWARD
forward OnUserCheck(playerid);
forward OnPasswortResponse(playerid);
main()
{
print("----------------------------------------------");
print("Dieses Script ist erstellt worden von DarkAngel");
print("Dieses Script ist nur für den BigCityReallife");
print("----------------------------------------------");
}
public OnGameModeInit()
{
SetGameModeText("BigCityReallife");
MySQL = mysql_connect(db_host,db_user,db_db,db_pass);
AddPlayerClass(1,-1958.1277,139.3322,27.6940,267.5759, 0, 0, 0, 0, 0, 0);
AddPlayerClass(2,-1958.1277,139.3322,27.6940,267.5759, 0, 0, 0, 0, 0, 0);
AddPlayerClass(3,-1958.1277,139.3322,27.6940,267.5759, 0, 0, 0, 0, 0, 0);
AddPlayerClass(4,-1958.1277,139.3322,27.6940,267.5759, 0, 0, 0, 0, 0, 0);
AddPlayerClass(6,-1958.1277,139.3322,27.6940,267.5759, 0, 0, 0, 0, 0, 0);
AddPlayerClass(7,-1958.1277,139.3322,27.6940,267.5759, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, -1917.4500,205.0122,35.1563);
SetPlayerCameraPos(playerid, -1912.3405,210.4128,35.1563);
SetPlayerCameraLookAt(playerid, -1917.4500,205.0122,35.1563);
SetPlayerFacingAngle(playerid,317.5413);
return 1;
}
public OnPlayerConnect(playerid)
{
//LOGIN/REGISTER
new name[MAX_PLAYER_NAME],query[128];
GetPlayerName(playerid,name,sizeof(name));
format(query,sizeof(query),"SELECT id FROM user WHERE username='%s'",name);
mysql_function_query(MySQL,query,true,"OnUserCheck","i",playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
savePlayer(playerid);
resetPlayer(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,-1951.8358,144.6791,26.2813);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DRegistrierung)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>=3)
{
mysql_escape_string(inputtext,passwort,MySQL);
format(query,sizeof(query),"INSERT INTO user (username,password) VALUES ('%s',MD5('%s'))",name,passwort);
mysql_function_query(MySQL,query,false,"","");
}
else
{
SendClientMessage(playerid,FEHLER,"FEHLER:Dein Passwort ist zu kurz gebe bitte ein Passwort an was größer als 3 Zeichen ist");
ShowPlayerDialog(playerid,DRegistrierung,DIALOG_STYLE_INPUT,"REGISTRATION","Herzlich Willkommen auf BigCityReallife\nDein Passwort war zu kurz bitte gebe ein Passwort an das Größer als 3 Zeichen ist an\nGebe Niemals dein Passwort an dritte weiter",
"OK","ABBRECHEN");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DLogin)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,MySQL);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND password=MD5('%s')",name,passwort);
mysql_function_query(MySQL,query,true,"OnPasswortResponse","i",playerid);
}
else
{
SendClientMessage(playerid,FEHLER,"FEHLER:Das eingegeben Passwort war Fehlerhaft oder wurde nicht richtig eingegeben");
ShowPlayerDialog(playerid,DLogin,DIALOG_STYLE_PASSWORD,"LOGIN","Herzlich Willkommen zurück auf BigCityReallife\nDu hast dein Passwort Fehlerhaft oder nicht richtig eingegeben\nBitte logge dich ein","LOGIN","ABBRUCH");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DTeleport)
{
if(response)
{
if(listitem==0)
{
//SPAWN
SetPlayerPos(playerid,-1958.1277,139.3322,27.6940);
SendClientMessage(playerid,OK,"Teleportvorgang ist erfolgt");
}
if(listitem==1)
{
//AUTOHAUS1
SetPlayerPos(playerid,-1958.1277,139.3322,27.6940);
SendClientMessage(playerid,OK,"Teleportvorgang ist erfolgt");
}
}
else
{
SendClientMessage(playerid,ABBRUCH,"SERVER:Teleportvorgang Abgebrochen");
}
return 1;
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public OnUserCheck(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,MySQL);
if(num_rows==0)
{
//REGISTRIERUNG
ShowPlayerDialog(playerid,DRegistrierung,DIALOG_STYLE_INPUT,"REGISTRATION","Herzlich Willkommen auf BigCityReallife\nDein Account wurde leider noch nicht in unserer Datenbank gefunden.\nDamit du schnell hier spielen kannst gebe bitte dein Passwort ein\n Gebe Niemals dein Passwort an dritte weiter",
"OK","ABBRECHEN");
}
else
{
//LOGIN
ShowPlayerDialog(playerid,DLogin,DIALOG_STYLE_PASSWORD,"LOGIN","Herzlich Willkommen zurück auf BigCityReallife\nDein Account wurde in der Datenbank gefunden\nBitte logge dich ein","LOGIN","ABBRUCH");
}
return;
}
public OnPasswortResponse(playerid)
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,MySQL);
if(num_rows==1)
{
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(0,"level",MySQL);
sInfo[playerid][id] = cache_get_field_content_int(0,"id",MySQL);
SetPlayerScore(playerid,sInfo[playerid][level]);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",MySQL));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",MySQL);
}
else
{
SendClientMessage(playerid,FEHLER,"SERVER:Dein eingegebnes Passwort ist Falsch");
ShowPlayerDialog(playerid,DLogin,DIALOG_STYLE_PASSWORD,"LOGIN","Herzlich Willkommen zurück auf BigCityReallife\nDein Account wurde in der Datenbank gefunden\nBitte logge dich ein","LOGIN","ABBRUCH");
}
return 1;
}
savePlayer(playerid)
{
if(sInfo[playerid][eingeloggt]==0)return 1;
new query[128];
format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',alevel='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][id]);
mysql_function_query(MySQL,query,false,"","");
return 1;
}
resetPlayer(playerid)
{
sInfo[playerid][eingeloggt]=0;
sInfo[playerid][level]=0;
sInfo[playerid][id]=0;
return 1;
}
SetPlayerMoney(playerid,money)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,money);
return 1;
}
//ADMINABFRAGE
isAdmin(playerid,a_level)
{
if(sInfo[playerid][alevel]>=a_level)return 1;
return 0;
}
//ADMINBEFEHLE
ocmd:teleport(playerid,params[])
{
if(!isAdmin(playerid,2))return SendClientMessage(playerid,ADMIN,"Du bist kein [BCR] Teammitglied oder dein Rang ist zu niedrig");
ShowPlayerDialog(playerid,DTeleport,DIALOG_STYLE_LIST,"TELEPORT","Spawn\nAutohaus1","OK","ABBRECHEN");
return 1;
}
ocmd:admin(playerid,params[])
{
new pID,a_level,string[128],string2[128];
if(!isAdmin(playerid,6))return SendClientMessage(playerid,ADMIN,"Du bist kein [BCR] Teammitglied oder dein Rang ist zu niedrig");
format(string,sizeof(string),"Dein Adminrang wurde auf Rang:'%i' geändert.",a_level);
format(string2,sizeof(string2),"Der Adminrang des Spielers wurde erfolgreich auf Rang:'%i' geändert.",a_level);
if(sscanf(params,"ui",pID,a_level))return SendClientMessage(playerid,INFO,"INFO:/admin [playerid][adminrang]");
sInfo[pID][alevel]=a_level;
savePlayer(pID);
SendClientMessage(pID,ERFOLG,string);
SendClientMessage(playerid,ERFOLG,string2);
return 1;
}
ocmd:aduty(playerid,params[])
{
if(!isAdmin(playerid,1))
{
SendClientMessage(playerid,ADMIN,"Du bist kein [BCR] Teammitglied oder dein Rang ist zu niedrig");
}
else
{
SetPlayerColor(playerid,ADMIN);
SetPlayerSkin(playerid,61);
SendClientMessage(playerid,ADMIN,"Du bist nun im Admindienst");
}
return 1;
}
//SPIELRBEFEHLE
ocmd:pn(playerid,params[])
{
new pID,text[128];
if(sscanf(params,"us[128]",pID,text))return SendClientMessage(playerid,INFO,"INFO:/pn [playerid][text]");
SendClientMessage(pID,PN,text);
SendClientMessage(playerid,PN,text);
return 1;
}
//FRAKTIONSBEFEHLE