Hi all,
da vielleicht ein paar Leute ATM Bankautomaten brauchen stelle ich ma was rein.
Es sind 15 Bankautomaten in der Stadt verteilt (LS).
Hab auch paar Fotos dran gemacht damit man sieht wo welche sind.
=========================================================
Erstma die Gemapten Objecte unter
public OnGameModeInit()
{
Einfügen:
//ATM Bankautomaten Objecte
CreateObject(2942, 810.565063, -1623.768799, 13.189775, 0.0000, 0.0000, 90.0001);
CreateObject(2942, 1000.825195, -922.610168, 41.971024, 0.0000, 0.0000, 277.8123);
CreateObject(2942, 1504.693359, -1706.567749, 13.689775, 0.0000, 0.0000, 90.0000);
CreateObject(2942, 1928.620850, -1771.269043, 13.189775, 0.0000, 0.0000, 90.0000);
CreateObject(2942, 1036.071655, -1024.509766, 31.744461, 0.0000, 0.0000, 0.0000);
CreateObject(2942, 926.909912, -1355.081421, 13.021199, 0.0000, 0.0000, 270.0000);
CreateObject(2942, 491.439484, -1734.586548, 10.871187, 0.0000, 0.0000, 168.3452);
CreateObject(2942, 380.780701, -2021.725830, 7.478837, 0.0000, 0.0000, 0.0000);
CreateObject(2942, 1223.778320, -1744.292603, 13.240016, 0.0000, 0.0000, 193.3734);
CreateObject(2942, 2105.436035, -1809.228516, 13.197587, 0.0000, 0.0000, 270.0000);
CreateObject(2942, 2072.053955, -1836.951416, 13.197434, 0.0000, 0.0000, 90.0001);
CreateObject(2942, 1956.735596, -2186.291016, 13.189775, 0.0000, 0.0000, 90.0000);
CreateObject(2942, 2394.498047, -1914.865356, 13.189775, 0.0000, 0.0000, 0.0000);
CreateObject(2942, 2779.040283, -1821.910034, 10.157268, 0.0000, 0.0000, 33.7500);
CreateObject(2942, 1196.011841, -918.630188, 42.792793, 0.0000, 0.0000, 5.1566);
=========================================================
Unter den forwards
forward AtATM(playerid);
einfügen.
Danach unter public OnPlayerCommandText(playerid, cmdtext[])
{
dieses hier einfügen:
//-------------------------------[ ATM ]---------------------------------------------------
if(strcmp(cmd, "/atmwithdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!AtATM(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht an einem ATM !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /atmwithdraw [betrag]");
format(string, sizeof(string), " Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /atmwithdraw [betrag]");
format(string, sizeof(string), " Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " Du hast nicht soviel Geld !");
return 1;
}
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), "Du hast %d$ von deinem Konto abgehoben. Kontostand: %d$ ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}
//------------------------------------------------------------------------------
if(strcmp(cmd, "/atmbank", true) == 0 || strcmp(cmd, "/atmdeposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!AtATM(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht an einem ATM !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /atmbank [betrag]");
format(string, sizeof(string), " Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /atmbank [amount]");
format(string, sizeof(string), " Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " Du hast nicht soviel Geld !");
return 1;
}
GivePlayerMoney(playerid,-cashdeposit);
new curfunds = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK AUSZUG ___|");
format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Eingezahlt: $%d",cashdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
//------------------------------------------------------------------------------
if(strcmp(cmd, "/atmbalance", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!AtATM(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht an einem ATM !");
return 1;
}
format(string, sizeof(string), " Du hast $%d auf deinem Konto.",PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
//------------------------------------------------------------------------------
if(strcmp(cmd, "/atmtransfer", true) == 0 || strcmp(cmd, "/atmwiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du musst mindestens Level 3 sein !");
return 1;
}
if(!AtATM(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht an einem ATM !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /atmtransfer [spielerid/name] [betrag]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /atmtransfer [spielerid/name] [betrag]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), "Du hast %d$ auf %s's Konto überwiesen.", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), "Du hast %d$ auf dein Konto von %s überwiesen bekommen.", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s hat %d$ an %s überwiesen.", sendername, moneys, giveplayer);
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Ungültiger Betrag.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht beim ATM");
}
}
else
{
format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Teil 2 kommt gleich leider über 10k zeichen