How to make this command charge money
#1

How can i make this command charge money if it's used...

Код:
	if (strcmp("/fix", cmd, true) == 0)
	{
 	if (gTeam[playerid] == TEAM_MECHANIC)
	{
 		new giveplayerid;
		new giveplayer[MAX_PLAYER_NAME];
		new sendername[MAX_PLAYER_NAME];
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /fix [playerid]");
 		if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR]: The ID you have entered does not exist!");

 		giveplayerid = ReturnUser(tmp);
 		SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
		GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
		GetPlayerName(playerid,sendername,sizeof(sendername));
		format(tmp,sizeof(tmp),"You fixed %s car!",giveplayer);
		SendClientMessage(playerid,0x33AA33AA,tmp);
		format(tmp,sizeof(tmp),"%s has fixed your engine!",sendername);
		SendClientMessage(giveplayerid,0xAA3333AA,tmp);
  }
		else return SendClientMessage(playerid, COLOR_LIME, "Only Mechanics can use that command so stfu and dont do it again!");
	return 1;
		}
So it checks if the player has the money, if not it says "Player can not afford the fix" and if he does it takes away 1000 and gives it to the mechanic who fixed his car
Reply


Messages In This Thread
How to make this command charge money - by killdahobo99 - 04.08.2009, 00:48
Re: How to make this command charge money - by -Sneaky- - 04.08.2009, 00:54
Re: How to make this command charge money - by killdahobo99 - 04.08.2009, 01:21

Forum Jump:


Users browsing this thread: 1 Guest(s)