/spec command bug
#1

Well guys, while /spec it changes player automaticly
Code:
Код:
	if (strcmp(cmd, "/spec", true) == 0) // Moddded By Weso.
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
			{
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "[CMD]: /spec [playerid/PartOfName]");
					return 1;
				}
	            giveplayerid = ReturnUser(tmp);
	            new Float:Health, Float:Armour;
	            new World = GetPlayerVirtualWorld(playerid);
	            new PlInterior = GetPlayerInterior(playerid);
	            new weaponid, ammo;
	            GetPlayerHealth(playerid, Health);
	            GetPlayerArmour(playerid, Armour);
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
                        if(Spectate[playerid] == 255)
						{
						    GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
                            if(PlayerInfo[playerid][pAdmin] >= 6)
							{
							    if(PlayerInfo[playerid][pAdminDuty] == 1)
								{
								    for (new i=0; i<13; i++)
									{
										GetPlayerWeaponData(playerid, i, weaponid, ammo);
                                        OtherWeapons[playerid][i] = weaponid;
										OtherAmmo[playerid][i] = ammo;
									}
									SpHealth[playerid] = Health;
									SpArmour[playerid] = Armour;
								}
								else
								{
								    SaveGuns(playerid);
								    PlayerInfo[playerid][pHealth] = Health;
								    PlayerInfo[playerid][pArmour] = Armour;
								}
							}
							else
							{
							    SaveGuns(playerid);
							    PlayerInfo[playerid][pHealth] = Health;
								PlayerInfo[playerid][pArmour] = Armour;
							}
						}
						Interior[playerid] = PlInterior;
						VirWorld[playerid] = World;
						TogglePlayerSpectating(playerid, 1);
				        if(IsPlayerInAnyVehicle(giveplayerid)) { PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid)); }
				        else { PlayerSpectatePlayer(playerid, giveplayerid); }
				        Spectate[playerid] = giveplayerid;
				        SafeSetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
				        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						format(string, sizeof(string), "[ADMIN]: %s Is Now Spectating %s (%d).", sendername, giveplayer, giveplayerid);
						SendAdminMessage(COLOR_LIGHTRED,string);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now spectating this player. To Unspec him spec another id or type /endspec <playerid>");
                        TextDrawHideForPlayer(playerid, Textdraw44);
			    		TextDrawHideForPlayer(playerid, Textdraw45);
			    		TextDrawHideForPlayer(playerid, Textdraw55);
			    		TextDrawHideForPlayer(playerid, Textdraw51[playerid]);
			    		if(PlayerInfo[playerid][pWatch] == 1)
						{
							TextDrawHideForPlayer(playerid, Textdraw56);
							TextDrawHideForPlayer(playerid, Textdraw57);
							TextDrawHideForPlayer(playerid, Textdraw58);
						}
						new y, m, d;
						new h,mi,s;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s is speccing %s's",d,m,y,h,mi,s,sendername,giveplayer);
						AdminLog(string);
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "   No Such Player");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not an admin");
			}
		}
		return 1;
	}
Reply
#2

Bumpzzz
Reply
#3

Bump?
Reply
#4

What do you mean with

Quote:

changes player automaticly

Reply
#5

Quote:
Originally Posted by Cirtical
Посмотреть сообщение
Well guys, while /spec it changes player automaticly
To you it is necessary /spec to change a mode having pushed the button?
Reply
#6

Quote:
Originally Posted by Drebin
Посмотреть сообщение
What do you mean with
It just changes player automaticly
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)