sell command
#7

i made something
Код:
  if(strcmp("/sellhotdog", cmd, true) == 0)
		{
            tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
   				SendClientMessage(playerid,COLOR_GRAD1,"{33CCFF}USAGE:{FFFFFF} /sellhotdog [playerid] [price]");
				return 1;
			}
			
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
   				SendClientMessage(playerid,COLOR_GRAD1,"{33CCFF}USAGE:{FFFFFF} /sellhotdog [playerid] [price]");
				return 1;
			}
   			if(IsPlayerConnected(giveplayerid))
			{
			new veh = GetPlayerVehicleID(playerid);
			if(PlayerInfo[playerid][pJob] != 3)
			{
			SendClientMessage(playerid, COLOR_YELLOW2, "You are not a HotDog seller.");
			return 1;
			}
			if(!IsAHotDog(veh))
			{
			SendClientMessage(playerid, COLOR_YELLOW2, "You must be inside a HotDog van to sell HotDogs.");
			return 1;
			}
   				if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        new price = strval(tmp);
		   			if(giveplayerid == playerid)
				    {
				        SendClientMessage(playerid, COLOR_SYSTEM, "You cannot sell a hotdog to yourself");
				        return 1;
				    }
				    if (ProxDetectorS(15.0, playerid, giveplayerid))
					{
					    OfferHotdogPlayer[giveplayerid] = playerid;
					    OfferHotdogPrice[giveplayerid] = price;
					    OfferedHotdog[giveplayerid] = 1;
					    format(string, sizeof(string), "%s has offered you a hotdog for $%d (( /accepthotdog ))", GetPlayerNameEx(playerid), price);
						SendClientMessage(giveplayerid, COLOR_YELLOW3, string);
						format(string, sizeof(string), "You offered a hotdog to %s for $%d", GetPlayerNameEx(giveplayerid), price);
						SendClientMessage(playerid, COLOR_SYSTEM, string);
					}
					else
					{
					SendClientMessage(playerid, COLOR_YELLOW3, "That player is not near you.");
					return 1;
					}
				}
			}
		}
Reply


Messages In This Thread
sell command - by PaulDinam - 02.10.2012, 10:29
Re: sell command - by nmader - 02.10.2012, 10:56
Re: sell command - by PaulDinam - 02.10.2012, 11:13
Re: sell command - by nmader - 02.10.2012, 11:33
Re: sell command - by gtakillerIV - 02.10.2012, 11:37
Re: sell command - by nmader - 02.10.2012, 11:46
Re: sell command - by PaulDinam - 02.10.2012, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)