DM Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DM Command (
/showthread.php?tid=74062)
DM Command -
GeKo - 19.04.2009
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
Re: DM Command -
Rks25 - 19.04.2009
search for this one, i even answered such a question today. so searching should be easy.
Re: DM Command -
GeKo - 19.04.2009
Tell me .. make things but not so hard .. Thank you
Re: DM Command -
Rks25 - 19.04.2009
http://forum.sa-mp.com/index.php?topic=98747.0
Re: DM Command -
GeKo - 19.04.2009
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.
Re: DM Command -
Rks25 - 19.04.2009
iamatdm[playerid].
Re: DM Command -
Backwardsman97 - 19.04.2009
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;
}
Re: DM Command -
GeKo - 19.04.2009
Yes thank you but it does not work
Re: DM Command -
Rks25 - 19.04.2009
Does the kill command work?
Re: DM Command -
Backwardsman97 - 19.04.2009
My bad, wasn't paying attention when I wrote it. Check it now.