[HELP] Spectate command
#1

Hello, I use the spectate command and for me it sometimes works sometimes not. Sometimes it shows a good player, but sometimes you need to click on a long time and finally working again. Where is problem?


Here spectate command:

Код:
COMMAND:stebeti(playerid,params[])
{
    new zid;
  	if(sscanf(params, "u", zid)) return SendClientMessage(playerid, 0xFF0000AA, "{FBDF89}[FunZoneLT]>> /stebeti [zaidejoid]");
	if(IsPlayerConnected(zid))
	{
		if(ALygis[playerid] >= 1)
		{
			if(IsPlayerInAnyVehicle(zid)){
				PlayerSpectatePlayer(playerid, 1);
				PlayerSpectateVehicle(playerid,GetPlayerVehicleID(zid), SPECTATE_MODE_NORMAL);
			} else {
				TogglePlayerSpectating(playerid, 1);
				PlayerSpectatePlayer(playerid, zid, SPECTATE_MODE_NORMAL);
			}
			SendClientMessage(playerid, orandzine, "{FBDF89}[FunZoneLT]>> Jus dabar stebite, kad baigtumete stebeti rasykite /nestebeti");
		} else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
	} else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
	return 1;
}
Код:
COMMAND:nestebeti(playerid,params[])
{
	#pragma unused params
	TogglePlayerSpectating(playerid, 0);
	return 1;
}
Reply
#2

pawn Код:
COMMAND:stebeti(playerid,params[])
{
    new zid;
    if(sscanf(params, "u", zid)) return SendClientMessage(playerid, 0xFF0000AA, "{FBDF89}[FunZoneLT]>> /stebeti [zaidejoid]");
    if(IsPlayerConnected(zid))
    {
        if(ALygis[playerid] >= 1)
        {
            TogglePlayerSpectating(playerid, 1);
            if(IsPlayerInAnyVehicle(zid))
            {
                PlayerSpectateVehicle(playerid,GetPlayerVehicleID(zid), SPECTATE_MODE_NORMAL);
            }
            else
            {
                PlayerSpectatePlayer(playerid, zid, SPECTATE_MODE_NORMAL);
            }
            SendClientMessage(playerid, orandzine, "{FBDF89}[FunZoneLT]>> Jus dabar stebite, kad baigtumete stebeti rasykite /nestebeti");
        }
        else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
    }
    else SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
    return 1;
}
You need to use TogglePlayerSpectating(playerid, 1); before you start the spectating.
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)