Jump to content
  • 0

[GF/RP] problema comanda /repair si /refill


Papana

Question

am comenzile  /repair si /refill la tcc si job id 7

nu merge zice ca nu sunt car mecanic nu merg nici la job nici la factiune

	if(strcmp(cmd, "/refill", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(PlayerInfo[playerid][pJob] == 7 || PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You are not a Car Mechanic!");
		        return 1;
		    }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /refill [playerid/PartOfName] [price]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Price not lower then 1, or above 99999!"); return 1; }
			if(IsPlayerConnected(playa))
			{
			    if(playa != INVALID_PLAYER_ID)
			    {
			        if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
					{
					    if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "   Can't do that!"); return 1; }
					    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "* You offerd %s to refill his car for $%d .",giveplayer,money);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), "* Car Mechanic %s wants to refill your car for $%d, (type /accept refill) to accept.",sendername,money);
						SendClientMessage(playa, COLOR_WHITE, string);
						RefillOffer[playa] = playerid;
						RefillPrice[playa] = money;
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   That player is not near you / not in a car.");
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   That player is offline.");
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/repair", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(PlayerInfo[playerid][pJob] == 7 || PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You are not a Car Mechanic!");
		        return 1;
		    }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /repair [playerid/PartOfName] [price]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Price not lower then 1, or above 99999!"); return 1; }
			if(IsPlayerConnected(playa))
			{
			    if(playa != INVALID_PLAYER_ID)
			    {
			        if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
					{
					    if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "   Can't do that!"); return 1; }
				    	GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
					    format(string, sizeof(string), "* You offerd %s to fix his car for $%d .",giveplayer,money);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), "* Car Mechanic %s wants to repair your car for $%d, (type /accept repair) to accept.",sendername,money);
						SendClientMessage(playa, COLOR_WHITE, string);
						RepairCar[playerid] = GetPlayerVehicleID(playerid);
						RepairOffer[playa] = playerid;
						RepairPrice[playa] = money;
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   That player is not near you / not in a car.");
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   That player is offline.");
			}
		}
		return 1;
	}

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Inlocuie cu [pawn]     if(PlayerInfo[playerid][pJob] != 7 || PlayerInfo[playerid][pMember] != 16 || PlayerInfo[playerid][pLeader] != 16)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are not a Car Mechanic!");

        return 1;

    }[/pawn]

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

incearca asa

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

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerInfo[playerid][pJob] != 7)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are not a Car Mechanic!");

        return 1;

    }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /repair [playerid/PartOfName] [price]");

return 1;

}

new playa;

new money;

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

money = strval(tmp);

if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "  Price not lower then 1, or above 99999!"); return 1; }

if(IsPlayerConnected(playa))

{

    if(playa != INVALID_PLAYER_ID)

    {

        if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))

{

    if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "  Can't do that!"); return 1; }

    GetPlayerName(playa, giveplayer, sizeof(giveplayer));

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

    format(string, sizeof(string), "* You offerd %s to fix his car for $%d .",giveplayer,money);

SendClientMessage(playerid, COLOR_WHITE, string);

format(string, sizeof(string), "* Car Mechanic %s wants to repair your car for $%d, (type /accept repair) to accept.",sendername,money);

SendClientMessage(playa, COLOR_WHITE, string);

RepairOffer[playa] = playerid;

RepairPrice[playa] = money;

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  That player is not near you / not in a car.");

}

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  That player is offline.");

}

}

return 1;

}[/pawn] si la refill

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

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerInfo[playerid][pJob] != 7)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are not a Car Mechanic!");

        return 1;

    }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /refill [playerid/PartOfName] [price]");

return 1;

}

new playa;

new money;

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

money = strval(tmp);

if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "  Price not lower then 1, or above 99999!"); return 1; }

if(IsPlayerConnected(playa))

{

    if(playa != INVALID_PLAYER_ID)

    {

        if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))

{

    if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "  Can't do that!"); return 1; }

    GetPlayerName(playa, giveplayer, sizeof(giveplayer));

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

    format(string, sizeof(string), "* You offerd %s to refill his car for $%d .",giveplayer,money);

SendClientMessage(playerid, COLOR_WHITE, string);

format(string, sizeof(string), "* Car Mechanic %s wants to refill your car for $%d, (type /accept refill) to accept.",sendername,money);

SendClientMessage(playa, COLOR_WHITE, string);

RefillOffer[playa] = playerid;

RefillPrice[playa] = money;

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  That player is not near you / not in a car.");

}

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  That player is offline.");

}

}

return 1;

}[/pawn]

I'm back haha !

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.