SA-MP Forums Archive
One problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: One problem (/showthread.php?tid=72492)



One problem - Taz86 - 08.04.2009

I used Seif /view cmd

And now the Pwanoc cant comp it its closed an crash.

Help me please, what to do?

Код:
	if(strcmp(cmd, "/view", true) == 0) // Spectates a player
	{
		if (AccountInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid,RED,"You're not an admin !");
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
	 		SendClientMessage(playerid, LIGHTBLUE, "View Help");
			SendClientMessage(playerid, WHITE, "USAGE: /view [playerid]");
			SendClientMessage(playerid, WHITE, "Will spectate a player.");
			SendClientMessage(playerid, WHITE, "/view off to stop spectating");
			SendClientMessage(playerid, LIGHTBLUE, "");
			return 1;
		}
		new targetid = ReturnUser(tmp);
		if (giveplayerid != INVALID_PLAYER_ID)
		{
		  if (AccountInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid,RED,"You're not an admin !");
		  TogglePlayerSpectating(playerid, 1);
		  SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
		  SetPlayerInterior(playerid,GetPlayerInterior(targetid));
			if (IsPlayerInAnyVehicle(targetid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
			else PlayerSpectatePlayer(playerid, targetid);
			SendClientMessage(playerid, GREY, "Type /view off to stop spectating");
		}
		else if(strcmp(tmp, "off", true) == 0)
		{
		  TogglePlayerSpectating(playerid, 0);
	   	SetPlayerVirtualWorld(playerid,0);
		}
		else
		{
	    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
			SendClientMessage(playerid, GREY, string);
		}
		return 1;
	}



Re: One problem - Taz86 - 08.04.2009

Help Glup....


Re: One problem - miokie - 08.04.2009

ask in the thread where you found that piece of code.


Re: One problem - MenaceX^ - 08.04.2009

It happens because of less/too much brackets.


Re: One problem - Taz86 - 08.04.2009

Where to ask it?


Re: One problem - MenaceX^ - 08.04.2009

I'll redo it to you in another way.. In my own coding style
If you want.


Re: One problem - Taz86 - 09.04.2009

Quote:
Originally Posted by MenaceX^
I'll redo it to you in another way.. In my own coding style
If you want.
Np, i just need a spec cmd that the admin will can stop spec.

Thanks alot!


Re: One problem - Taz86 - 10.04.2009

Quote:
Originally Posted by MenaceX^
I'll redo it to you in another way.. In my own coding style
If you want.
Can you do it and send me?
Im waiting