Want to setplayercheckpoint in a command ... how ?
#1

I want to set a checkpoint if the types the command ..
but I don't know how...
Reply
#2

Uh do i think to easy now or.. do you just mean

Код:
dcmd_mycommand( playerid, text[] )
{
    SetPlayerCheckpoint(playerid, x, y, z );
    #pragma unused text
    return 1;
}
Reply
#3

Quote:
Originally Posted by afei™
Uh do i think to easy now or.. do you just mean

dcmd_mycommand( playerid, text[] )
{
SetPlayerCheckpoint(playerid, x, y, z );
#pragma unused text
return 1;
}
Question;

Shouldn't it be dcmd_mycommand(playerid, params)?
Reply
#4

Doesnt matter how you name it
Код:
dcmd_mycommand( playerid, afei[] )
Reply
#5

yes and how to add a function which occurs when the player enters the checkpoint =)

But thanks for that little but helpful post *happy*
Reply
#6

You dont have to add such a function. There's already one.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}
Reply
#7

Quote:
Originally Posted by afei™
You dont have to add such a function. There's already one.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}
He's asking how to make a checkpoint in a command, not how to do something when a player enters a checkpoint.
pawn Код:
new
  cmd[128];
if(!strcmp(cmd,"/checkpoint",true))
{
  SetPlayerCheckpoint(playerid,x,y,z);
  SendClientMessage(playerid,color,"Checkpoint created.");
  return 1;
}
Reply
#8

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by afei™
You dont have to add such a function. There's already one.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}
He's asking how to make a checkpoint in a command, not how to do something when a player enters a checkpoint.
pawn Код:
new
  cmd[128];
if(!strcmp(cmd,"/checkpoint",true))
{
  SetPlayerCheckpoint(playerid,x,y,z);
  SendClientMessage(playerid,color,"Checkpoint created.");
  return 1;
}
You should scroll up before posting

Quote:
Originally Posted by afei™
Uh do i think to easy now or.. do you just mean

Код:
dcmd_mycommand( playerid, text[] )
{
    SetPlayerCheckpoint(playerid, x, y, z );
    #pragma unused text
    return 1;
}
Reply
#9

Yes but what to do with more functions ...

then onplayerentercheckpoint occurs only in one way and for All funtions which sets
a checkpoint ..

Or have i do it like this ?

Код:
if(strcmp("/mycommand",cmdtext,true) == 0)
{ 
 SetPlayerCheckpoint(playerid,bla,bla,bla);
 Whatelse[playerid] = 1;
 SendClientMessage(playerid,COLOR_BLA,"GoGoGo XD!");
 return 1;
}

OnPlayerEnterCheckpoint(playerid)
{
  if(Whatelse[playerid] == 1)
  {
  DisablePlayerCheckpoint(playerid);
  }
  else
  {
  }
}
Reply
#10

Quote:
Originally Posted by Bearfist
Yes but what to do with more functions ...

then onplayerentercheckpoint occurs only in one way and for All funtions which sets
a checkpoint ..

Or have i do it like this ?

Код:
if(strcmp("/mycommand",cmdtext,true) == 0)
{ 
 SetPlayerCheckpoint(playerid,bla,bla,bla);
 Whatelse[playerid] = 1;
 SendClientMessage(playerid,COLOR_BLA,"GoGoGo XD!");
 return 1;
}

OnPlayerEnterCheckpoint(playerid)
{
  if(Whatelse[playerid] == 1)
  {
  DisablePlayerCheckpoint(playerid);
  }
  else
  {
  }
}
Yea you can. In your code it would only disable the checkpoint when it has been created via /mycommand. EDIT:Unless you use "Whatelse" in an other command as well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)