DM Command
#1

Hi folks,
I've a question I would like to know how I do this now when I for example /dm do not then I can use more commands except /dmexit or /leavedm ..
And when you have to confirm the commands comes "You carn't use a command" ..
Please add the entire code


Enter DM
Код:
if(strcmp("/dm", cmdtext, true, 10) == 0)
{
SetPlayerInterior(playerid, 2);
SetPlayerPos(playerid, 2567.52, -1294.59, 1063.25);
return 1;
}
Leave DM
Код:
if(strcmp("/leavedm", cmdtext, true, 10) == 0)
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1523.8254,-1359.0087,330.0507);
return 1;
}
Would be nice if you could help me thank
Reply
#2

search for this one, i even answered such a question today. so searching should be easy.
Reply
#3

Tell me .. make things but not so hard .. Thank you
Reply
#4

http://forum.sa-mp.com/index.php?topic=98747.0
Reply
#5

It's not work

Код:
new iamatdm[MAX_PLAYERS];
Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(iamatdm == 0)
{
// My Commands Example
if(strcmp(cmdtext, "/kill") == 0) {
SetPlayerHealth(playerid, 0);
return 1;
}
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You Cant Use Commands In Dm Area!!");
}
return 0;
}
Under this
Код:
if(strcmp("/dmexit", cmdtext, true, 15) == 0)
{
if(iamatdm == 0)
{
SetPlayerPos(playerid, -1079.99, 1061.58, 1343.04);
}
return 1;
}
And this ar the Errors
Код:
C:\DOKUME~1\MARCEL~1.ARG\Desktop\SAMP02~1.WIN\GAMEMO~1\UBCFUN.pwn(498) : error 033: array must be indexed (variable "iamatdm")
C:\DOKUME~1\MARCEL~1.ARG\Desktop\SAMP02~1.WIN\GAMEMO~1\UBCFUN.pwn(667) : error 033: array must be indexed (variable "iamatdm")

2 Errors.
Reply
#6

iamatdm[playerid].
Reply
#7

Indent and index your arrays. :P
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
      // My Commands Example
   if(strcmp(cmdtext, "/kill",true) == 0)
   {
      if(iamatdm[playerid] == 0)
      {
         SetPlayerHealth(playerid, 0);
         return 1;
      }
      else
      {
         SendClientMessage(playerid,0xFF0000FF,"You Cant Use Commands In Dm Area!!");
         return 1;
      }
   }
   if(strcmp("/dmexit", cmdtext, true) == 0)
   {
      if(iamatdm == 0)
      {
         SetPlayerPos(playerid, -1079.99, 1061.58, 1343.04);
         return 1;
      }
      return 1;
   }
   return 0;
}
Reply
#8

Yes thank you but it does not work
Reply
#9

Does the kill command work?
Reply
#10

My bad, wasn't paying attention when I wrote it. Check it now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)