01.05.2009, 15:00
I want to set a checkpoint if the types the command ..
but I don't know how...
but I don't know how...
dcmd_mycommand( playerid, text[] )
{
SetPlayerCheckpoint(playerid, x, y, z );
#pragma unused text
return 1;
}
|
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; } |
dcmd_mycommand( playerid, afei[] )
*happy*
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
|
Originally Posted by afei™
You dont have to add such a function. There's already one.
Код:
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
|
new
cmd[128];
if(!strcmp(cmd,"/checkpoint",true))
{
SetPlayerCheckpoint(playerid,x,y,z);
SendClientMessage(playerid,color,"Checkpoint created.");
return 1;
}
|
Originally Posted by MenaceX^
Quote:
pawn Код:
|
|
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;
}
|
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
{
}
}
|
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
{
}
}
|