Jump to content
  • 0

Bug la banca!Ajutor va rog


bitza

Question

3 answers to this question

Recommended Posts

Pune comenziile astea:

Comanda: /Balance

if(strcmp(cmd, "/balance", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(!PlayerToPoint(20.0,playerid,2311.1,-7.4,26.7))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "{ffffff}Nu esti la banca!");
	            return 1;
	        }
			format(string, sizeof(string), "  Ai $%d in contul tau.",PlayerInfo[playerid][pAccount]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		return 1;
	}
Comanda:/withdraw
if(strcmp(cmd, "/withdraw", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(!PlayerToPoint(20.0,playerid,2311.1,-7.4,26.7))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "{ffffff}Nu esti in banca!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /withdraw [amount]");
				format(string, sizeof(string), "  Ai $%d in contul tau.", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			new cashdeposit = strval(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /withdraw [amount]");
				format(string, sizeof(string), "  Ai $%d in contul tau.", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   Ai prea putini bani!");
				return 1;
			}
		    ConsumingMoney[playerid] = 1;
			GivePlayerMoney(playerid,cashdeposit);
			PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
			format(string, sizeof(string), "  Ai luat $%d don contul tau de: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			return 1;
		}
		return 1;
	}
Comanda:/deposti (bank)
if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(!PlayerToPoint(20.0,playerid,2311.1,-7.4,26.7))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "{ffffff}   Nu esti la banca!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /bank [amount]");
				format(string, sizeof(string), "  Ai $%d in cont.", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			new cashdeposit = strval(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /bank [amount]");
				format(string, sizeof(string), "  Ai $%d in cont.", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Nu ai bani destui!");
				return 1;
			}
			GivePlayerMoney(playerid,-cashdeposit);
			new curfunds = PlayerInfo[playerid][pAccount];
			PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
			SendClientMessage(playerid, COLOR_WHITE, "|___ Bank Status ___|");
			format(string, sizeof(string), "  Vechea balanta: $%d", curfunds);
			SendClientMessage(playerid, COLOR_GRAD2, string);
			format(string, sizeof(string), "  Depozit: $%d",cashdeposit);
			SendClientMessage(playerid, COLOR_GRAD4, string);
			SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
			format(string, sizeof(string), "  Noua balanta: $%d", PlayerInfo[playerid][pAccount]);
			SendClientMessage(playerid, COLOR_WHITE, string);
			return 1;
		}
		return 1;
	}
Comanda:/Transfer
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pLevel] < 3)
	        {
	            SendClientMessage(playerid, COLOR_LIGHTRED2, "* Poti face tranferuri doar de la level 3!");
	            return 1;
	        }
			if(!PlayerToPoint(20.0,playerid,2311.1,-7.4,26.7))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "{ffffff}   Nu eti la banca!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[INFO]:{ffffff} /transfer [Player id] [amount]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, " {FFA500}[INFO]:{ffffff} /transfer [Player id] [amount]");
				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)
					{
					    if(moneys > PlayerInfo[playerid][pAccount])
					    {
							SendClientMessage(playerid,COLOR_GREY,"Ai putini bani in cont!");
					        return 1;
					    }
						PlayerInfo[playerid][pAccount] -= moneys;
						PlayerInfo[giveplayerid][pAccount] += moneys;
						format(string, sizeof(string), "   Ai depus $%d in banca pe contul %s.", moneys, giveplayer,giveplayerid);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
						SendClientMessage(playerid, COLOR_GRAD1, string);
						format(string, sizeof(string), "   Ai primit $%d in contul tau de la %s %s", moneys, sendername, playerid);
						SendClientMessage(giveplayerid, COLOR_GRAD1, string);
						format(string, sizeof(string), "%s a trimist $%d la %s", 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, "  Numar invalid!");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d Nu este un player activ.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}

LISTA - GAMEMODE-URI SA-MP - Le gasiti pe toate aici: http://twiriock.com/3MGP

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.