Neuer Fehler:
Script[gamemodes/RLvH_1.amx]: Run time error 19: "File or function is not found"
Number of vehicle models: 0
Neuer Fehler:
Script[gamemodes/RLvH_1.amx]: Run time error 19: "File or function is not found"
Number of vehicle models: 0
#include <a_samp>
#include <a_mysql>
#iclude <streamer>
/e
Jeffry, kannst du vllt mal drüberschauen?
error 031: unknown directive nach dem einbauen des includes
Hey,
Viele sagten mir, ich muss das streamer plugin installieren.
Dies habe ich dann getan (neuste version).
Aber ich erhalten trotzdem den selben Fehler.
undefined symbol "CreateDynamicObject"
Der Code:
(OnGameModeInIt)
CreateDynamicObject(7326, 1383.87793, -935.88977, 33.16300, 0.00000, 0.00000, 180.00000);
CreateDynamicObject(970, 1372.25879, -948.35199, 33.77590, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(970, 1368.36365, -947.33325, 33.77590, 0.00000, 0.00000, -29.00000);
CreateDynamicObject(970, 1365.26501, -944.70142, 33.77590, 0.00000, 0.00000, -52.00000);
CreateDynamicObject(970, 1363.63184, -941.05579, 33.77590, 0.00000, 0.00000, -79.50000);
CreateDynamicObject(970, 1363.82178, -937.05615, 33.77590, 0.00000, 0.00000, -106.50000);
CreateDynamicObject(970, 1365.75452, -933.51971, 33.77590, 0.00000, 0.00000, -130.50000);
CreateDynamicObject(970, 1368.99597, -931.15216, 33.77590, 0.00000, 0.00000, -157.50000);
CreateDynamicObject(970, 1372.95435, -930.45673, 33.77590, 0.00000, 0.00000, -182.00000);
CreateDynamicObject(970, 1376.82312, -931.53424, 33.77590, 0.00000, 0.00000, -210.00000);
CreateDynamicObject(970, 1379.79785, -934.22101, 33.77590, 0.00000, 0.00000, -235.00000);
CreateDynamicObject(970, 1381.31616, -937.95081, 33.77590, 0.00000, 0.00000, -260.50000);
CreateDynamicObject(970, 1381.06738, -941.94531, 33.77590, 0.00000, 0.00000, -286.50000);
CreateDynamicObject(970, 1379.13306, -945.48767, 33.77590, 0.00000, 0.00000, -310.50000);
CreateDynamicObject(970, 1375.84692, -947.77783, 33.77590, 0.00000, 0.00000, -340.00000);
CreateDynamicObject(3515, 1372.52136, -939.85486, 32.71480, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(9833, 1372.20215, -939.89569, 36.71630, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1376.61438, -944.91187, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1373.83362, -945.54718, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1373.07251, -943.04407, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1375.49805, -942.05145, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1375.74512, -937.80597, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1378.22864, -937.20233, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1377.41040, -934.31158, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1374.76770, -934.99951, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1370.63306, -936.14960, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1370.21558, -933.43878, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1367.80664, -934.44873, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1368.18518, -937.06519, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1368.74658, -940.92987, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1365.98767, -941.02643, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1366.38586, -943.73273, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(870, 1369.14282, -943.82251, 33.37520, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(673, 1376.80029, -936.23700, 33.28740, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(673, 1369.54236, -935.43201, 33.28740, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(673, 1367.79004, -942.58160, 33.28740, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(673, 1375.13135, -944.05890, 33.28740, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1375.99487, -934.33398, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1377.14978, -937.97778, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1375.30957, -936.69073, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1378.11182, -935.61237, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1376.48682, -943.30725, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1375.28479, -945.57001, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1373.26282, -944.45184, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1374.20166, -942.07031, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1369.65100, -942.98676, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1367.58105, -944.37909, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1365.76660, -942.68457, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1367.55566, -940.63458, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1367.87842, -935.83704, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1369.12952, -933.60089, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1370.98230, -934.72162, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1369.81494, -936.83020, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19425, 1368.17725, -954.60223, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1364.91650, -954.16681, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1361.63977, -953.73505, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1358.36438, -953.29681, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1372.59448, -955.26538, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1375.87378, -955.70007, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1379.14587, -956.13501, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1382.41907, -956.56482, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19121, 1371.39197, -955.30023, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1369.27441, -954.95673, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1382.76941, -956.64404, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1357.88135, -953.30371, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19425, 1384.54028, -925.86633, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1381.29297, -925.45630, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1378.18933, -925.04156, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1374.99194, -924.61053, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1371.56824, -924.10986, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1368.26123, -923.67261, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1364.97485, -923.23615, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19425, 1361.70837, -922.79968, 33.17630, 0.00000, 0.00000, -7.50000);
CreateDynamicObject(19121, 1361.41785, -922.80469, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1375.07263, -924.52490, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1372.91248, -924.12952, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1386.33582, -926.14001, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1390.18701, -931.58728, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1356.05383, -927.27332, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1353.84229, -947.79633, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(19121, 1388.24670, -952.22839, 33.77070, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(737, 1385.68811, -954.63593, 33.62260, 0.00000, 0.00000, -8.50000);
CreateDynamicObject(737, 1388.88562, -928.83191, 33.62260, 0.00000, 0.00000, -8.50000);
CreateDynamicObject(737, 1358.57007, -924.70569, 33.62260, 0.00000, 0.00000, -8.50000);
CreateDynamicObject(1361, 1370.38489, -955.25427, 34.15270, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(1361, 1374.00745, -924.20868, 34.15270, 0.00000, 0.00000, 0.00000);
CreateDynamicObject(737, 1355.32947, -951.02539, 33.62260, 0.00000, 0.00000, -8.50000);
Alles anzeigen
Mir fällt jetzt erst auf, dass ich code vergessen habe gg.
Account Laden:
public OnPasswordResponse(playerid)
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
// Passwort richtig
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
sInfo[playerid][p_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerScore(playerid,sInfo[playerid][level]);
SetPlayerMoney(playerid, cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][skin] = cache_get_field_content_int(0,"skin",dbhandle);
SetPlayerSkin(playerid, sInfo[playerid][skin]);
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
}
else
{
// Passwort falsch
SendClientMessage(playerid, -1, "Passwort Falsch.");
Kick(playerid);
}
return 1;
}
Das Script läuft auf MySQL.
Eingetragen wird die skinid bzw ich wähle ein skin und er wird in die datenbank eingetragen, aber wenn ich reconnecte, wird der Skin von AddPlayerClass geladen und nicht der von der Datenbank
Hey,
Ich möchte dass wenn der Spieler nicht genug geld hat, was nicht kaufen kann.
Im moment mache ich GivePlayerMoney(playerid, -150000);
Aber dadurch kommt der Spieler ins minus.
Wenn er nicht genug geld hat, soll er es nicht kaufen können.
ganz oben im script:
new Text:skinbg;
new Text:managebox;
new Text:rand1;
new Text:rand2;
new Text:rand3;
new Text:rand4;
new Text:liniemitte;
new Text:skinfertig;
new Text:skinback;
new Text:skinnext;
GameModeInIt:
skinbg = TextDrawCreate(429.666625, 344.137145, "usebox");
TextDrawLetterSize(skinbg, 0.000000, 5.444648);
TextDrawTextSize(skinbg, 230.333358, 0.000000);
TextDrawAlignment(skinbg, 1);
TextDrawColor(skinbg, 0);
TextDrawUseBox(skinbg, true);
TextDrawBoxColor(skinbg, 102);
TextDrawSetShadow(skinbg, 0);
TextDrawSetOutline(skinbg, 0);
TextDrawFont(skinbg, 1);
managebox = TextDrawCreate(266.666656, 376.651977, "> SKINAUSWAHL <");
TextDrawLetterSize(managebox, 0.449999, 1.600000);
TextDrawAlignment(managebox, 1);
TextDrawColor(managebox, -1);
TextDrawSetShadow(managebox, 0);
TextDrawSetOutline(managebox, 1);
TextDrawBackgroundColor(managebox, 51);
TextDrawFont(managebox, 2);
TextDrawSetProportional(managebox, 1);
usw...
ocmd:skinauswahl(playerid,params[])
{
if(IsPlayerInArena[playerid]==1)
{
SendClientMessage(playerid, -1, "Bitte verlasse zuerst die Arena!");
}
else
{
SetPlayerPos(playerid, 2158.8457,1127.8928,23.3359);
SetPlayerFacingAngle(playerid, 270.0);
TogglePlayerControllable(playerid,0);
SelectTextDraw(playerid, 0x00FFFFFF);
TextDrawShowForPlayer(playerid, skinbg);
TextDrawShowForPlayer(playerid, managebox);
TextDrawShowForPlayer(playerid, rand1);
TextDrawShowForPlayer(playerid, rand2);
TextDrawShowForPlayer(playerid, rand3);
TextDrawShowForPlayer(playerid, rand4);
TextDrawShowForPlayer(playerid, liniemitte);
TextDrawShowForPlayer(playerid, skinfertig);
TextDrawShowForPlayer(playerid, skinback);
TextDrawShowForPlayer(playerid, skinnext);
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == skinnext)
{
SetPlayerSkin(playerid, GetPlayerSkin(playerid)+1);
return 1;
}
if(clickedid == skinback)
{
SetPlayerSkin(playerid, GetPlayerSkin(playerid)-1);
return 1;
}
if(clickedid == skinfertig)
{
TogglePlayerControllable(playerid,1);
SetPlayerPos(playerid, 2034.9680, 1342.7229, 10.8203);
SetPlayerFacingAngle(playerid, 64.0991);
TextDrawHideForPlayer(playerid, skinbg);
TextDrawHideForPlayer(playerid, managebox);
TextDrawHideForPlayer(playerid, rand1);
TextDrawHideForPlayer(playerid, rand2);
TextDrawHideForPlayer(playerid, rand3);
TextDrawHideForPlayer(playerid, rand4);
TextDrawHideForPlayer(playerid, liniemitte);
TextDrawHideForPlayer(playerid, skinfertig);
TextDrawHideForPlayer(playerid, skinback);
TextDrawHideForPlayer(playerid, skinnext);
return 1;
}
return 1;
}
Dies funktioniert, nun habe ich ein weiteres Problem.
Ich habe ein Textdraw mit "Next" "Back" und "Fertig" allerdings passiert bei "Fertig" das selbe wie bei "Next" also es geht einfach 1 skin weiter.
public OnPlayerClickTextDraw(playerid, Text:clickedid){if(clickedid == skinnext){SetPlayerSkin(playerid, GetPlayerSkin(playerid)+1);return 1;}if(clickedid == skinback){SetPlayerSkin(playerid, GetPlayerSkin(playerid)-1);return 1;}if(clickedid == skinfertig){TogglePlayerControllable(playerid,1);SetPlayerPos(playerid, 2034.9680, 1342.7229, 10.8203);SetPlayerFacingAngle(playerid, 64.0991);TextDrawHideForPlayer(playerid, skinbg);TextDrawHideForPlayer(playerid, managebox);TextDrawHideForPlayer(playerid, rand1);TextDrawHideForPlayer(playerid, rand2);TextDrawHideForPlayer(playerid, rand3);TextDrawHideForPlayer(playerid, rand4);TextDrawHideForPlayer(playerid, liniemitte);TextDrawHideForPlayer(playerid, skinfertig);TextDrawHideForPlayer(playerid, skinback);TextDrawHideForPlayer(playerid, skinnext);return 1;}return 1;}
Hey ich möchte, wenn man das Textdraw klickt, dass GetPlayerSkin(playerid); 1 hochgezählt wird also mit SetPlayerSkin(playerid, +1);
so dachte ich es mir jedenfalls, aber so funktioniert es nicht, wie kann ich den skin hochzählen lassen?
geht nicht.
Bleibt auf 0
Per Datenbank setzen geht es
Ich Speicher alles in einer Datenbank.
Und habe oben km Script ein enum mit allen Spieler Daten. Nun möchte ich das dem Killer die Morde immer bei einem kill hochgesetzt werden.
Ich habe es mit sInfo [killerid][kills]=1;
Allerdings setzt es dann nur auf 1 und es soll ja bei jedem kill +1 gemacht werden.
Wie mache ich das
mach mal in dein Script unter OnGameModeInIt
SetWeather (2);
Tach,
Ich erhalte beim durchlaufen meines Pickups keine Deagle.
if(listitem == 2)
{
if(deaglepoint[playerid] == 0)
{
// Deagle Point erstellen
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
deaglepickup = AddStaticPickup(348, 1, x, y, z, 0);
deaglepoint[playerid]=1;
}
else if(deaglepoint[playerid] == 1)
{
// Entfernen
DestroyPickup(deaglepickup);
deaglepoint[playerid]=0;
}
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == armorpickup)
{
SetPlayerArmour(playerid, 100);
}
else if(pickupid == healpickup)
{
SetPlayerHealth(playerid, 100);
}
else if(pickupid == deaglepickup)
{
GivePlayerWeapon(playerid, 24, 900);
}
return 1;
}
doch C&P, und es geht nicht
alles unter dem else wird ausgeführt, also auch auf 0 setzen und so nur Destroy geht ned
So zum Beispiel:
CodeAlles anzeigenif(dialogid==DIALOG_DEAGLE_EVENT) { if(listitem == 0) { // Käfig 1 erstellen if(deaglekafigeins[playerid] == 0) { new Float:k_x,Float:k_y,Float:k_z; GetPlayerPos(playerid, k_x, k_y, k_z); //CreateObject deaglekafigeins[playerid]=CreateObject(18856, k_x, k_y, k_z, 0.00000, 0.00000, 0.00000); } else { DestroyObject(deaglekafigeins[playerid]);//RemoveBuilding deaglekafigeins[playerid]=0; } } return 1; }
Käfig wird nicht entfernt.
Tach,
Ich erstelle wenn die Abfrage 0 ist einen Käfig und setze es auf 1.
Nun möchte ich, wenn es auf 1 ist, den Käfig entfernen.
Wie mache ich das nun?
Denn ich kann unter OnDialogResponse nicht so etwas machen:
new keafig = CreateObject..
weil wenn ich dann beim entfernen DestroyObject(keafig); mache, bekomme ich: undefined symbol "keafig"
if(dialogid==DIALOG_DEAGLE_EVENT)
{
if(listitem == 0)
{
// Käfig 1 erstellen
if(deaglekafigeins[playerid] == 0)
{
new Float:k_x,Float:k_y,Float:k_z;
GetPlayerPos(playerid, k_x, k_y, k_z);
//CreateObject
CreateObject(18856, k_x, k_y, k_z, 0.00000, 0.00000, 0.00000);
deaglekafigeins[playerid]=1;
}
if(deaglekafigeins[playerid] == 1)
{
//RemoveBuilding
deaglekafigeins[playerid]=0;
}
}
return 1;
}
[13:33:15] [WARNING] CMySQLConnection::Disconnect - no connection available
[13:38:59] [WARNING] CMySQLConnection::Disconnect - no connection available
[14:02:32] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:22] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:21] [WARNING] CMySQLConnection::Disconnect - no connection available
[16:48:49] [WARNING] CMySQLConnection::Disconnect - no connection available
[17:23:27] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:21] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:28] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:28] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:27] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:31] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:22] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:21] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:22] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:28] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:28] [WARNING] CMySQLConnection::Disconnect - no connection available
[05:03:21] [WARNING] CMySQLConnection::Disconnect - no connection available
[19:54:38] [WARNING] CMySQLConnection::Disconnect - no connection available
[20:24:11] [WARNING] CMySQLConnection::Disconnect - no connection available
Dieser Log ist scon älter, also nix neues, das habe ich schon behoben
@Dominik:)
ocmd:setadmin(playerid,params[])
{
new pID,a_level;
if(!isAdmin(playerid,7))return SendClientMessage(playerid, FARBE_VERBOTEN,"Du bist nicht berechtigt, den Befehl zu benutzen.");
if(aDuty[playerid] == 0)return SendClientMessage(playerid, FARBE_GELB,"Du bist nicht im Dienst!");
if(sscanf(params,"ui",pID,a_level))return SendClientMessage(playerid, -1,"Nutzung: /setadmin [ID] [RANG]");
sInfo[pID][alevel]=a_level;
----------------------------> savePlayer(pID);
SendClientMessage(pID,FARBE_ROT,"Dein Adminrang wurde geändert.");
SendClientMessage(playerid,FARBE_ROT,"Du hast den Adminrang geändert.");
return 1;
}
In Setadmin führe ich auch savePlayer aus, das selbe auch bei OnPlayerDisconnect.
public OnPlayerDisconnect(playerid, reason)
{
// Spieler Speichern
savePlayer(playerid);
// Spieler Resetten
resetPlayer(playerid);
// Leave Nachricht
new pname[MAX_PLAYER_NAME], string[128 + MAX_PLAYER_NAME]; // 22
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "{0FFF00}%s {005499}hat den Server verlassen" , pname);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
savePlayer(playerid)
{
if(sInfo[playerid][eingeloggt]==0)return 1;
// Speichern level,money
new query[256];
format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',alevel='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel]);
mysql_function_query(dbhandle,query,false,"","");
return 1;
}
So weit ich aber gemerkt habe, stimmt an savePlayer was nicht, denn nichts wird gespeichert.
Es ist immer so, wie es in der datenbank eingetragen ist.
Hey, ich habe ein Problem.
Und zwar kann ich Admin Rang nur über Datenbank vergaben. Woran das liegt, weiß ich nicht.
Denn ich gebe per Script jemanden Admin z.b durch meine Gutschein Codes / Befehl (setadmin).
Aber wenn ich dann in der Datenbank F5 drücke, steht der Spieler immer noch auf 0.
Und hat im Spiel trotzdem den Rang.
Wenn ich reconnecte, bin ich wieder Spieler.
if(dialogid==DIALOG_GUTSCHEIN)
{
if(response)
{
// Einlösen
if(strlen(inputtext))
{
if(!strfind(inputtext,Gutscheine,true))
{
if(sInfo[playerid][eingeloggt]==0)return 1;
sInfo[playerid][alevel]=7;
SendClientMessage(playerid, FARBE_VERBOTEN, "Herzlichen Glückwunsch. Du hast einen * Admin Rang * Gutschein eingelöst. Du bist nun Stlv.Projektleiter!");
return 1;
}
}
else
{
SendClientMessage(playerid, FARBE_VERBOTEN, "Dieser Gutschein existiert nicht.");
}
}
else
{
// Abbruch
SendClientMessage(playerid, FARBE_VERBOTEN, "Du möchtest keinen Gutschein einlösen.");
}
}
public OnPasswordResponse(playerid)
{
new welcome_text[128];
new num_fields;
new num_rows;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name,sizeof(name));
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
// passwort richtig
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
SetPlayerScore(playerid,sInfo[playerid][level]);
sInfo[playerid][p_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
format(welcome_text, sizeof(welcome_text),"Herzlich Willkommen, %s",name);
SendClientMessageToAll(0x009F14FF, welcome_text);
}
else
{
// passwort falsch
SendClientMessage(playerid, FARBE_ROT,"Dein Passwort ist falsch.");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "iR","{FFFF00}Infinity Reallife{FFFFFF}!\n\nDein Account wurde in der Datenbank gefunden.\n\nBitte Logge dich ein:","Einloggen","Abbrechen");
}
return 1;
}
savePlayer(playerid)
{
if(sInfo[playerid][eingeloggt]==0)return 1;
// Speichern level,money
new query[256];
format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',alevel='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel]);
mysql_function_query(dbhandle,query,false,"","");
return 1;
}
enum playerInfo {
eingeloggt,
level,
p_id,
alevel
};
new sInfo[MAX_PLAYERS][playerInfo];
ocmd:setadmin(playerid,params[])
{
new pID,a_level;
if(!isAdmin(playerid,7))return SendClientMessage(playerid, FARBE_VERBOTEN,"Du bist nicht berechtigt, den Befehl zu benutzen.");
if(aDuty[playerid] == 0)return SendClientMessage(playerid, FARBE_GELB,"Du bist nicht im Dienst!");
if(sscanf(params,"ui",pID,a_level))return SendClientMessage(playerid, -1,"Nutzung: /setadmin [ID] [RANG]");
sInfo[pID][alevel]=a_level;
savePlayer(pID);
SendClientMessage(pID,FARBE_ROT,"Dein Adminrang wurde geändert.");
SendClientMessage(playerid,FARBE_ROT,"Du hast den Adminrang geändert.");
return 1;
}