[HELP] GetPlayerClass? Under text command?
#1

Hey there, take a look at my code:

Код:
	if (strcmp("/swapg", cmdtext, true, 10) == 0)
	{
		new grenadeammo = GetPlayerAmmo(playerid);
		new grenweaponcheck = GetPlayerWeapon(playerid);
		if (classid == 4)
		{
			if (grenweaponcheck == 16)
			{
				GivePlayerWeapon(playerid, 18, grenadeammo);
				SendClientMessage(playerid, COLOR_YELLOW , "Swapped your current grenades for Molotov Cocktails.");
				return 1;
			}
			else if (grenweaponcheck == 18)
			{
				GivePlayerWeapon(playerid, 16, grenadeammo);
				SendClientMessage(playerid, COLOR_YELLOW , "Swapped your current grenades for Frag Grenades.");
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_YELLOW , "Please equip your grenades or purchase new");
				SendClientMessage(playerid, COLOR_YELLOW , "ones with the /guns command to swap them.");
				return 1;
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED , "Command only available for Grenadiers.");
			return 1;
		}
I think most of it works, but I can't get the "if(classid == 4)" to work, since "public OnPlayerText(playerid, text[])" doesn't have that. How can I make it check the players class, I can't find a GetPlayerClass from the sidemenu(afaik).

Help a noob.
Reply


Messages In This Thread
[HELP] GetPlayerClass? Under text command? - by CrucixTM - 28.01.2010, 15:17
Re: [HELP] GetPlayerClass? Under text command? - by LuxurioN™ - 28.01.2010, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)