SA-MP Forums Archive
Telecmd - 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: Telecmd (/showthread.php?tid=120896)



Telecmd - icorne - 13.01.2010

Compile text:
C:\Documents and Settings\Administrator\Bureaublad\Warserver\filter scripts\cmds.pwn(20) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Script:
Код:
//-------------------------------------------------
  public OnPlayerCommandText(playerid, cmdtext[])
  
	if(strcmp("/help", cmdtext, true) == 0)
	{
		SendClientMessage(playerid,0xAFAFAFAA,"Available Commands:");
		SendClientMessage(playerid,0xAFAFAFAA,"/controltower - ");
		}
	if(strcmp("/controltower", cmdtext, true) == 2)
	{
  SetPlayerPos(playerid, 1767.6691, -2431.9624, 13.5547);
	}
//-------------------------------------------------
How i fix this? Im a beginner in teleports ;d


Re: Telecmd - SlashPT - 13.01.2010

where is the line of error ??


Re: Telecmd - icorne - 13.01.2010

if(strcmp("/controltower", cmdtext, true) == 2)


Re: Telecmd - SlashPT - 13.01.2010

if(strcmp(cmdtext, "/controltower", true) == 0)


Re: Telecmd - Toad - 13.01.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/help", cmdtext, true) == 0)
	{
		SendClientMessage(playerid,0xAFAFAFAA,"Available Commands:");
		SendClientMessage(playerid,0xAFAFAFAA,"/controltower - ");
		return 1;
	}
	if(strcmp("/controltower", cmdtext, true) == 0)
	{
		SetPlayerPos(playerid, 1767.6691, -2431.9624, 13.5547);
		return 1;
	}
	return 0;
}



Re: Telecmd - icorne - 13.01.2010

That error is not away.
New Script:
Код:
//-------------------------------------------------
  public OnPlayerCommandText(playerid, cmdtext[])
  
	if(strcmp("/help", cmdtext, true) == 0)
	{
		SendClientMessage(playerid,0xAFAFAFAA,"Available Commands:");
		SendClientMessage(playerid,0xAFAFAFAA,"/controltower - ");
		}
  if(strcmp("/controltower", cmdtext, true) == 0)
	{
  SetPlayerPos(playerid, 1767.6691, -2431.9624, 13.5547);
	}
//-------------------------------------------------
Error not changed.
Fixed! ;d


Re: Telecmd - akis_tze - 13.01.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

	if(strcmp("/help", cmdtext, true) == 0)
	{
		SendClientMessage(playerid,0xAFAFAFAA,"Available Commands:");
		SendClientMessage(playerid,0xAFAFAFAA,"/controltower - ");
		return 1;
	}
  if(strcmp("/controltower", cmdtext, true) == 0)
	{
	  SetPlayerPos(playerid, 1767.6691, -2431.9624, 13.5547);
	  return 1;
	}
	return 0;
}