Jump to content
  • 0

/accept money marriage lawyer tot buguit


Question

3 answers to this question

Recommended Posts

Posted

am bug la aceste comenzi cand le scriu in chat ele merg dar nu se intampla nimic , de la ce poate fii?

ATM TRANSFER

if(strcmp(cmd, "/atmtransfer", true) == 0 || strcmp(cmd, "/atmwiretransfer", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLevel] < 3)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "   You must be level 3 !");
    return 1;
    }
    if(PlayerToPoint(25.0,playerid,-1981.71,120.82,27.67))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /atmtransfer [playerid/PartOfName] [amount]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /atmtransfer [playerid/PartOfName] [amount] [reason]");
    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] ;
    new length = strlen(cmdtext); //adaugat
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[128];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /atmtransfer [playerid/PartOfName] [amount] [reason]");
    return 1;
    }//aici
    if (moneys > 0 && playermoney >= moneys)
    {
    format(string, sizeof(string),"%s wants to transfer you %d$ reason: %s, if you want to accept the money, type /accept money.",sendername,moneys,(result));
    SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string),"You have offered %s to accept %d$ reason: %s.Wait his answer.",giveplayer,moneys,(result));
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    TransferOffer[giveplayerid] = playerid;
    TransferMoney[giveplayerid] = moneys;
    format(string, sizeof(string), "%s transferd $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
    if(moneys >= 500000)
    {
    ABroadCast(COLOR_YELLOW,string,1);
    }
    //printf("%s", string);//aici
    PayLog(string);
    PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount.");
    }
    }
    }
    else
    {
    format(string, sizeof(string), "   %d nu este un player activ.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
	}
Transferul normal
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pLevel] < 3)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You must be level 3 !");
				return 1;
			}
			if(PlayerInfo[playerid][pLocal] != 103)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You are not at the Bank !");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /transfer [playerid/PartOfName] [amount] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /transfer [playerid/PartOfName] [amount] [reason]");
				return 1;
			}
			moneys = strval(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
                    /*if(PlayerInfo[giveplayerid][pLevel] <= 5)
			        {
				       SendClientMessage(playerid, COLOR_WHITE, " You can`t give money to newbies !");
			           return 1;
			        }*/
			        new length = strlen(cmdtext);//adaugat
			        while ((idx < length) && (cmdtext[idx] <= ' '))
			        {
			            idx++;
			        }
			        new offset = idx;
			        new result[128];
			        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			        {
			            result[idx - offset] = cmdtext[idx];
			            idx++;
			        }
			        result[idx - offset] = EOS;
			        if(!strlen(result))
			        {
			            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /transfer [playerid/PartOfName] [amount] [reason]");
			            return 1;
			        }//aici
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					playermoney = PlayerInfo[playerid][pAccount] ;
					if (moneys > 0 && playermoney >= moneys)
					{
						format(string, sizeof(string),"%s wants to transfer you %d$ reason: %s, if you want to accept the money, type /accept money.",sendername,moneys,(result));
		                SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
	    	            format(string, sizeof(string),"You have offered %s to accept %d$ reason: %s.Wait his answer.",giveplayer,moneys,(result));
		                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                        TransferOffer[giveplayerid] = playerid;
                        TransferMoney[giveplayerid] = moneys;
                        format(string, sizeof(string), "%s transferd $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
		                if(moneys >= 500000)
						{
							ABroadCast(COLOR_YELLOW,string,1);
						}
						//printf("%s", string);//aici
						PayLog(string);
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount.");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
	if(strcmp(cmd,"/propose",true)==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(GetPlayerMoney(playerid) < 100000)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   The Marriage & Reception costs $100000 !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pMarried] > 0)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You are already Married !");
				return 1;
	        }
	        if(PlayerInfo[playerid][pPhousekey] == 255)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You don't have a House to let your Wife / Husband live somewhere !");
				return 1;
	        }
	        tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) {
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /propose [Playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
		    if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(PlayerInfo[giveplayerid][pMarried] > 0)
			        {
			            SendClientMessage(playerid, COLOR_GREY, "   That player is already Married !");
			            return 1;
			        }
			        if(PlayerInfo[giveplayerid][pPhousekey] != 255)
			        {
			            SendClientMessage(playerid, COLOR_GREY, "   That player has a House, can't be Married !");
			            return 1;
			        }
			        if(PlayerInfo[giveplayerid][pPbiskey] != 255)
			        {
			            SendClientMessage(playerid, COLOR_GREY, "   That player has a Business, can't be Married !");
			            return 1;
			        }
			        if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Propose to yourself!"); return 1; }
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "* You proposed to %s.", giveplayer);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "* %s just proposed to you (type /accept marriage) to accept.", sendername);
						SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
				        ProposeOffer[giveplayerid] = playerid;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   That player is not near you !");
						return 1;
					}
			    }
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
			    return 1;
			}
	    }
	    return 1;
	}
if(strcmp(cmd, "/free", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(PlayerInfo[playerid][pJob] != 2)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You are not a Lawyer!");
		        return 1;
		    }
		    if(PlayerInfo[playerid][pLawSkill] >= 401)
		    {
		        ApprovedLawyer[playerid] = 1;
		    }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /free [playerid/PartOfName] [price]");
				return 1;
			}
			new money;
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) { return 1; }
			money = strval(tmp);
			if(money < 1 || money > 30000) { SendClientMessage(playerid, COLOR_GREY, "   Price not lower then 1, or above 30000!"); return 1; }
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Free yourself!"); return 1; }
					if(PlayerInfo[giveplayerid][pJailed] == 1)//era asta && ApprovedLawyer[playerid] == 1
					{
                       if(PlayerToPoint(3, playerid,249.2007,67.5946,1003.6406))  //if(ProxDetectorS(8.0, playerid, giveplayerid))
					   {
                           if(PlayerInfo[giveplayerid][pJailTime] > 800)
				           {
					           SendClientMessage(playerid, COLOR_GRAD1, "   Player Jail Time is more than 800!");
					           return 1;
                           }
						   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						   GetPlayerName(playerid, sendername, sizeof(sendername));
						   format(string, sizeof(string), "* You offerd %s to get out of jail for $%d.", giveplayer, money);
						   SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						   format(string, sizeof(string), "* Lawyer %s wants to get you out of jail for $%d, (type /accept lawyer2) to accept.", sendername, money);
						   SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
						   LawyerOffer[giveplayerid] = playerid;
						   LawyerPrice[giveplayerid] = money;
					   }
					   else
					   {
					       SendClientMessage(playerid, COLOR_GREY, "   You`are not in the station PD !");
					   }
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   Player didnt need a Lawyer / Player aint Jailed !");
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   That player is offline!");
			}
		}//not connected
		return 1;
	}

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.