Jump to content

Question

Posted

Salut , am o problema cu un gamemode rpg , am un bug la banca din ls , intru in ea si cand scriu /balance sau /withdraw zice ca nu sunt in banca...

10 answers to this question

Recommended Posts

Posted

aham ... si liniile ? dane liniile...de la banca din ls

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Posted

Mai exact dane comenzile /balance, /withdraw si /deposit.Si cand intrii in banca dai /save banca ls,dupa intri in Gta San Andreas User Filles/SAMP/Savepoints sau ceva de genul deschizi notepadul si ne dai coordonatele de acolo.

 

 

Posted

[pawn]    if(strcmp(cmd, "/withdraw", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerToPoint(6.0, playerid, 1504.2522,-1038.8168,601.5460) || IsAtATMSystem(playerid))

      {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much !");

return 1;

}

  //ConsumingMoney[playerid] = 1;

SafeGivePlayerMoney(playerid,cashdeposit);

PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;

format(string, sizeof(string), "[server]: You Have Withdrawn %s from your account Total: %s", DecimalPoint(cashdeposit),DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

    return 1;

}

}

return 1;

}

if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(!PlayerToPoint(6.0, playerid, 1500.3766,-1038.3237,601.5460) && !IsAtATMSystem(playerid))

        {

            SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much");

return 1;

}

SafeGivePlayerMoney(playerid,-cashdeposit);

new curfunds = PlayerInfo[playerid][pAccount];

PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];

SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");

format(string, sizeof(string), "Old Balance: %s", DecimalPoint(curfunds));

SendClientMessage(playerid, COLOR_GRAD2, string);

format(string, sizeof(string), "Deposit: %s",DecimalPoint(cashdeposit));

SendClientMessage(playerid, COLOR_GRAD4, string);

SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");

format(string, sizeof(string), "New Balance: %s", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_WHITE, string);

return 1;

}

return 1;

}

if(strcmp(cmd, "/balance", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

if(PlayerToPoint(6.0, playerid, 1496.6987,-1038.3569,601.5460) || IsAtATMSystem(playerid))

        {

format(string, sizeof(string), "[server]: You Have %s in your account.",DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

}

}

return 1;

}[/pawn]

[pawn]if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

new playersip[24];

new playerspi[24];

if(PlayerInfo[playerid][pLevel] < 3)

{

SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: You must be level 3 !");

return 1;

}

if(!PlayerToPoint(6.0, playerid, 1496.3708,-1027.3900,601.5460))

        {

            SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /transfer [playerid/PartOfName] [amount]");

return 1;

}

giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /transfer [playerid/PartOfName] [amount]");

return 1;

}

moneys = strval(tmp);

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

GetPlayerIp(giveplayerid, playerspi, sizeof(playerspi));

GetPlayerIp(playerid, playersip, sizeof(playersip));

playermoney = PlayerInfo[playerid][pAccount] ;

if (moneys > 0 && playermoney >= moneys)

{

PlayerInfo[playerid][pAccount] -= moneys;

PlayerInfo[giveplayerid][pAccount] += moneys;

format(string, sizeof(string), "[server]: You have transferd %s to %s's account.", DecimalPoint(moneys), giveplayer,giveplayerid);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

SendClientMessage(playerid, COLOR_GRAD1, string);

format(string, sizeof(string), "[server]: You have recieved %s to into your account from %s.", DecimalPoint(moneys), sendername, playerid);

SendClientMessage(giveplayerid, COLOR_GRAD1, string);

format(string, sizeof(string), "%s(IP: %s) transferd %s to %s(IP: %s)", sendername, playersip, DecimalPoint(moneys), giveplayer, playerspi);

PayLog(string);

format(string, sizeof(string), "[WARNING]: %s{FFFFFF}(IP: %s){E42217} transferd %s to %s{FFFFFF}(IP: %s)", sendername, playersip, DecimalPoint(moneys), giveplayer, playerspi);

                if(moneys >= 1)

{

ABroadCast(0xE42217FF,string,1);

}

printf("%s", string);

PayLog(string);

PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: Invalid transaction amount.");

}

}

}

else

{

format(string, sizeof(string), "[Eroare]: %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

AddPlayerClass(23,2305.7991,-15.8193,26.7496,260.7323,0,0,0,0,0,0); // banca ls

Posted

incearca sai pui....

if(IsPlayerInRangeOfPoint(playerid, 20, 2305.7991,-15.8193,26.7496))
{
        ce face comanda.......
}

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Posted

Incearca:

[pawn] if(strcmp(cmd, "/withdraw", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerToPoint(6.0, playerid, 2305.7991,-15.8193,26.7496) || IsAtATMSystem(playerid))

      {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much !");

return 1;

}

  //ConsumingMoney[playerid] = 1;

SafeGivePlayerMoney(playerid,cashdeposit);

PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;

format(string, sizeof(string), "[server]: You Have Withdrawn %s from your account Total: %s", DecimalPoint(cashdeposit),DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

    return 1;

}

}

return 1;

}

if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(!PlayerToPoint(6.0, playerid, 1500.3766,-1038.3237,601.5460) && !IsAtATMSystem(playerid))

        {

            SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much");

return 1;

}

SafeGivePlayerMoney(playerid,-cashdeposit);

new curfunds = PlayerInfo[playerid][pAccount];

PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];

SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");

format(string, sizeof(string), "Old Balance: %s", DecimalPoint(curfunds));

SendClientMessage(playerid, COLOR_GRAD2, string);

format(string, sizeof(string), "Deposit: %s",DecimalPoint(cashdeposit));

SendClientMessage(playerid, COLOR_GRAD4, string);

SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");

format(string, sizeof(string), "New Balance: %s", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_WHITE, string);

return 1;

}

return 1;

}

if(strcmp(cmd, "/balance", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

if(PlayerToPoint(6.0, playerid, 1496.6987,-1038.3569,601.5460) || IsAtATMSystem(playerid))

        {

format(string, sizeof(string), "[server]: You Have %s in your account.",DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

}

}

return 1;

}[/pawn]

[pawn]if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

new playersip[24];

new playerspi[24];

if(PlayerInfo[playerid][pLevel] < 3)

{

SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: You must be level 3 !");

return 1;

}

if(!PlayerToPoint(6.0, playerid, 2305.7991,-15.8193,26.7496))

        {

            SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /transfer [playerid/PartOfName] [amount]");

return 1;

}

giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /transfer [playerid/PartOfName] [amount]");

return 1;

}

moneys = strval(tmp);

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

GetPlayerIp(giveplayerid, playerspi, sizeof(playerspi));

GetPlayerIp(playerid, playersip, sizeof(playersip));

playermoney = PlayerInfo[playerid][pAccount] ;

if (moneys > 0 && playermoney >= moneys)

{

PlayerInfo[playerid][pAccount] -= moneys;

PlayerInfo[giveplayerid][pAccount] += moneys;

format(string, sizeof(string), "[server]: You have transferd %s to %s's account.", DecimalPoint(moneys), giveplayer,giveplayerid);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

SendClientMessage(playerid, COLOR_GRAD1, string);

format(string, sizeof(string), "[server]: You have recieved %s to into your account from %s.", DecimalPoint(moneys), sendername, playerid);

SendClientMessage(giveplayerid, COLOR_GRAD1, string);

format(string, sizeof(string), "%s(IP: %s) transferd %s to %s(IP: %s)", sendername, playersip, DecimalPoint(moneys), giveplayer, playerspi);

PayLog(string);

format(string, sizeof(string), "[WARNING]: %s{FFFFFF}(IP: %s){E42217} transferd %s to %s{FFFFFF}(IP: %s)", sendername, playersip, DecimalPoint(moneys), giveplayer, playerspi);

                if(moneys >= 1)

{

ABroadCast(0xE42217FF,string,1);

}

printf("%s", string);

PayLog(string);

PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: Invalid transaction amount.");

}

}

}

else

{

format(string, sizeof(string), "[Eroare]: %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

 

 

Posted

Daca nu merge aceea incearca asta :)

if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new playersip[24];
			new playerspi[24];
			if(PlayerInfo[playerid][pLevel] < 3)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: You must be level 3 !");
				return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /transfer [playerid/PartOfName] [amount]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /transfer [playerid/PartOfName] [amount]");
				return 1;
			}
			moneys = strval(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(!PlayerToPoint(6.0, playerid, 1496.3708,-1027.3900,601.5460))
	        	{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						GetPlayerIp(giveplayerid, playerspi, sizeof(playerspi));
						GetPlayerIp(playerid, playersip, sizeof(playersip));
						playermoney = PlayerInfo[playerid][pAccount] ;
						if (moneys > 0 && playermoney >= moneys)
						{
							PlayerInfo[playerid][pAccount] -= moneys;
							PlayerInfo[giveplayerid][pAccount] += moneys;
							format(string, sizeof(string), "[Server]: You have transferd %s to %s's account.", DecimalPoint(moneys), giveplayer,giveplayerid);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							SendClientMessage(playerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "[Server]: You have recieved %s to into your account from %s.", DecimalPoint(moneys), sendername, playerid);
							SendClientMessage(giveplayerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "%s(IP: %s) transferd %s to %s(IP: %s)", sendername, playersip, DecimalPoint(moneys), giveplayer, playerspi);
							PayLog(string);
							format(string, sizeof(string), "[WARNING]: %s{FFFFFF}(IP: %s){E42217} transferd %s to %s{FFFFFF}(IP: %s)", sendername, playersip, DecimalPoint(moneys), giveplayer, playerspi);
			                if(moneys >= 1)
							{
								ABroadCast(0xE42217FF,string,1);
							}
							printf("%s", string);
							PayLog(string);
							PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD1, "[Eroare]: Invalid transaction amount.");
						}
					}
				}
				else return SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");
			}
			else
			{
				format(string, sizeof(string), "[Eroare]: %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Posted

Phoenix nu este buna comanda ta de /transfer deoarece fiecare player poate sa dea /transfer(si o suma de bani) din orice interior.

 

 

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.