SA-MP Forums Archive
Help with the cmd of dm - 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: Help with the cmd of dm (/showthread.php?tid=164311)



Help with the cmd of dm - waim - 30.07.2010

Hello Guys ... I made a command (/dm) to join deathmatch

and i want the players when they'll type this cmd and they are already in it .. they will see :

SendClientMessage(playerid, COLOR_RED,"[DM]: You are already in the dm..");


Re: Help with the cmd of dm - Dolph - 30.07.2010

new NotAllow[MAX_PLAYERS]; at the top

and under ur dm command u write: NotAllow[playerid] = 1;

and on the text: if(NotAllow[playerid] == 1) SendClientMessage(and all the stuff here)


writing on htc, so dunno if it is right.


Re: Help with the cmd of dm - waim - 30.07.2010

ee100 // Doesn't works sir ... it still teleport to the dm


Re: Help with the cmd of dm - Steven82 - 30.07.2010

No what he means is, when the player first does /dm, and they tele there, do NotAllow[playerid]== 1; So then make a
Код:
if(strcmp(blah,blah)
(
// Your codeing here
);
else
(
if(NotAllow == 1);
(
SendClientMessage(RED,"[DM]Your already at DM");
);
Now, sorry but i kinda have assed it, so if you need a bit more explaining, ask someone else. PS: I more than kinda halfassed it, i made it simple lol sorry


Re: Help with the cmd of dm - waim - 31.07.2010

Steven82 // I made it and i got some errors


Re: Help with the cmd of dm - waim - 31.07.2010

********** UP ***********


Re: Help with the cmd of dm - Niixie - 31.07.2010

Do

pawn Код:
if(IsPlayerInDM[playerid] == 1) {
     SendClientMessage(playerid, 0xFF00AAFF, "SERVER: You are already in DM!");
     return 0;
} else {
     // Your code
}
ofc you need to
pawn Код:
new IsPlayerInDM[MAX_PLAYERS];



Re: Help with the cmd of dm - waim - 31.07.2010

and I'll post IsPlayerInDM[playerid] = 1 under the code, isn't it ?


Re: Help with the cmd of dm - Cameltoe - 31.07.2010

new IsPlayerInDM[MAX_PLAYERS]; should go somewhere under your includes.


Re: Help with the cmd of dm - Vince - 31.07.2010

Start using PVars. They're meant to be used for things like this.

In your command put this at the top:

pawn Код:
if(GetPVarInt(playerid, "IsInDM") == 1)
    return SendClientMessage(playerid, COLOR_RED, "You are already in the DM!");

SetPVarInt(playerid, "IsInDM", 1);
// rest of your code (SetPlayerPos etc)
and whenever the player exits the DM put

pawn Код:
SetPVarInt(playerid, "IsInDM", 0);
// OR
DeletePVar(playerid, "IsInDM");