i want to save my money, but it just save, but it wont load the money, so i spawn with 0$. Can you help me fix that? I posted the full script, because i downt know what you need.
Код:
// Includes=====================================================================
#include <a_samp>
#include <dini>
#include <ladmin>
// Farben=======================================================================
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_CYAN 0x00BFF3AA
#define COLOR_BLACK 0x000000AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_LIMEGREEN 0x32CD32AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_YELLOWGREEN 0x9ACD32AA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRELLRED 0xFF000000
#define COLOR_LIGHTGREEN 0x86FF59FF
#define COLOR_LIGHTBLUE 0x33CCFFAA
// Pragmas======================================================================
#pragma tabsize 0
#pragma unused strtok
// Teams========================================================================
#define TEAM_POLIZEI 1
#define TEAM_BUNDESWEHR 2
#define TEAM_KRANKENHAUS 3
#define TEAM_FBI 4
#define TEAM_NANG 5
#define TEAM_BIKER 6
#define TEAM_STADTWERKE 7
#define TEAM_69 8
#define TEAM_AUFTRAGSMЦRDER 9
#define TEAM_TRIADEN 10
#define TEAM_NTV 11
// Enums========================================================================
enum spieler_daten
{
wanted,
skin,
leader,
team,
pmoney,
score,
eingeloggt,
}
// NEWґS========================================================================
new Spieler[MAX_PLAYERS][spieler_daten];
new polizeiauto[26];
new bundeswauto[27];
new kranken[8];
new fbiauto[5];
new ntvan[4];
new snauto[9];
new triadenauto[4];
new bikerauto[5];
// Defines======================================================================
#define DIALOG_LOGIN 3
#define DIALOG_REG 4
// Mainscript===================================================================
main()
{
print("\n----------------------------------");
print(" LIFE by KampfMopZ");
print("----------------------------------\n");
}
// OnGameModeInt================================================================
public OnGameModeInit()
{
SetGameModeText("German Reallife");
AddPlayerClass(20,-1493.0544,920.2812,7.1875,86.9809,0,0,0,0,0,0);
polizeiauto[0] =AddStaticVehicle(522,-1596.2786,749.3598,-5.6716,359.7319,154,1); // ranger 1
polizeiauto[1] =AddStaticVehicle(522,-1604.2617,748.8483,-5.6703,179.4682,154,1); // streifen 1
polizeiauto[2] =AddStaticVehicle(522,-1608.4302,748.6107,-5.6782,0.6358,154,1); // ranger 2
polizeiauto[3] =AddStaticVehicle(597,-1604.2117,692.8202,-5.4755,359.9847,154,1); // pdc1
polizeiauto[4] =AddStaticVehicle(597,-1608.3284,692.9455,-5.4751,0.4614,154,1); // pdc2
polizeiauto[5] =AddStaticVehicle(597,-1612.4637,692.5858,-5.4746,358.9798,154,1); // pdc3
polizeiauto[6] =AddStaticVehicle(597,-1620.7800,692.8258,-5.4743,359.2848,154,1); // pdc4
polizeiauto[7] =AddStaticVehicle(597,-1624.8047,693.2934,-5.4738,0.1482,154,1); // pdc5
polizeiauto[8] =AddStaticVehicle(523,-1573.4670,705.7117,-5.6805,266.1436,154,1); // pdbk1
polizeiauto[9] =AddStaticVehicle(523,-1574.0304,714.0052,-5.6844,277.8519,154,1); // pdbk3
polizeiauto[10] =AddStaticVehicle(427,-1623.0857,653.6704,-5.4741,270.8814,154,1); // pdswt1
polizeiauto[11] =AddStaticVehicle(601,-1638.7889,653.8557,-5.4748,272.0478,154,1); // pdwp1
polizeiauto[12] =AddStaticVehicle(497,-1680.1832,705.0397,30.1683,91.5802,154,1); // pdhl1
polizeiauto[13] =AddStaticVehicle(599,-1579.8362,748.8583,-5.4761,358.6972,154,1); // pdrngr1
polizeiauto[14] =AddStaticVehicle(599,-1587.9021,749.0549,-5.4748,358.7990,154,1); // pdrngr2
polizeiauto[15] =AddStaticVehicle(599,-1596.4919,748.8757,-5.4737,0.1798,154,1); // pdrngr3
polizeiauto[16] =AddStaticVehicle(597,-1594.0330,673.6435,6.9565,2.5799,154,1); // streifen 1
polizeiauto[17] =AddStaticVehicle(597,-1605.9910,673.6896,6.9564,359.2071,154,1); // streifen 2
polizeiauto[18] =AddStaticVehicle(597,-1600.0785,673.4769,6.9562,359.4185,154,1); // streifen 3
polizeiauto[19] =AddStaticVehicle(599,-1600.2214,651.5200,6.9563,0.4512,154,1); // ranger 1
polizeiauto[20] =AddStaticVehicle(599,-1587.7552,651.3986,6.9557,181.1784,154,1); // ranger 2
polizeiauto[21] =AddStaticVehicle(550,-1616.7458,651.3911,6.9554,177.8969,99,1); // zivil 1
polizeiauto[22] =AddStaticVehicle(535,-1622.7404,651.4971,6.9551,180.1350,65,1); // zivil 2
polizeiauto[23] =AddStaticVehicle(526,-1634.5356,651.8376,6.9567,359.3442,16,1); // zivil 3
polizeiauto[24] =AddStaticVehicle(521,-1582.3220,673.6200,6.9570,358.9788,154,1); // motor 1
polizeiauto[25] =AddStaticVehicle(521,-1575.8789,652.0829,6.9559,359.6180,154,1); // motor 2
bundeswauto[0] =AddStaticVehicle(597,-1530.4851,372.4554,6.9561,271.6654,110,8); // bw car 2
bundeswauto[1] =AddStaticVehicle(597,-1531.3970,378.4416,6.9557,267.3384,110,8); // bw car 3
bundeswauto[2] =AddStaticVehicle(597,-1530.9556,387.1899,6.9546,268.9381,110,8); // bw car 4
bundeswauto[3] =AddStaticVehicle(597,-1530.2909,393.4598,6.9569,272.2772,110,8); // bw car 5
bundeswauto[4] =AddStaticVehicle(522,-1530.1858,401.3380,6.9544,266.6091,110,8); // bw bike 1
bundeswauto[5] =AddStaticVehicle(522,-1530.2229,407.7654,6.9535,268.9252,110,8); // bw bike 2
bundeswauto[6] =AddStaticVehicle(522,-1530.3761,416.6539,6.7583,272.1898,110,8); // bw bike 3
bundeswauto[7] =AddStaticVehicle(433,-1563.0604,364.3815,6.9571,180.3716,110,8); // bw truck 1
bundeswauto[8] =AddStaticVehicle(433,-1571.1772,364.7406,6.9556,179.5903,110,8); // bw truck 2
bundeswauto[9] =AddStaticVehicle(470,-1583.0801,366.3289,6.9550,179.7549,110,8); // bw hw 1
bundeswauto[10] =AddStaticVehicle(470,-1592.4819,365.0593,6.9542,181.7747,110,8); // bw hw 2
bundeswauto[11] =AddStaticVehicle(470,-1601.2261,364.3669,6.9476,177.3221,110,8); // bw hw 3
bundeswauto[12] =AddStaticVehicle(520,-1619.2655,286.9609,6.9540,182.1717,110,8); // bw hydra 1
bundeswauto[13] =AddStaticVehicle(520,-1597.4733,281.6930,6.9563,1.7027,110,8); // bw hydra 2
bundeswauto[14] =AddStaticVehicle(432,-1615.5392,347.3820,6.9567,269.5211,110,8); // bw panzer 1
bundeswauto[15] =AddStaticVehicle(432,-1616.5613,330.8249,6.9580,271.3612,110,8); // bw panzer 2
bundeswauto[16] =AddStaticVehicle(425,-1663.1207,290.1114,6.9563,183.7120,110,8); // bw heli 1
bundeswauto[17] =AddStaticVehicle(425,-1690.1876,285.5459,6.9540,183.4570,110,8); // bw heli 2w
bundeswauto[18] =AddStaticVehicle(539,-1249.1276,465.8759,6.9573,271.5680,110,8); // bw hover 1
bundeswauto[19] =AddStaticVehicle(597,-1565.4286,439.1853,6.9491,53.3694,110,8); // army 1
bundeswauto[20] =AddStaticVehicle(597,-1570.0369,432.0522,6.9539,57.0006,110,8); // army 2
bundeswauto[21] =AddStaticVehicle(597,-1575.3545,424.5912,6.9559,55.1170,110,8); // army 3
bundeswauto[22] =AddStaticVehicle(521,-1585.8439,413.1175,6.9570,52.0321,110,8); // army motor 1
bundeswauto[23] =AddStaticVehicle(521,-1590.3707,408.2208,6.9555,50.6702,110,8); // army motor 2
bundeswauto[24] =AddStaticVehicle(477,-1556.3384,451.4235,6.9511,236.6252,142,8); // army zivil 1
bundeswauto[25] =AddStaticVehicle(451,-1554.1278,457.0432,6.9565,239.5248,4,8); // army zivil 2
bundeswauto[26] =AddStaticVehicle(451,-1550.3282,465.2613,6.9544,61.3510,121,8); // army zivil 3
kranken[0] =AddStaticVehicle(416,-2625.8535,629.5129,14.2244,91.2881,3,1); // kh kw 1
kranken[1] =AddStaticVehicle(416,-2661.3601,629.5240,14.2237,92.2785,3,1); // kh kw 2
kranken[2] =AddStaticVehicle(416,-2701.3545,611.3842,14.2224,168.0612,3,1); // kh kw
kranken[3] =AddStaticVehicle(597,-2543.5801,586.7440,14.2221,271.3540,3,1); // kh sw
kranken[4] =AddStaticVehicle(597,-2544.2686,604.7777,14.2222,270.7252,3,1); // kh sw
kranken[5] =AddStaticVehicle(597,-2571.9055,621.9138,14.2213,90.1400,3,1); // kh sw
kranken[6] =AddStaticVehicle(563,-2553.3538,639.9899,27.5802,180.0637,3,1); // kh heli
kranken[7] =AddStaticVehicle(563,-2582.2620,639.7314,27.5802,178.8248,3,1); // kh heli
fbiauto[0] =AddStaticVehicle(490,-2429.4709,515.0781,29.7020,37.5083,0,3); // fbi car 1
fbiauto[1] =AddStaticVehicle(490,-2425.2915,517.9053,29.7017,40.5941,0,3); // fbi car 2
fbiauto[2] =AddStaticVehicle(490,-2421.7239,521.5110,29.7021,44.8528,0,3); // fbi car 1
fbiauto[3] =AddStaticVehicle(528,-2418.6228,524.4431,29.7006,47.7059,0,3); // fbi truxck
fbiauto[4] =AddStaticVehicle(528,-2416.1704,528.3270,29.7022,58.5548,0,3); // fbi truck 1
ntvan[0] =AddStaticVehicle(582,-1809.0505,571.6877,34.9393,270.7578,106,1); // ntv van 1
ntvan[1] =AddStaticVehicle(582,-1794.3364,555.2484,34.9358,154.1037,106,1); // ntv van 2
ntvan[2] =AddStaticVehicle(582,-1816.4503,550.5350,34.9349,32.8511,106,1); // ntv van 3
ntvan[3] =AddStaticVehicle(488,-1778.4390,543.9415,34.8230,152.8627,106,1); // ntv heli
snauto[0] =AddStaticVehicle(522,-1655.7623,1315.1958,6.6174,315.4368,151,60); // sn bike 1
snauto[1] =AddStaticVehicle(522,-1652.2255,1311.6273,6.5845,311.9090,151,60); // sn bike 2
snauto[2] =AddStaticVehicle(560,-1648.4607,1308.0439,6.5918,313.2512,151,60); // sn car 1
snauto[3] =AddStaticVehicle(560,-1645.2117,1303.7944,6.5952,315.7703,151,60); // sn car 2
snauto[4] =AddStaticVehicle(560,-1641.0743,1301.7019,6.5859,313.3082,151,60); // sn car 3
snauto[5] =AddStaticVehicle(560,-1638.8967,1296.1954,6.7413,312.2041,151,60); // sn car 5
snauto[6] =AddStaticVehicle(560,-1634.9786,1292.4528,6.7442,315.3170,151,60); // sn car 6
snauto[7] =AddStaticVehicle(560,-1631.0146,1288.9343,6.7444,315.0464,151,60); // car sn 7
snauto[8] =AddStaticVehicle(469,-1637.6735,1416.7836,7.1764,240.9366,16,6); // sn heli 1
triadenauto[0] =AddStaticVehicle(401,-2229.4922,725.9118,48.9881,90.7801,0,0); // wm 1
triadenauto[1] =AddStaticVehicle(401,-2212.2722,726.1458,48.9848,90.7799,0,0); // wouzie m 2
triadenauto[2] =AddStaticVehicle(489,-2213.9089,736.6719,48.9844,270.8269,0,0); // wm 3
triadenauto[3] =AddStaticVehicle(581,-2228.3530,736.6694,48.9853,269.1137,0,0); // wm 4
bikerauto[0] =AddStaticVehicle(522,-2245.6172,-101.2370,34.8881,65.0090,52,5); // biker1
bikerauto[1] =AddStaticVehicle(522,-2245.9229,-97.6361,34.8805,46.5410,52,5); // biker1
bikerauto[2] =AddStaticVehicle(522,-2245.8684,-94.3677,34.8879,36.4972,52,5); // biker1
bikerauto[3] =AddStaticVehicle(522,-2245.3984,-92.0387,34.8939,40.7848,52,5); // biker1
bikerauto[4] =AddStaticVehicle(522,-2245.6257,-86.7823,34.8915,38.4951,52,5); // biker1
DisableInteriorEnterExits();
UsePlayerPedAnims();
EnableStuntBonusForAll(0);
return 1;
}
// OnPlayerRequestClass=========================================================
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
// OnPlayerConnect==============================================================
public OnPlayerConnect(playerid)
{
SetPlayerColor(playerid, 0xFFFFFF00);
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(fexist(accFormat))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich mit deinem Passwort ein",">>>>>","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich bei uns","Fertig","Abbrechen");
}
return 1;
}
// OnPlayerDisconnect===========================================================
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
dini_IntSet(accFormat, "skin", GetPlayerSkin(playerid));
if(fexist(accFormat) && Spieler[playerid][eingeloggt])
{
dini_IntSet(accFormat,"team",Spieler[playerid][team]);
dini_IntSet(accFormat,"leader",Spieler[playerid][leader]);
dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
dini_IntSet(accFormat,"pmoney",GetPlayerMoney(playerid));
}
Spieler[playerid][team] = 0;
Spieler[playerid][eingeloggt] = 0;
Spieler[playerid][leader] = 0;
Spieler[playerid][wanted] = 0;
Spieler[playerid][skin] = GetPlayerSkin(playerid);
return 1;
}
// OnPlayerDeath================================================================
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid,1176.5500,-1323.9135,14.0268); // Setz die Positon( Vom Spieler auf, x, y, z);
SendClientMessage(playerid,COLOR_RED,"Dein Arztbesuch kostet dich $200"); // Sende eine Nachricht( An Spieler, mit der Farbe Rot, "und dem Text");
SetPlayerHealth(playerid, 100.0);
return 1;
}
public OnPlayerSpawn(playerid)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
SetPlayerSkin(playerid, dini_Int(accFormat,"skin"));
{
}
if(Spieler[playerid][team] == 1) //team polizei
{
SetPlayerPos(playerid, -1606.1589,674.1307,-5.2422 );
SetPlayerFacingAngle(playerid,356.4575);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 280);
GivePlayerWeapon(playerid, 24, 86); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 3, 0); GivePlayerWeapon(playerid, 27, 84);
}
if(Spieler[playerid][team] == 2) //team Bundeswehr
{
SetPlayerPos(playerid, -1522.3591,481.0969,7.1875 );
SetPlayerFacingAngle(playerid,6.2783);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 287);
GivePlayerWeapon(playerid, 24, 50); GivePlayerWeapon(playerid, 31, 170); GivePlayerWeapon(playerid, 27, 84);
}
if(Spieler[playerid][team] == 3) //team Krankenhaus
{
SetPlayerPos(playerid, -2706.5664,638.3166,14.4545 );
SetPlayerFacingAngle(playerid,228.5291);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 276);
GivePlayerWeapon(playerid, 24, 14);
}
if(Spieler[playerid][team] == 4) //team FBI
{
SetPlayerPos(playerid, -2446.5183,517.1216,30.2308 );
SetPlayerFacingAngle(playerid,281.0992);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 286);
GivePlayerWeapon(playerid, 24, 86); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 17, 2);
}
if(Spieler[playerid][team] == 5) //team Nang
{
SetPlayerPos(playerid, -2648.2249,1399.6024,912.4063 );
SetPlayerFacingAngle(playerid,10.9668);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 122);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 18, 2);
}
if(Spieler[playerid][team] == 6) //team BIKER
{
SetPlayerPos(playerid, 488.2935,-81.4488,998.7578 );
SetPlayerFacingAngle(playerid,358.9058);
SetPlayerInterior(playerid, 6);
SetPlayerSkin(playerid, 247);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 25, 28); GivePlayerWeapon(playerid, 7, 0);
}
if(Spieler[playerid][team] == 7) //team Stadtwwerke
{
SetPlayerPos(playerid, -1716.7948,1018.0562,17.5859 );
SetPlayerFacingAngle(playerid,82.8659);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 50);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 6, 0);
}
if(Spieler[playerid][team] == 8) //team 69ґ
{
SetPlayerPos(playerid, -1629.3293,1388.8190,7.1875 );
SetPlayerFacingAngle(playerid,327.5006);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 144);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 5, 0); GivePlayerWeapon(playerid, 27, 28);
}
if(Spieler[playerid][team] == 9) //team Auftragskiller
{
SetPlayerPos(playerid, 2183.2971,-1203.6145,1049.0234 );
SetPlayerFacingAngle(playerid,264.5049);
SetPlayerInterior(playerid, 3);
SetPlayerSkin(playerid, 125);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 30, 90); GivePlayerWeapon(playerid, 34, 14);
}
if(Spieler[playerid][team] == 10) //team Triaden
{
SetPlayerPos(playerid, 2319.5195,-1209.2161,1049.0234 );
SetPlayerFacingAngle(playerid,100.2676);
SetPlayerInterior(playerid, 3);
SetPlayerSkin(playerid, 117);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 8, 0); GivePlayerWeapon(playerid, 30, 120);
}
if(Spieler[playerid][team] == 11) //team ntv
{
SetPlayerPos(playerid, -1806.5148,530.7881,35.1641 );
SetPlayerFacingAngle(playerid,358.4587);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 188);
GivePlayerWeapon(playerid, 43, 45); GivePlayerWeapon(playerid, 24, 28);
}
return 1;
}
// onPlayerCommandText==========================================================
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(strget(cmdtext,0),"/makeleader"))
{
if(IsPlayerLuxAdminLevel(playerid,4))
{
if(!strlen(strget(cmdtext,1)))
return
SendClientMessage(playerid,COLOR_GREY,"Benutze: /makeleader [ID] [FraktionsID]");
new string[128];
new id3 = strval(strget(cmdtext,1));
new admin3[MAX_PLAYER_NAME];
new gang = strval(strget(cmdtext,2));
GetPlayerName(id3,admin3,sizeof(admin3));
format(string, sizeof(string), "*** Du wurdest von Admin %s zum Leader der Fraktionsnummer %d gemacht.", admin3, gang);
SendClientMessage(id3, COLOR_LIGHTRED, string);
format(string, sizeof(string), "*** Du hast %s zum Leader der Fraktionsnummer %d gemacht.", id3, gang);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(gang==1) { SetPlayerSkin(id3,280);Spieler[playerid][leader]= 1; }
Spieler[id3][leader] = gang;
Spieler[id3][team] = gang;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED,"Du darfst diesen Befehl nicht benutzen !");
}
return 1;
}
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof polizeiauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == polizeiauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_POLIZEI || Spieler[playerid][team] != TEAM_POLIZEI )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof bundeswauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == bundeswauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_BUNDESWEHR || Spieler[playerid][team] != TEAM_BUNDESWEHR )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof kranken; i++ )
{
if( GetPlayerVehicleID( playerid ) == kranken[ i ] )
{
if( Spieler[playerid][team] != TEAM_KRANKENHAUS || Spieler[playerid][team] != TEAM_KRANKENHAUS )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof fbiauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == fbiauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_FBI || Spieler[playerid][team] != TEAM_FBI )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof ntvan; i++ )
{
if( GetPlayerVehicleID( playerid ) == ntvan[ i ] )
{
if( Spieler[playerid][team] != TEAM_NTV || Spieler[playerid][team] != TEAM_NTV )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof snauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == snauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_69 || Spieler[playerid][team] != TEAM_69 )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof triadenauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == triadenauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_TRIADEN || Spieler[playerid][team] != TEAM_TRIADEN )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof bikerauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == bikerauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_BIKER || Spieler[playerid][team] != TEAM_BIKER )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlьssel fьr dieses Fahrzeug.");
}
}
}
}
return 1;
}
// OnDialogResponse=============================================================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(response)
{
switch(dialogid) // dialogid auswдhlen
{
case DIALOG_LOGIN: // ID Login
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
}
if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
{
Spieler[playerid][pmoney] = dini_Int(accFormat,"pmoney");
Spieler[playerid][team] = dini_Int(accFormat,"team");
Spieler[playerid][leader] = dini_Int(accFormat,"leader");
Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
Spieler[playerid][skin] =SetPlayerSkin(playerid, dini_Int(accFormat,"skin"));
Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt und kannst nun spawnen.");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich mit deinem Passwortein",">>>>>","Abbrechen");
SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war falsch!");
}
}
case DIALOG_REG: // ID Registrieren
{
if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich auf unserem Server","Fertig","Abbrechen");
return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
}
dini_Create(accFormat);
dini_Set(accFormat,"Passwort",inputtext);
Spieler[playerid][eingeloggt] = 1;
SendClientMessage(playerid,0xFFFFFFFF,"Account wurde gespeichert, du kannst jetzt spawnen.");
}
}
}
else
{
switch(dialogid)
{
case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein",">>>>>","Abbrechen");
case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Fertig","Abbrechen");
}
}
return 1;
}
// OnPlayerClickPlayer==========================================================
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
// Socks&so=====================================================================
stock strget(strx[], pos, search = ' ') {
new arg, ret[128], idxx;
for (new i = 0; i < strlen(strx); i++) {
if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
arg++;
if (arg == pos + 1){
ret[i-idxx] = EOS;
return ret;
} else if (arg == pos)
idxx= i+1;
}
else if (arg == pos)
ret[i - idxx] = strx[i];
}
return ret;
}