05-06-2008, 09:00 AM
Let me help you
,
First, You must define your dcmd command, underneeth OnPlayerCommandText.
So it looks like this:
Okay, let me explain the Dcmd thing.
First, you typ the name of the command that you want to use, in this case teleport
dcmd(teleport,8,cmdtext);
Then the system must knows how many charackters the are in the command, in teleport is that 8
dcmd(teleport,8,cmdtext);
and after that you type cmdtext, to let know that it is a cmd(not for sure!!).
dcmd(teleport,8,cmdtext);
Okay you have made your define.
You dont put you dcmd command into the OnPlayerCommandText thing, it will give errors.
But past it underneeth it, like this:
Now you have a working dcmd command.
Good luck whit it
If there is anything wrong in this post, post it please.
It is also new for me
Grtz Dimplex
,First, You must define your dcmd command, underneeth OnPlayerCommandText.
So it looks like this:
Code:
OnPlayerCommandText(playerid, cmdtext[]) {
dcmd(teleport,8,cmdtext);
return 0;
}First, you typ the name of the command that you want to use, in this case teleport
dcmd(teleport,8,cmdtext);
Then the system must knows how many charackters the are in the command, in teleport is that 8
dcmd(teleport,8,cmdtext);
and after that you type cmdtext, to let know that it is a cmd(not for sure!!).
dcmd(teleport,8,cmdtext);
Okay you have made your define.
You dont put you dcmd command into the OnPlayerCommandText thing, it will give errors.
But past it underneeth it, like this:
Code:
OnPlayerCommandText(playerid, cmdtext[]) {
dcmd(teleport,8,cmdtext);
return 0;
}
dcmd_teleport(playerid,params[])
{
new endid;
if(sscanf(params, "d",endid)) return SendClientMessage(playerid,white,"Correct Usage: /teleport <playerid>");
if(!IsPlayerConnected(endid)) return SendClientMessage(playerid,COLOR_RED,"Invalid player id.");
if(playerid == endid) return SendClientMessage(playerid,red,"You can't teleport to yourself!");
new Float:Pos[3];
GetPlayerPos(endid,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(playerid,Pos[0]+1,Pos[1],Pos[2]);
SetPlayerInterior(playerid,(GetPlayerInterior(endid)));
return 1;
}Good luck whit it

If there is anything wrong in this post, post it please.
It is also new for me

Grtz Dimplex