SA-MP Forums Archive
need help with command - 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: need help with command (/showthread.php?tid=102278)



need help with command - PANNA - 14.10.2009

i made now one teleport and i want to make a command like /teles and then you get: /da-Desert Airstrip Terror

i got this:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/da", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 2075.3584,1312.7797,10.6719);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
	return 0;
}
{
	if (strcmp("/teles", cmdtext, true, 10) ==0)
	{
		SendClientMassage(playerid,"/da-Desert Airstrip terror");




when i do compile i get 2 errors:

C:\Users\Onno\Documents\da\gamemodes\saa.pwn(99) : error 055: start of function body without function header
C:\Users\Onno\Documents\da\gamemodes\saa.pwn(100) : error 010: invalid function or declaration





_________________________________________________a nyone knows what to do??


Re: need help with command - PANNA - 14.10.2009

still can't find it man damn


Re: need help with command - [XST]O_x - 14.10.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/da", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 2075.3584,1312.7797,10.6719);
        SetPlayerInterior(playerid, 0);
    }
    if (strcmp("/teles", cmdtext, true, 10) ==0)
    {
        SendClientMessage(playerid,COLOR,"/da-Desert Airstrip terror");
    }
return 0;
}
That should work.
You wrote SendClientMassage,It's supposed to be SendClientMessage.
I Fixed a lot of other errors you had.


Re: need help with command - PANNA - 14.10.2009

alright, it works now thanks

but when i type ingame /teles or /da it works but it says Server unkown command. how is that possible because it works.


Re: need help with command - Correlli - 14.10.2009

You need to return 1; at the end of the command.


Re: need help with command - Ritchie999 - 14.10.2009

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/da", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 2075.3584,1312.7797,10.6719);
		SetPlayerInterior(playerid, 0);
	}
	if (strcmp("/teles", cmdtext, true, 10) ==0)
	{
		SendClientMessage(playerid,COLOR,"/da-Desert Airstrip terror");
    }
return 1;
}



Re: need help with command - Correlli - 14.10.2009

@Ritchie999: wrong.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/da", cmdtext, true, 3) == 0)
  {
    SetPlayerPos(playerid, 2075.3584, 1312.7797, 10.6719);
    SetPlayerInterior(playerid, 0);
    return 1;
  }
  if(strcmp("/teles", cmdtext, true, 6) == 0)
  {
    SendClientMessage(playerid, COLOR, "/da-Desert Airstrip terror");
    return 1;
  }
  return 0;
}



Re: need help with command - Ritchie999 - 14.10.2009

Quote:
Originally Posted by Don Correlli
@Ritchie999: wrong.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/da", cmdtext, true, 3) == 0)
  {
    SetPlayerPos(playerid, 2075.3584, 1312.7797, 10.6719);
    SetPlayerInterior(playerid, 0);
    return 1;
  }
  if(strcmp("/teles", cmdtext, true, 6) == 0)
  {
    SendClientMessage(playerid, COLOR, "/da-Desert Airstrip terror");
    return 1;
  }
  return 0;
}
Ah yes, sorry for the confusion


Re: need help with command - PANNA - 15.10.2009

thankyou guys it works now