/accept gun problem.
#1

Код:
else if(strcmp(x_job,"gun",true) == 0)
			{
			  if(GunOffer[playerid] < 999)
			  {
			    if(IsPlayerConnected(GunOffer[playerid]))
			    {
			      if (ProxDetectorS(5.0, playerid, GunOffer[playerid]))
						{
						  new x_weapon[256],weapon[MAX_PLAYERS],ammo[MAX_PLAYERS],price[MAX_PLAYERS];
						  if(strcmp(x_weapon,"sdpistol",true) == 0) { if(PlayerInfo[playerid][pMats] > 99) { weapon[playerid] = 23; price[playerid] = 100; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 23; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!"); return 1; } }
							else if(strcmp(x_weapon,"flowers",true) == 0) { if(PlayerInfo[playerid][pMats] > 24) { weapon[playerid] = 14; price[playerid] = 25; ammo[playerid] = 1; PlayerInfo[giveplayerid][pGun1] = 14; PlayerInfo[giveplayerid][pAmmo1] = 1; } else { SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!"); return 1; } }
							else if(strcmp(x_weapon,"eagle",true) == 0) { if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 24; price[playerid] = 150; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 24; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!"); return 1; } }
							else if(strcmp(x_weapon,"mp5",true) == 0) {	if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 29; price[playerid] = 200; ammo[playerid] = 200; PlayerInfo[giveplayerid][pGun2] = 29; PlayerInfo[giveplayerid][pAmmo2] = 200; } else { SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!"); return 1; } }
							else if(strcmp(x_weapon,"shotgun",true) == 0) {	if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 25; price[playerid] = 200; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 25; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!"); return 1; } }
							ConsumingMoney[playerid] = 1;
							GetPlayerName(GunOffer[playerid], giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							format(string, sizeof(string), "  You have given %s, a %s with %d ammo, for %d Materials.", giveplayer, x_weapon, ammo[playerid], price[playerid]);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							SendClientMessage(playerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "  You have recieved a %s with %d ammo from %s.", x_weapon, ammo[playerid], sendername);
							SendClientMessage(giveplayerid, COLOR_GRAD1, string);
							PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
							format(string, sizeof(string), "* %s created a Gun from Materials, and hands it to %s.", sendername ,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							GivePlayerWeapon(GunOffer[playerid],weapon[playerid],ammo[playerid]);
							PlayerInfo[playerid][pMats] -= price[playerid];
							GunOffer[playerid] = 999;
							}
							else
							{
								SendClientMessage(playerid, COLOR_GRAD1, "  Your too far away.");
								return 1;
							}
			    	}
					}
					else
					{
				  	SendClientMessage(playerid, COLOR_GREY, "  No-one offered you a Gun !");
				  	return 1;
					}
			}
I have this but when I type /sellgun id/name eagle it gaves me a SDPistol at any weapon, why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)