Kleine und einfache sache:
Speicher Methode?
zeig mal den ganzen bereich bei dem spieler gespeichert werden.
Kleine und einfache sache:
Speicher Methode?
zeig mal den ganzen bereich bei dem spieler gespeichert werden.
Public OnPlayerDisconnect(playerid, reason)
{
PlayerUpdate(playerid)
}
Public GameModeInitExitFunc()
{
new string[128];
format(string, sizeof(string), "Beenden...");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
DisablePlayerCheckpoint(i);
gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
GameTextForPlayer(i, string, 4000, 5);
SetPlayerCameraPos(i,1460.0, -1324.0, 287.2);
SetPlayerCameraLookAt(i,1374.5, -1291.1, 239.0);
PlayerUpdate(i);
gPlayerLogged[i] = 0;
}
}
SetTimer("GameModeExitFunc", 4000, 0);
return 1;
}
public OnGameModeExit()
{
if(IsPlayerConnected(i))
{
OnPlayerCarUpdate(i);
PlayerUpdate(i);
gPlayerLogged[i] = 0;
DisablePlayerCheckpoint(i);
}
return 1;
}
if(strcmp(cmd,"/umbenennen",true) == 0)
{
if(PlayerInfo[playerid][pTot] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Tote können keine Befehle nutzen!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1339)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"Benutzung: /umbennen [playerid/name] [neuer name] Achtung! Maximale Länge: 16 Zeichen");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,COLOR_WHITE," Spieler ist nicht Online!");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(strlen(result) < 1 || strlen(result) > 16)
{
SendClientMessage(playerid,COLOR_WHITE,"Benutzung: /umbennen [playerid/name] [neuer name] Achtung! Maximale Länge: 16 Zeichen");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string,sizeof(string),"/Accounts/%s.ini",giveplayer);
fremove(string);
format(string,sizeof(string)," AdmCmd: %s hat %s in %s umbenannt!",sendername,giveplayer,result);
ABroadCast(0xFF6347AA,string,1);
format(string,sizeof(string)," Admin %s hat dich in %s umbenannt!",sendername,result);
SendClientMessage(playerid,0xFF6347AA,string);
SetPlayerName(giveplayerid,result);
PlayerUpdate(giveplayerid);
}
return 1;
}
if(strcmp(cmd, "/buyhouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
{
if(PlayerInfo[playerid][pOwnPerso] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Du benötigst einen PerosnalAusweis");
return 1;
}
if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
{
format(string, sizeof(string), " Du must mindestens Level %d erreicht haben um dieses Haus kaufen zu können.", HouseInfo[h][hLevel]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Du besitzt bereits ein Haus.");
return 1;
}
if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
{
PlayerInfo[playerid][pPhousekey] = h;
HouseInfo[h][hOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
new string2[350];
format(string2, sizeof(string2), "{15D4ED}Hausinfo:\n{FFFFFF}Hausbesitzer {DB881A}%s\n{FFFFFF}Miete: {DB881A}%d",HouseInfo[h][hOwner],HouseInfo[h][hRent]);
Update3DTextLabelText(HouseInfo[h][Text],COLOR_WHITE,string2);
HouseInfo[h][hRentabil] = 0;
GivePlayerMoney(playerid,-HouseInfo[h][hValue]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
GameTextForPlayer(playerid, "~w~Willkommen zu Hause~n~Du kannst das Haus an deiner Haustür mit der ~g~'EINGABE' ~w~Taste verlassen.", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Gratlation zu deinem neuen Kauf !");
SendClientMessage(playerid, COLOR_WHITE, "Gib /help um Hilfe zu bekommen !");
DateProp(playerid);
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Du hast nicht genug Geld !");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/rentroom", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 1 && HouseInfo[h][hRentabil] == 1)
{
if(PlayerInfo[playerid][pOwnPerso] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Du benötigst einen PerosnalAusweis");
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " Die gehört bereits ein Haus, gib /sellhouse ein um dein altes zu verkaufen.");
return 1;
}
if(GetPlayerMoney(playerid) > HouseInfo[h][hRent])
{
PlayerInfo[playerid][pPhousekey] = h;
GivePlayerMoney(playerid,-HouseInfo[h][hRent]);
HouseInfo[h][hTakings] = HouseInfo[h][hTakings]+HouseInfo[h][hRent];
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
GameTextForPlayer(playerid, "~w~Willkommen zu Hause~n~Du kannst das Haus an deiner Haustür mit der ~g~'EINGABE' ~w~Taste verlassen.", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Gratulation zu deiner neuen Miete !");
SendClientMessage(playerid, COLOR_WHITE, "Gib /help um Hilfe zu bekommen !");
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Du hast nicht genug Geld !");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/sellhouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pPhousekey] == 255)
{
SendClientMessage(playerid, COLOR_WHITE, "Dir gehört kein Haus.");
return 1;
}
if(PlayerInfo[playerid][pMarried] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist verheiratet, also kannst du das Haus nicht verkaufen !");
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
new house = PlayerInfo[playerid][pPhousekey];
HouseInfo[house][hHel] = 0;
HouseInfo[house][hArm] = 0;
HouseInfo[house][hHealthx] = 0;
HouseInfo[house][hHealthy] = 0;
HouseInfo[house][hHealthz] = 0;
HouseInfo[house][hArmourx] = 0;
HouseInfo[house][hArmoury] = 0;
HouseInfo[house][hArmourz] = 0;
HouseInfo[house][hLock] = 1;
HouseInfo[house][hOwned] = 0;
HouseInfo[house][hVec] = 418;
HouseInfo[house][hVcol1] = -1;
HouseInfo[house][hVcol2] = -1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,HouseInfo[house][hValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Gratulation~n~ Du hast das Haus fuer:~n~~g~$%d verkauft", HouseInfo[house][hValue]);
GameTextForPlayer(playerid, string, 5000, 3);
PlayerInfo[playerid][pPhousekey] = 255;
if(PlayerInfo[playerid][pLocal] == house)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HouseInfo[house][hEntrancex],HouseInfo[house][hEntrancey],HouseInfo[house][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
}
new string2[350];
format(string2, sizeof(string2), "{DB881A}Haus zu verkaufen\n{FFFFFF}Preis: {FF0000}$%d\n{FFFFFF}Hauslevel: {DB881A}%d\n{FFFFFF}Mit {DB881A}/buyhouse {FFFFFF}kannst du dieses Haus Kaufen",HouseInfo[house][hValue],HouseInfo[house][hLevel]);
Update3DTextLabelText(HouseInfo[house][Text], 0xF97804FF, string2);
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Dir gehört kein Haus.");
}
}
return 1;
}
if(strcmp(cmd, "/houseupgrade", true) == 0 || strcmp(cmd, "/hu", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new house = PlayerInfo[playerid][pPhousekey];
GetPlayerName(playerid, playername, sizeof(playername));
if (house != 999 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "BENUTZE: /houseupgrade [nummer]");
SendClientMessage(playerid, COLOR_GRAD1, "=========== Haus Upgrades ===========");
SendClientMessage(playerid, COLOR_GRAD2, "| 1: Lebensenergie Erweiterung $200.000");
SendClientMessage(playerid, COLOR_GRAD3, "| 2: Rüstungs Erweiterung $500.000");
return 1;
}
new item = strval(tmp);
switch (item)
{
case 1:
{
if(GetPlayerMoney(playerid) < 200000)
{
SendClientMessage(playerid, COLOR_GRAD5, "Du hast nicht genug Geld.");
return 1;
}
HouseInfo[house][hHel] = 1;
GivePlayerMoney(playerid,-200000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD5, "Du kannst dich jetzt zu Hause heilen, Gib dafür /heal ein.");
}
case 2:
{
if(GetPlayerMoney(playerid) < 500000)
{
SendClientMessage(playerid, COLOR_GRAD5, "Du hast nicht genug Geld.");
return 1;
}
HouseInfo[house][hArm] = 1;
GivePlayerMoney(playerid,-500000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD5, "Du kannst dir nun zu Hause eine Rüstung anziehen. Gib dazu /heal ein.");
}
}
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Besitze eines Hauses!");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/buybiz", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
if(PlayerInfo[playerid][pPbiskey] != 255)
{
SendClientMessage(playerid, COLOR_WHITE, " Du besitzt schon ein Business, tipp /sellbiz wenn du dieses willst.");
return 1;
}
for(new b = 0; b < sizeof(SBizzInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
{
format(string, sizeof(string), "Du benötigst Level %d um es erwerben zu können",SBizzInfo[b][sbLevelNeeded]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > SBizzInfo[b][sbBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b+100;
SBizzInfo[b][sbOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Gratulation für dein neues Gewerbe.");
SendClientMessage(playerid, COLOR_WHITE, "Gib /help ein, um Hilfe für dein neues Gewerbe zu bekommen.");
DateProp(playerid);
new string4[200];
format(string4, sizeof(string4), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", SBizzInfo[b][sbMessage],SBizzInfo[b][sbOwner],SBizzInfo[b][sbExtortion],SBizzInfo[b][sbEntranceCost],SBizzInfo[b][sbLevelNeeded],SBizzInfo[b][sbProducts],SBizzInfo[b][sbMaxProducts], SBizzInfo[b][sbPriceProd]);
Update3DTextLabelText(SBizzInfo[b][sbText],0x00BC00FF,string4);
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du hast nicht genug Geld, um das Gewerbe kaufen zu können.");
return 1;
}
}
}
for(new b = 0; b < sizeof(BizzInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
{
format(string, sizeof(string), "Du benötigst mindestens Level %d, um es kaufen zu können",BizzInfo[b][bLevelNeeded]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b;
BizzInfo[b][bOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
GameTextForPlayer(playerid, "~w~Willkommen~n~Um es zu Verlassen tipp /exit (An der Tuer) ein", 5000, 3);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
PlayerInfo[playerid][pLocal] = b ;
SendClientMessage(playerid, COLOR_WHITE, "Gratulation für dein neues Gewerbe.");
SendClientMessage(playerid, COLOR_WHITE, "Gib /help ein, um Hilfe für dein neues Gewerbe zu bekommen.");
DateProp(playerid);
//Label Update
new string3[128];
format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[b][bMessage],BizzInfo[b][bOwner],BizzInfo[b][bExtortion],BizzInfo[b][bEntranceCost],BizzInfo[b][bLevelNeeded],BizzInfo[b][bProducts],BizzInfo[b][bMaxProducts],BizzInfo[b][bPriceProd]);
Update3DTextLabelText(BizzInfo[b][bText],0x00BC00FF,string3);
//Speichern
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du hast nicht genug Geld, um das Gewerbe kaufen zu können.");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/sellbiz", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pPbiskey] == 255)
{
SendClientMessage(playerid, COLOR_WHITE, "Du besitzt kein Gewerbe.");
return 1;
}
if(PlayerInfo[playerid][pMarried] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist Verheiratet, also kannst du dein Haus nicht verkaufen !");
return 1;
}
if(PlayerInfo[playerid][pPbiskey] >= 100 && strcmp(playername, SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner], true) == 0)
{
new bouse = PlayerInfo[playerid][pPbiskey]-100;
GivePlayerMoney(playerid,SBizzInfo[bouse][sbTill]);
SBizzInfo[bouse][sbLocked] = 1;
SBizzInfo[bouse][sbOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizzInfo[bouse][sbOwner], "The State", 0, strlen("The State"), 255);
strmid(SBizzInfo[bouse][sbExtortion], "No-one", 0, strlen("No-one"), 255);
ConsumingMoney[playerid] = 1;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Gluekwunsch~n~ Du hast dein Geschaeft verkauft. Premie ~n~~g~$%d", SBizzInfo[bouse][sbTill]);
GameTextForPlayer(playerid, string, 10000, 3);
SBizzInfo[bouse][sbTill] = 0;
PlayerInfo[playerid][pPbiskey] = 255;
//Labe Update
new string4[160];
format(string4, sizeof(string4), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", SBizzInfo[bouse][sbMessage],SBizzInfo[bouse][sbBuyPrice],SBizzInfo[bouse][sbLevelNeeded]);
Update3DTextLabelText(SBizzInfo[bouse][sbText],0x00BC00FF,string4);
//Speichern
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
if(strcmp(playername, BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)
{
new bouse = PlayerInfo[playerid][pPbiskey];
BizzInfo[bouse][bLocked] = 1;
BizzInfo[bouse][bOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[bouse][bOwner], "The State", 0, strlen("The State"), 255);
strmid(BizzInfo[bouse][bExtortion], "No-one", 0, strlen("No-one"), 255);
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,BizzInfo[bouse][bTill]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Gluekwunsch~n~ Du hast dein Geschaeft verkauft. Premie ~n~~g~$%d", BizzInfo[bouse][bTill]);
GameTextForPlayer(playerid, string, 10000, 3);
BizzInfo[bouse][bTill] = 0;
PlayerInfo[playerid][pPbiskey] = 255;
//Labe Update
new string3[160];
format(string3, sizeof(string3), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", BizzInfo[bouse][bMessage],BizzInfo[bouse][bBuyPrice],BizzInfo[bouse][bLevelNeeded]);
Update3DTextLabelText(BizzInfo[bouse][bText],0x00BC00FF,string3);
//Speichern
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Dir gehört kein Geschäfft.");
}
}
return 1;
}
Soo Ich kann nichtsmehr schreiben da die Zeichen schon weg sind überbliebene noch 39
Du sollt zeigen wo der Spieler gespeichert wird (SavePlayer oder so ) und nicht das ganze /rentroom und so