[Pomoc] /duty Bug


Započeo KiLLa, Novembar 07, 2011, 10:35:54 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta: Raven's Roleplay
Problem: npr. LSPD ste, odete /duty, sve normalno ime vam je plavo itd.. A kada idete off /duty ime vam bude bjelo (i treba)
ali dobijem skin CJ-a ili neki drugi... Zelim kada odete off /duty da vam ostane skin policajca...


//----------------------------------[offduty]-----------------------------------------------
	if(strcmp(cmd, "/duty", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pWanted] == 1) return SendClientMessage(playerid, COLOR_GREY, "* Criminals can not go on duty!");
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3 || IsAFreecop(playerid))
			{
				if(PlayerInfo[playerid][pDBanned] == 1)
				{
					SendClientMessage(playerid, COLOR_GREY, "* You are Banned from Cop Duty!");
					return 1;
				}
				if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || PlayerInfo[playerid][pLocal] != 255)
				{
					if(PlayerInfo[playerid][pDuty] == 0)
			        {
			            if(IsAFreecop(playerid))
			            {
			                format(string, sizeof(string), "* Voluntary Officer %s took a Badge and a Gun from his locker.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
							SafeResetPlayerWeapons(playerid);
							SafeGivePlayerWeapon(playerid, 41, 150);
							SafeGivePlayerWeapon(playerid, 24, 70);
							SafeGivePlayerWeapon(playerid, 3, 0);
							SetPlayerColor(playerid,0xa9c4e400);
							PlayerInfo[playerid][pDuty] = 1;
							PlayerInfo[playerid][pChar] = 71;
							new factionskin = PlayerInfo[playerid][pChar];
    						SetPlayerSkin(playerid, factionskin);
    						SaveGuns(playerid);
							return 1;
						}
			            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
			            {
				    		format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
				    		SendClientMessage(playerid, COLOR_WHITE, "Type /equip for equipments // Type /undercover to see UC Skins!");
    					}
						else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
			            {
				    		format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
				    		SendClientMessage(playerid, COLOR_WHITE, "Type /equip, /agent and /undercover for equipments & Skins!");
    					}
						else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
			            {
				    		format(string, sizeof(string), "* Soldier %s took a Badge and a Gun from his locker.", sendername);
				    		SendClientMessage(playerid, COLOR_WHITE, "Type /equip and /soldier for equipments & Skins!");
						}
						SendClientMessage(playerid, COLOR_WHITE,"* If you wish to use your tazer type /tazer");
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						SafeResetPlayerWeapons(playerid);
						SafeGivePlayerWeapon(playerid, 24, 70);
						SafeGivePlayerWeapon(playerid, 3, 0);
						PlayerInfo[playerid][pTazerBullets] = 20;
						PlayerInfo[playerid][pDuty] = 1;
						SetPlayerToTeamColor(playerid);
						new factionskin = PlayerInfo[playerid][pChar];
    					SetPlayerSkin(playerid, factionskin);
    					AttachWeaponCorrectly(playerid, 23);
					}
					else if(PlayerInfo[playerid][pDuty] == 1)
					{
					    if(IsAFreecop(playerid))
					    {
					        format(string, sizeof(string), "* Voluntary Officer %s places his Badge and Gun in his locker.", sendername);
					        ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
							SafeResetPlayerWeapons(playerid);
							PlayerInfo[playerid][pDuty] = 0;
							SetPlayerColor(playerid, TEAM_HIT_COLOR);
							new originalskin = PlayerInfo[playerid][pModel];
	    					SetPlayerSkin(playerid, originalskin);
	    					PlayerInfo[playerid][pChar] = 0;
	    					SetPlayerWeapons(playerid);
							return 1;
						}
					    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
					    {
					        OnSwatDuty[playerid] = 0;
							format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
						}
						else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
						{
						    OnTacticalDuty[playerid] = 0;
						    format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);
						}
						else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
			            {
			                OnSpecialFDuty[playerid] = 0;
				    		format(string, sizeof(string), "* Soldier %s places his Badge and Gun in his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
						SafeResetPlayerWeapons(playerid);
						SafeSetPlayerArmour(playerid, 0);
						SafeGivePlayerWeapon(playerid, 41, 500);
						PlayerInfo[playerid][pDuty] = 0;
						PlayerInfo[playerid][pChar] = 0;
						SetPlayerColor(playerid, TEAM_HIT_COLOR);
						new originalskin = PlayerInfo[playerid][pModel];
    					SetPlayerSkin(playerid, originalskin);
    					AttachWeaponCorrectly(playerid, 99);
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD2, "** You are not in a locker room !");
					return 1;
				}
			}

[]Flynâ„¢

*

Never look down on anybody unless you're helping them up.

Izbaci "original skin", msm da je to...


[]Flynâ„¢

*

Never look down on anybody unless you're helping them up.

Citat: KiLLa poslato Novembar 07, 2011, 22:31:16 POSLE PODNE
Nije, obriso i isto je ....
obrisi taj originalskin i obrisi ovo : PlayerInfo[playerid][pChar] = 0; (to bi trebalo da je CJov skin)

Pokusaj tako, moras pokusavati da bi nesto uradio  :)