storewep is bugged
#2

Hi. I saw that you used "i" in the sscanf syntax: if(sscanf(params, "i", option))
Since "option" represents a string, you have to use "s[32]" ("i" stands for integrer, 1, 2, 3, 4, -1, -2, etc.)

So your code must be something like this:

Код:
CMD:takewep(playerid, params[])
{
	new option[32], string[128], string2[128];
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "You need to login first!");
   	if(sscanf(params, "s[32]", option))
	{
 		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ptakegun [trousers/pocket]");
 		
 	}
 	else if(!strcmp(option, "trousers", true))
	{
 		if(!GunInfo[playerid][gGun][0]) return SendClientMessage(playerid, -1, "[Error] You don't have a weapon in your trousers pocket.");
 		GivePlayerWeapon(playerid, GunInfo[playerid][gGun][0], GunInfo[playerid][gGunAmmo][0]);
		GunInfo[playerid][gGun][0] = 0;
		GunInfo[playerid][gGunAmmo][0] = 0;
		pInfo[playerid][pTrousers] = 0;
	       GUN(GetPlayerWeapon(playerid)));
	}
	else if(!strcmp(option, "pocket", true))
	{
	    if(!GunInfo[playerid][gGun][1]) return SendClientMessage(playerid, -1, "[Error] You don't have a weapon in your jacket pocket.");
 		GivePlayerWeapon(playerid, GunInfo[playerid][gGun][1], GunInfo[playerid][gGunAmmo][1]);
		GunInfo[playerid][gGun][1] = 0;
		GunInfo[playerid][gGunAmmo][1] = 0;
		pInfo[playerid][pJacket] = 0;
		GUN(GetPlayerWeapon(playerid)));
	}
	return 1;
}
+rep?
Reply


Messages In This Thread
storewep is bugged - by HeroDR22 - 11.05.2018, 01:30
Re: storewep is bugged - by Vennox - 11.05.2018, 07:54
Re: storewep is bugged - by CrystalGamer - 11.05.2018, 09:38
Re: storewep is bugged - by Vennox - 11.05.2018, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)