This LSPD code dont give weapons?
#1

Hey. Im here with a script I cant get to work!
Im trying me on some roleplay, and now I came to the /lspd command.
Everything is working, but not Weapons. It dont give any weapons when I do /lspd and then find the weapons. I only have my fits. I posted the hole code so you guys can look on it. The skins, duty working, but no weapons.
Thanks if any find it out :P
Код:
	if(dialogid == DUTYMENU)
	{
 		if(response)
		{
	
                                if(listitem == 0)
			{
				if(PlayerInfo[playerid][pDuty]==0)
				{
					format(string, sizeof(string), "* Officer %s takes a badge and a gun from their locker.", GetPlayerNameEx(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetPlayerColor(playerid, TEAM_BLUE_COLOR);
					SetPlayerSkin(playerid, 280);
					PlayerInfo[playerid][pModel] = 280;
	    			SetPlayerArmour(playerid, 100.0);
					GivePlayerValidWeapon(playerid, 24, 99999);
					GivePlayerValidWeapon(playerid, 41, 99999);
					GivePlayerValidWeapon(playerid, 3, 99999);
					OnDuty[playerid] = 1;
					PlayerInfo[playerid][pDuty] = 1;
                    //ShowPlayerDialog(playerid, DUTY_OPTIONS, DIALOG_STYLE_LIST, "Duty Options","Public\nUndercover", "Select", "Cancel");
				}
				else if(PlayerInfo[playerid][pDuty]==1)
				{
					format(string, sizeof(string), "* Officer %s places their badge and gun in their locker.", GetPlayerNameEx(playerid));
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					SetPlayerColor(playerid, TEAM_HIT_COLOR);
					SetPlayerArmour(playerid, 0.0);
					SetPlayerSkin(playerid, 46);
					PlayerInfo[playerid][pModel] = 46;
					OnDuty[playerid] = 0;
					PlayerInfo[playerid][pDuty] = 0;
				}
			}
			if(listitem == 1)
			{
				ShowPlayerDialog(playerid, DUTYMENU2, DIALOG_STYLE_LIST, "LSPD Equipment","Mace\nNite Stick\nDesert Eagle\nSPAS-12\nMP5\nM4A1\nAK-47\nSmoke Grenade\nShotgun\nRifle\nSniper Rifle\nKevlar Vest\nFirst Aid Kit\nAccessories", "Purchase", "Cancel");
			}
			if(listitem == 2) 
			{
			    if(PlayerInfo[playerid][pDivision] == 2)
			    {
					SetPlayerSkin(playerid, 285);
					PlayerInfo[playerid][pModel] = 285;
				}
				else
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "You are not in the SWAT division.");
				}
			}
			if(listitem == 3)
			{
				ShowPlayerDialog(playerid, DUTYMENU3, DIALOG_STYLE_LIST, "LSPD Uniforms","Cadet\nFemale Officer\nOfficer 1\nOfficer 2\nOfficer 3\nBlack Officer\nLatino Officer\nMotorcycle Officer\nSWAT Officer\nSergeant\nCaptain\nChief", "Put On", "Cancel");
			}
			if(listitem == 4)
			{
				ShowPlayerDialog(playerid, FDUTYMENU4, DIALOG_STYLE_INPUT, "Undercover","Choose a skin (by ID).", "Select", "Cancel");
			}
			if(listitem == 5)
			{
				ShowPlayerDialog(playerid, DUTYMENU5,DIALOG_STYLE_INPUT,"LSPD"," Who would you like to clear?","Clear","Nevermind");
    		}
		}
	}
	if(dialogid == DUTYMENU2)
	{
 		if(response)
		{
		    if(Tax > 0) switch(listitem) {
				case 0:
				{
					GivePlayerValidWeapon(playerid, 41, 60000);
					Tax -= 20;
				}
				case 1:
				{
					GivePlayerValidWeapon(playerid, 3, 60000);
					Tax -= 20;
				}
				case 2:
				{
					GivePlayerValidWeapon(playerid, 24, 60000);
					Tax -= 500;
				}
				case 3:
				{
					if(PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pRank] >= 1)
					{
						GivePlayerValidWeapon(playerid, 27, 60000);
						Tax -= 10000;
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SWAT division, or at least rank 2.");
					}
				}
				case 4:
				{
					GivePlayerValidWeapon(playerid, 29, 60000);
					Tax -= 400;
				}
				case 5:
				{
					GivePlayerValidWeapon(playerid, 31, 60000);
					Tax -= 4000;
				}
				case 6:
				{
					if(PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pRank] >= 1)
					{
						GivePlayerValidWeapon(playerid, 30, 60000);
						Tax -= 4000;
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SWAT division, or at least rank 3.");
					}
				}
				case 7:
				{
					if(PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pRank] >= 1)
					{
						GivePlayerValidWeapon(playerid, 17, 5);
						Tax -= 800;
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SWAT division, or at least rank 3.");
					}
				}
				case 8:
				{
					GivePlayerValidWeapon(playerid, 25, 60000);
					Tax -= 200;
				}
				case 9:
				{
					GivePlayerValidWeapon(playerid, 33, 60000);
					Tax -= 1000;
				}
				case 10:
				{
					if(PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pRank] >= 1)
					{
						GivePlayerValidWeapon(playerid, 34, 60000);
						Tax -= 10000;
					}
					else
					{
						SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SWAT division, or at least rank 3.");
					}
				}
				case 11:
				{
					SetPlayerArmour(playerid, 100.0);
					Tax -= 2000;
				}
				case 12: SetPlayerHealth(playerid, 100);
				case 13: ShowPlayerDialog( playerid, BUYTOYSCOP, DIALOG_STYLE_MSGBOX, "Accessories", "Welcome to the law enforcement accessory locker!\n\n(As with regular toys, VIP unlocks more slots.)","Continue", "Cancel" );
			}
			else return SendClientMessageEx(playerid,COLOR_WHITE,"The government is in debt; no funds are available for equipment.");
		}
	}
	if(dialogid == DUTYMENU3)
	{
 		if(response)
		{
			if(listitem == 0)
			{
				SetPlayerSkin(playerid, 71);
				PlayerInfo[playerid][pModel] = 71;
			}
			if(listitem == 1)
			{
				SetPlayerSkin(playerid, 141);
				PlayerInfo[playerid][pModel] = 141;
			}
			if(listitem == 2)
			{
				SetPlayerSkin(playerid, 280);
				PlayerInfo[playerid][pModel] = 280;
			}
			if(listitem == 3)
			{
				SetPlayerSkin(playerid, 266);
				PlayerInfo[playerid][pModel] = 266;
			}
			if(listitem == 4)
			{
				SetPlayerSkin(playerid, 281);
				PlayerInfo[playerid][pModel] = 281;
			}
			if(listitem == 5)
			{
				SetPlayerSkin(playerid, 265);
				PlayerInfo[playerid][pModel] = 265;
			}

			if(listitem == 6)
			{
				SetPlayerSkin(playerid, 267);
				PlayerInfo[playerid][pModel] = 267;
			}
			if(listitem == 7)
			{
				SetPlayerSkin(playerid, 284);
				PlayerInfo[playerid][pModel] = 284;
			}
			if(listitem == 8)
			{
				SetPlayerSkin(playerid, 285);
				PlayerInfo[playerid][pModel] = 285;
			}
			if(listitem == 9)
			{
				SetPlayerSkin(playerid, 282);
				PlayerInfo[playerid][pModel] = 282;
			}
			if(listitem == 10)
			{
				SetPlayerSkin(playerid, 283);
				PlayerInfo[playerid][pModel] = 283;
			}
			if(listitem == 11)
			{
				SetPlayerSkin(playerid, 288);
				PlayerInfo[playerid][pModel] = 288;
			}
		}
	}
	if(dialogid == DUTYMENU4)
	{
 		if(response)
		{
			if(listitem == 0)
			{
				SetPlayerSkin(playerid, 223);
				PlayerInfo[playerid][pModel] = 223;
			}
			if(listitem == 1)
			{
				SetPlayerSkin(playerid, 120);
				PlayerInfo[playerid][pModel] = 120;
			}
			if(listitem == 2)
			{
				SetPlayerSkin(playerid, 240);
				PlayerInfo[playerid][pModel] = 240;
			}
			if(listitem == 3)
			{
				SetPlayerSkin(playerid, 296);
				PlayerInfo[playerid][pModel] = 296;
			}
			if(listitem == 4)
			{
				SetPlayerSkin(playerid, 137);
				PlayerInfo[playerid][pModel] = 137;
			}
			if(listitem == 5)
			{
				SetPlayerSkin(playerid, 214);
				PlayerInfo[playerid][pModel] = 214;
			}
			if(listitem == 6)
			{
				SetPlayerSkin(playerid, 147);
				PlayerInfo[playerid][pModel] = 147;
			}
			if(listitem == 7)
			{
				SetPlayerSkin(playerid, 150);
				PlayerInfo[playerid][pModel] = 150;
			}
			if(listitem == 8)
			{
				SetPlayerSkin(playerid, 201);
				PlayerInfo[playerid][pModel] = 201;
			}
			if(listitem == 9)
			{
				SetPlayerSkin(playerid, 162);
				PlayerInfo[playerid][pModel] = 162;
			}
			if(listitem == 10)
			{
				SetPlayerSkin(playerid, 29);
				PlayerInfo[playerid][pModel] = 29;
			}
			if(listitem == 11)
			{
				SetPlayerSkin(playerid, 270);
				PlayerInfo[playerid][pModel] = 270;
			}
			if(listitem == 12)
			{
				SetPlayerSkin(playerid, 59);
				PlayerInfo[playerid][pModel] = 59;
			}
		}
	}
    if(dialogid == DUTYMENU5)
	{
	    if(response)
    	{
            new giveplayerid = ReturnUser(inputtext);
			//giveplayerid = strval(inputtext);
			if(IsPlayerConnected(giveplayerid))
			{
				if(giveplayerid != INVALID_PLAYER_ID)
				{
					format(string, sizeof(string), "* You cleared the records and wanted points of %s.", GetPlayerNameEx(giveplayerid));
					SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
					format(string, sizeof(string), "* Officer %s has cleared your records and wanted points.", GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
					format(string, sizeof(string), "* Officer %s has cleared %s's records and wanted points.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
					SendRadioMessage(1, RADIO, string);
					SendRadioMessage(2, RADIO, string);
					SendRadioMessage(5, RADIO, string);
					SendRadioMessage(7, RADIO, string);
					SendRadioMessage(11, RADIO, string);
					SendRadioMessage(13, RADIO, string);
					WantedPoints[giveplayerid] = 0;
					PlayerInfo[giveplayerid][pWantedLevel] = 0;
					SetPlayerToTeamColor(giveplayerid);
				    SetPlayerWantedLevel(giveplayerid, 0);
    				ClearCrime(giveplayerid);
				}
				else
				{
					SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
				}
			}
		}
	}
((No errors on pawn))
Reply
#2

Bump, Please help
Reply
#3

Please tell what GivePlayerValidWeapon is?

Some anti-cheat System using to help detect cheaters?
Cause that might be the problem or use GivePlayerWeapon!
Reply
#4

The anti-cheat program is not in yet. I think it was GivePlayerValidWeapon?
I will try it when Im home.
Thanks for help, I will reply when I tyred it.
Reply
#5

If it wrong then Use GivePlayerWeapon(playerid, 31, 999);
Weapon Is ID: 31 (M4)

NP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)