Jump to content
  • 0

ajutor comanda /contract


gabyskm96

Question

Salut! am si eu o problema cand x da contract pe y pune sa zicem 10000 $ si dupa ce hitman il omoara pe y nu ii da banii  :sad: ajutati`ma si pe mn cu comanda contract (gm e gf) [pawn]//-------------------------------------------[Contract]-----------------------------------

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

{

    if(IsPlayerConnected(playerid))

  {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");

return 1;

}

giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");

return 1;

}

moneys = strval(tmp);

if(moneys < 10000 || moneys > 100000) { SendClientMessage(playerid, COLOR_GREY, "  Contract money must be atleast $10000, and not more then $100000!"); return 1; }

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

{

SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to place a Contract.");

return 1;

}

if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)

  {

      SendClientMessage(playerid, COLOR_GREY, "  Cannot use this, because you are a Hitman !");

        return 1;

    }

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

    if(PlayerInfo[giveplayerid][pMember] == 8 && PlayerInfo[playerid][pMember] == 8)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Cannot place Contracts on your own Agency!");

        return 1;

    }

    else if(PlayerInfo[giveplayerid][pLeader] == 8 && PlayerInfo[playerid][pMember] == 8)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Cannot place Contracts on your own Agency!");

        return 1;

    }

    else if(PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLeader] == 8)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Can't contract a Hitman !");

        return 1;

    }

    else if(AFKCheck[giveplayerid] > 0)

    {

                        SendClientMessage(playerid, COLOR_GREY, "  Can't contract a afk player !");

    return 1;

            }

            else if(PlayerInfo[giveplayerid][pHeadValue] >= 10000)

            {

                        SendClientMessage(playerid, COLOR_GREY, "  Can't contract this player, because it has already contracted!");

    return 1;

}

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

        {

      SendClientMessage(playerid, COLOR_GRAD1, "This player must be level 3 to place a Contract on him.");

      return 1;

        }

    if(gTeam[giveplayerid] == 2 && moneys != 100000)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Only $100000 can be placed as a Contract on Cops !");

        return 1;

    }

    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Contract yourself!"); return 1; }

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

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

playermoney = GetPlayerMoney(playerid);

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

{

GivePlayerMoney(playerid, (0 - moneys));

PlayerInfo[giveplayerid][pHeadValue]+=moneys;

format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);

SendFamilyMessage(8, COLOR_YELLOW, string);

format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);

SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

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

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Invalid transaction amount.");

}

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "  That player is Offline !");

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

I-a vezi daca merge cu comanda asta:

if(strcmp(cmd, "/contract", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SCM(playerid, COLOR_WHITE, "{3C9DF6}Utilizare Comanda{FFFFFF}: /contract [playerid] [suma]");
				return (1) ;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SCM(playerid, COLOR_WHITE, "{3C9DF6}Utilizare Comanda{FFFFFF}: /contract [playerid] [suma]");
				return (1) ;
			}
			moneys = strval(tmp);
			if(moneys < 10000 || moneys > 100000) { SCM(playerid, COLOR_WHITE, "Ne pare rau, dar suma este intre $10.000 si $100.000."); return (1) ; }
			if(PlayerInfo[playerid][pLevel] < 3)
			{
				SCM(playerid, COLOR_WHITE, "Ne pare rau, dar ai nevoie de Level 3 pentru a utiliza aceasta comanda.");
				return (1) ;
			}
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
 			    	if(PlayerInfo[giveplayerid][pMember] == 8 && PlayerInfo[playerid][pMember] == 8)
				    {
				        SCM(playerid, COLOR_WHITE, "Ne pare rau, dar nu poti pune un Contract pe un Hitman.");
				        return (1) ;
				    }
				    else if(PlayerInfo[giveplayerid][pLider] == 8 && PlayerInfo[playerid][pMember] == 8)
				    {
				        SCM(playerid, COLOR_WHITE, "Ne pare rau, dar nu poti pune un Contract pe un Hitman.");
				        return (1) ;
				    }
				    else if(PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLider] == 8)
				    {
				        SCM(playerid, COLOR_WHITE, "Ne pare rau, dar nu poti pune un Contract pe un Hitman.");
				        return (1) ;
				    }
				    if(IsACop(playerid) && moneys != 100000)
				    {
				        SCM(playerid, COLOR_WHITE, "Ne pare rau, dar te costa $10.0000 un Contract pe Cop.");
				        return (1) ;
				    }
				    if(giveplayerid == playerid) { SCM(playerid, COLOR_WHITE, "Ne pare rau, dar nu poti sa pui un contract pe tine insusi."); return (1) ; }
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					playermoney = GetPlayerMoney(playerid);
					if (moneys > 0 && playermoney >= moneys)
					{
						GivePlayerMoney(playerid, (0 - moneys));
						PlayerInfo[giveplayerid][pHeadValue]+=moneys;
						format(string, sizeof(string), "%s a pus un Contract pe %s cu %d$.",sendername, giveplayer, moneys);
						SendFamilyMessage(8, COLOR_YELLOW, string);
						format(string, sizeof(string), "Ai pus un Contract pe %s, cu %d$.",giveplayer, moneys);
						SCM(playerid, COLOR_LIGHTBLUE, string);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					}
					else
					{
						SCM(playerid, COLOR_WHITE, "{FFFFFF}^ {24BBFF}Galaxy {F65205}Omega {FFFFFF}^ Ne pare rau, dar aeasta comanda este invalida.");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "Ne pare rau, dar acest jucator nu este {007502}Online{FFFFFF}.", giveplayerid);
				SCM(playerid, COLOR_WHITE, string);
			}
		}
		return (1) ;
	}

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

Link to comment
Share on other sites

diabolik imi da 2 erori.. [pawn]C:\Documents and Settings\Gaby\My Documents\Downloads\Server SAMP\gamemodes\xdevil.pwn(46871) : error 017: undefined symbol "pLider"

C:\Documents and Settings\Gaby\My Documents\Downloads\Server SAMP\gamemodes\xdevil.pwn(46876) : error 017: undefined symbol "pLider"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

[/pawn]  linie 46871 [pawn]else if(PlayerInfo[giveplayerid][pLider] == 8 && PlayerInfo[playerid][pMember] == 8)[/pawn]  linie 46876 [pawn] else if(PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLider] == 8)[/pawn]

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.