need help with command
#1

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??
Reply
#2

still can't find it man damn
Reply
#3

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.
Reply
#4

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.
Reply
#5

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

Код:
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;
}
Reply
#7

@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;
}
Reply
#8

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
Reply
#9

thankyou guys it works now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)