[Pomoc] /recon(/specplayer)


Započeo [SC] ScHaLe, Oktobar 12, 2011, 17:09:41 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: GF edit
Detaljan opis problema: Stavio sam komandu /recon(/specplayer) i sve ljepo radi ubacio sam i GametextForPlayer za healt, armor, cash.. I sve to super radi, ali kada idem /recon off vrati me na spawn..Ja bih htio da me vrati na lokaciju gdje sam poceo /reconat..
Dio skripte:
if(strcmp(cmd, "/recon", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /recon [playerid/PartOfName]" );
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /recon off (prekid recona)" );
				return 1;
			}
			if(strcmp("off", tmp, true, strlen(tmp)) == 0)
			{
			    if(WatchingTV[playerid] > 0)
			    {
				    GetPlayerMoney(playerid);
			        WatchingTV[playerid] = 0;
					Spectate[playerid] = 253;
					return 1;
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   You are not watching TV !");
				    return 1;
				}
			}
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						Spectate[playerid] = giveplayerid;
						new Float:health;
						GetPlayerHealth(Spectate[playerid], health);
						new Float:armor;
						GetPlayerArmour(Spectate[playerid], armor);
						GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
						new cash =  GetPlayerMoney(Spectate[playerid]);
						if (PlayerInfo[playerid][pAdmin] >= 1)
						{
							format(string, sizeof(string), "Recon: (%d) %s $%d H:%.0f A:%.0f",Spectate[playerid],giveplayer,cash,health,armor);
						}
						SendClientMessage(playerid, COLOR_GREEN, string);
						WatchingTV[playerid] = 1;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREEN, "   Target is not available.");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
				return 1;
			}
		}
		return 1;
	}


I jos jedno pitanje: Dali se kako moze money and weapon drop FS preradit da ne dropa gun ili pare igracima ako nisu lvl3?
Poslednja Izmena: Oktobar 12, 2011, 19:31:45 POSLE PODNE od ScHaLe
Street's Creed

Street's Creed gaming zajednica se vraća.
Forum: www.streets-creed.info
IP: 213.149.60.34:7774

Iskreno mislim da je to nemoguce napraviti, ali kad bih ja pokusavao na reconu bi stavio
new spawnmesto;
new Float:x, Float:y, Float:z;
spawnmesto = GetPlayerPos(playerid, x, y, z);

a na recon off

SetPlayerPos(playerid, spawnmesto);


Iskreno mislim da ovo nece raditi, ali pokusaj nez sta bi ti reko...

Nisam bas neki scripter pa bi mi bilo drago ako ovo radi i ako uspem nekom pomoci :D

...

K4[Я]!K3

*

'Respect cannot be learned, it can only be earned.'

Citat: dock poslato Oktobar 12, 2011, 17:43:33 POSLE PODNE
Iskreno mislim da je to nemoguce napraviti, ali kad bih ja pokusavao na reconu bi stavio
new spawnmesto;
new Float:x, Float:y, Float:z;
spawnmesto = GetPlayerPos(playerid, x, y, z);

a na recon off

SetPlayerPos(playerid, spawnmesto);


Iskreno mislim da ovo nece raditi, ali pokusaj nez sta bi ti reko...

Nisam bas neki scripter pa bi mi bilo drago ako ovo radi i ako uspem nekom pomoci :D

...
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);

SetPlayerPos(playerid, x,y,z);
Poslednja Izmena: Oktobar 12, 2011, 18:01:46 POSLE PODNE od Marijo B. - K4[Я]!K3™

Nezeli i ne zeli. Probao sam stavit u /recon i vidim da nece, onda probam stavi u public i opet nece

Evo i public pa racite sta tocno da uradim :S
public Spectator()
{
	new string[256];
 new Float:x, Float:y, Float:z;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
 if(KickPlayer[i]==1) { Kick(i); }
			else if(KickPlayer[i]==2) { Ban(i); }
			//if(GetPlayerPing(i) >= 500 && PlayerInfo[i][pAdmin] < 1) { Kick(i); }
			if(Spectate[i] < 253 && Spectate[i] != 255)
			{
				TogglePlayerControllable(i, 0);
				new targetid = Spectate[i];
				if(IsPlayerConnected(targetid))
				{
				    TogglePlayerSpectating(i, 1);
				    GetPlayerPos(i, x, y, z);
				    if(PlayerInfo[i][pAdmin] >= 1)
				    {
				        new Float:health;
				        new Float:armor;
				        GetPlayerArmour(targetid, armor);
					    new name[MAX_PLAYER_NAME];
					    new cash =  GetPlayerMoney(targetid);
					    GetPlayerName(targetid, name, sizeof(name));
					    GetPlayerHealth(targetid, health);
					    format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~w~%s(ID:~b~%d~w~)~n~~w~health:~b~%.1f ~w~Armor:~b~%.1f~n~~w~Cash:~b~%d",name,targetid,health,armor,cash);
					    GameTextForPlayer(i, string, 2500, 3);
				    }
				    if(IsPlayerInAnyVehicle(targetid))
					{
					    new carid = GetPlayerVehicleID(targetid);
					    PlayerSpectateVehicle(i, carid);
					}
					else
					{
					    PlayerSpectatePlayer(i, targetid);
					}
					if(GetPlayerInterior(targetid) == 0)
					{
						SetPlayerInterior(i,0);
					}
					else if(GetPlayerInterior(targetid) > 0)
					{
						SetPlayerInterior(i,GetPlayerInterior(targetid));
					}
				}//Targetid connected
			}
			if(Spectate[i] == 253)
			{
				TogglePlayerControllable(i, 1);
				TogglePlayerSpectating(i, 0);
				SetPlayerInterior(i,Unspec[i][sPint]);
				PlayerInfo[i][pInt] = Unspec[i][sPint];
				PlayerInfo[i][pLocal] = Unspec[i][sLocal];
				Unspec[i][sLocal] = 255;
                SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][sPx],  Unspec[i][sPy], Unspec[i][sPz]-1.0, 1.0, -1, -1, -1, -1, -1, -1);
				gTeam[i] = PlayerInfo[i][pTeam];
				SetPlayerToTeamColor(i);
				MedicBill[i] = 0;
                if(PlayerInfo[i][pDonateRank] > 0)
		        {
		            SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][Coords][0], Unspec[i][Coords][1], Unspec[i][Coords][2], 10.0, -1, -1, -1, -1, -1, -1);
					SpawnPlayer(i);
					SetCameraBehindPlayer(i);
		        }
		        else
		        {
					SetPlayerPos(playerid, x,y,z);
             	}
				Spectate[i] = 255;
			}
   if(Spectate[i] == 254)
			{
				TogglePlayerControllable(i, 1);
				SetPlayerInterior(i,Unspec[i][sPint]);
				PlayerInfo[i][pInt] = Unspec[i][sPint];
				PlayerInfo[i][pLocal] = Unspec[i][sLocal];
				SetPlayerPos(i, Unspec[i][sPx],  Unspec[i][sPy], Unspec[i][sPz]);
				Spectate[i] = 255;
			}
			if(Spectate[i] == 256)
			{
				SetPlayerToTeamColor(i);
				Spectate[i] = 255;
			}
			if(Spectate[i] == 257)
			{
				Spectate[i] = 254;
			}
		}
	}
}
Poslednja Izmena: Oktobar 12, 2011, 19:26:03 POSLE PODNE od ScHaLe
Street's Creed

Street's Creed gaming zajednica se vraća.
Forum: www.streets-creed.info
IP: 213.149.60.34:7774