Hello There, Guest! Login or Register


Need help with "PAWNO"
#9
Let me help you :P,
First, You must define your dcmd command, underneeth OnPlayerCommandText.
So it looks like this:
Code:
OnPlayerCommandText(playerid, cmdtext[]) {

dcmd(teleport,8,cmdtext);

return 0;
}
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:
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;
   }
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  :P

Grtz Dimplex
Reply


Messages In This Thread
Need help with "PAWNO" - by blahc - 05-04-2008, 09:06 PM
Re: Need help with "PAWNO" - by AzTeC - 05-05-2008, 08:24 AM
Re: Need help with "PAWNO" - by Jay - 05-05-2008, 11:28 AM
Re: Need help with "PAWNO" - by blahc - 05-05-2008, 05:35 PM
Re: Need help with "PAWNO" - by blahc - 05-05-2008, 07:39 PM
Re: Need help with "PAWNO" - by Dimplex - 05-05-2008, 07:46 PM
Re: Need help with "PAWNO" - by blahc - 05-05-2008, 08:29 PM
Re: Need help with "PAWNO" - by Jay - 05-06-2008, 12:35 AM
Re: Need help with "PAWNO" - by Dimplex - 05-06-2008, 09:00 AM
Re: Need help with "PAWNO" - by blahc - 05-06-2008, 05:09 PM
Re: Need help with "PAWNO" - by FarePak - 05-06-2008, 08:02 PM
Re: Need help with "PAWNO" - by blahc - 05-07-2008, 06:38 AM