Jump to content
  • 0

------


Ionut1

Question

1 answer to this question

Recommended Posts

  • 0
On 4/14/2019 at 2:06 AM, RiNNesHD said:

Am nevoie de cineva in care ma poate ajuta sa fac comanda /fare in care sa imi apara tarifu si cati bani a facut un add pe disc: UEVEN.SSH#1022

Iti copiez o comanda aici, te poti lua dupa aceasta comanda sa iti faci. 

CMD:fare(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(PlayerInfo[playerid][pMember] != 13) return SendClientMessage(playerid, COLOR_ERROR, "(Error){FFFFFF} You are not a taxi driver.");
	new fare,string[128],name[30];
	if(sscanf(params, "d", fare)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /fare [amount]");
	if(fare < 0 || fare > 125) return SendClientMessage(playerid, COLOR_ERROR, "(Error){FFFFFF} Fare must be between 1 and 125.");
	if(fare == 0)
	{
		TaxiFare[playerid] = 0;
		SendClientMessage(playerid, COLOR_WHITE, "You are now off duty!");
		PlayerTextDrawHide(playerid, RentCarText[playerid]);
		TaxiMoneyEarned[playerid] = 0;
		foreach(new i : Player)
		{
			if(TaxiDriver[i] == playerid)
			{
				TaxiDriver[i] = -1;
				TaxiMoneySpent[i] = 0;
				TaxiTimer[i] = 0;
				PlayerTextDrawHide(i, RentCarText[i]);
			}
		}
	}
	else
	{
		if(!IsAnTaxi(GetPlayerVehicleID(playerid))) return 1;
		GetPlayerName(playerid, name, sizeof(name));
		TaxiFare[playerid] = fare;
		format(string, sizeof(string), "* Taxi driver %s is now on duty ($%d). [/service taxi]", name, fare);
		SendClientMessageToAll(COLOR_ADV, string);
		SendClientMessage(playerid, COLOR_ERROR, "(Info){FFFFFF} To get off duty, use /fare 0!");
		PlayerTextDrawSetString(playerid, RentCarText[playerid], "~r~waiting for customers..");
		PlayerTextDrawShow(playerid, RentCarText[playerid]);
		foreach(new i : Player)
		{
			if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(i) && playerid != i)
			{
				TaxiDriver[i] = playerid;
				TaxiMoneySpent[i] += TaxiFare[playerid];
				TaxiMoneyEarned[playerid] += TaxiFare[playerid];
				GivePlayerCash(i, -TaxiFare[playerid]);
				GivePlayerCash(playerid, TaxiFare[playerid]);
				Update(i, pCashx);
				Update(playerid, pCashx);
				new timer = 10 + random(7);
				TaxiTimer[i] = timer;
				format(string, sizeof(string), "money earned: ~g~$%d", TaxiMoneyEarned[playerid]);
				PlayerTextDrawSetString(playerid, RentCarText[playerid], string);
				PlayerTextDrawShow(playerid, RentCarText[playerid]);
				format(string, sizeof(string), "money spent so far: ~g~$%d", TaxiMoneySpent[i]);
				PlayerTextDrawSetString(i, RentCarText[i], string);
				PlayerTextDrawShow(i, RentCarText[i]);
			}
		}
	}
	return 1;
}

 

Ai nevoie de ajutor in scripting si nu ai bani? Te pot ajuta cu mare drag. Dar asta nu inseamna sa iti lucrez un Sistem de joc complet, daca ai nevoie de ajutor ma poti contacta pe Discord.ezgif-2-3a38433e2465.gif.9283810e304f5e405309769455e5e14b.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.