Basic Questions
#1

I know i'm going to sound like an idiot for asking this but uhmm,
Where would i input the ammount of bullets that i want to be sold to them?
Because it auto sells them a gun with 5 bullets.
Код:
else if(!strcmp(weapon, "spas12", true, 6))
    {
		if(strval(RPJL(playerid, JOB_WDEALER)) < 5) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
		if(PlayerInfo[playerid][pMaterials] < 6500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 27;
    }
Also, at what part in the next code should i input the cars color?
Код:
CreateVehicle(596, 1530.2592, -1782.6212, 13.3184, 0.0000, -1, -1, 100);
Reply
#2

I would need to see another function, for the weapons.
For the cars:
Код:
CreatePlayerVehicle (modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
And by the way how are you doing? Its Josh McArtin from PARP
Reply
#3

Show me the function for BeenOfferedWeapon
Reply
#4

Josh McArtin! Whats up man.
I am actually running a new server with Gmodder.
We already got the hosted tab, a game server, and domain name for our forums.
Anyways, heres the complete code.
HMU on skype - RolandoBloom1

Код:
new BeenOfferedWeapon[MAX_PLAYERS];
CMD:sellgun(playerid, params[])
{
	new string[128], playerb, price, weapon[32];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pJob] != JOB_WDEALER && PlayerInfo[playerid][pVIPJob] != JOB_WDEALER) return SendClientMessage(playerid, COLOR_GREY, "You are not a weapons dealer.");
	if(sscanf(params, "us[32]i", playerb, weapon, price))
	{
	    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellgun [playerid] [weapon] [price]");
	    SendClientMessage(playerid, COLOR_GREY, "LEVEL 1: Flowers (25) | GolfClub (50) | Shovel (50) | Bat (50) | Katana (50)");
	    SendClientMessage(playerid, COLOR_GREY, "LEVEL 1: SDPistol (100) | Shotgun (200)");
	    if(strval(RPJL(playerid, JOB_WDEALER)) >= 2) SendClientMessage(playerid, COLOR_GREY, "LEVEL 2: MP5 (500) | Rifle (750)");
	    if(strval(RPJL(playerid, JOB_WDEALER)) >= 3) SendClientMessage(playerid, COLOR_GREY, "LEVEL 3: Deagle (2000)");
	    if(strval(RPJL(playerid, JOB_WDEALER)) >= 4) SendClientMessage(playerid, COLOR_GREY, "LEVEL 4: AK47 (4000) | M4 (4500)");
	    if(strval(RPJL(playerid, JOB_WDEALER)) >= 5) SendClientMessage(playerid, COLOR_GREY, "LEVEL 5: SPAS12 (6500) | Sniper (7000)");
	    return 1;
	}
	if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons to yourself, use /creategun.");
	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
	if(PlayerInfo[playerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_GREY, "You must be at least level 2 to sell weapons.");
	if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
    if(!strcmp(weapon, "flowers", true, 7))
    {
        if(PlayerInfo[playerid][pMaterials] < 25) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 14;
    }
    else if(!strcmp(weapon, "golfclub", true, 8))
    {
        if(PlayerInfo[playerid][pMaterials] < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 2;
    }
    else if(!strcmp(weapon, "shovel", true, 6))
    {
        if(PlayerInfo[playerid][pMaterials] < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 6;
    }
	else if(!strcmp(weapon, "bat", true, 3))
    {
        if(PlayerInfo[playerid][pMaterials] < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 5;
    }
    else if(!strcmp(weapon, "katana", true, 6))
    {
        if(PlayerInfo[playerid][pMaterials] < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
        BeenOfferedWeapon[playerb] = 8;
    }
    else if(!strcmp(weapon, "sdpistol", true, 7))
    {
		if(PlayerInfo[playerid][pMaterials] < 100) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 23, 300;
	}
    else if(!strcmp(weapon, "shotgun", true, 7))
    {
		if(PlayerInfo[playerid][pMaterials] < 200) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 25, 300;
	}
  	else if(!strcmp(weapon, "rifle", true, 5))
    {
        if(strval(RPJL(playerid, JOB_WDEALER)) < 2) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
        if(PlayerInfo[playerid][pMaterials] < 750) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 33, 300;
	}
    else if(!strcmp(weapon, "mp5", true, 3))
    {
		if(strval(RPJL(playerid, JOB_WDEALER)) < 2) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
		if(PlayerInfo[playerid][pMaterials] < 500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 29, 300;
    }
    else if(!strcmp(weapon, "deagle", true, 6))
    {
        if(strval(RPJL(playerid, JOB_WDEALER)) < 3) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
        if(PlayerInfo[playerid][pMaterials] < 2000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 24;
    }
    else if(!strcmp(weapon, "ak47", true, 4))
    {
		if(strval(RPJL(playerid, JOB_WDEALER)) < 4) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
		if(PlayerInfo[playerid][pMaterials] < 4000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 30,;
    }
    else if(!strcmp(weapon, "M4", true, 2))
    {
        if(strval(RPJL(playerid, JOB_WDEALER)) < 4) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
        if(PlayerInfo[playerid][pMaterials] < 4500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 31,;
    }
    else if(!strcmp(weapon, "spas12", true, 6))
    {
		if(strval(RPJL(playerid, JOB_WDEALER)) < 5) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
		if(PlayerInfo[playerid][pMaterials] < 6500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 27;
    }
    else if(!strcmp(weapon, "sniper", true, 6))
    {
		if(strval(RPJL(playerid, JOB_WDEALER)) < 5) return SendClientMessage(playerid, COLOR_GREY, "Your Weapons Dealer level is too low to sell this weapon.");
		if(PlayerInfo[playerid][pMaterials] < 7000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials for this weapon.");
		BeenOfferedWeapon[playerb] = 34;
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "Invalid weapon name.");
        return 1;
    }
    SellWeaponTo[playerid] = playerb;
	BuyWeaponFrom[playerb] = playerid;
	BuyWeaponPrice[playerb] = price;
	format(string, sizeof(string), " You have offered %s to sell them a %s for $%d.", RPN(playerb), RWN(BeenOfferedWeapon[playerb]), price);
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	format(string, sizeof(string), " %s has offered to sell you a %s for $%d. (/accept weapon) (/cancel weapon)", RPN(playerid), RWN(BeenOfferedWeapon[playerb]), price);
    SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
	return 1;
}
Reply
#5

Show me this function BeenOfferedWeapon[playerb] = 27;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)