Small scripting help
#1

I created a script for television. A news reporter can broadcast a tv means if a player does /watchtv it sets his camera to news reporter position.

Here is the script. Is it correct script?

Код:
new video;
new Float:TempX;
new Float:TempY;
new Float:TempZ;
	if(strcmp(cmd, "/tvair", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
			{
			   GetPlayerPos(video,TempX,TempY,TempZ);
               TogglePlayerControllable(playerid, 0);
               SetTimerEx("ResetCam", 10000, 0, "i", playerid);
               SendClientMessage(playerid, COLOR_PURPLE, "   You Are broadcasting a video");
			   return 1;
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
			}
		}
	}
	if(strcmp(cmd, "/watchtv", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
  			SetPlayerCameraPos(playerid, TempX, TempY, (TempZ+60));
			SetPlayerCameraLookAt(playerid, TempX, TempY, TempZ);
		    TogglePlayerControllable(playerid, 0);
			SetTimerEx("ResetCam", 10000, 0, "i", playerid);
			SendClientMessage(playerid, COLOR_PURPLE, "   You are watching the TV! Enjoy!");
			   return 1;
		}
	}
And how to make a script to prevent another reported from broadcasting while other is doing it? And is it possible to make different channels , if so please help

PS:- Game crashes when i press command /tvair without being a news reporter , Solve this

Thanks
Reply
#2

help guys
Reply
#3

Please help it doesnt work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)