Author Topic: Please HELP me in !DM script  (Read 7628 times)

0 Members and 1 Guest are viewing this topic.

Offline USA.Ghost

  • Street Thug
  • *
  • Posts: 42
  • Pawn Scripter, IT Professional
    • View Profile
    • NE Clan Official forum
Re: Please HELP me in !DM script
« Reply #15 on: February 20, 2013, 12:50:19 pm »
HY,
        i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!

Code: [Select]
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
            SetPlayerWep(playerid, 20, 9999 };
            SetPlayerHealth{playerid,100.0 };
    SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
    format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
    SendClientMessageToAll( RED, szMsg );
           
return 1;

  }

Here: put this on your OnGameModeInit
[pawn]public OnGameModeInit()
{
new Acent;
Acent < 92;
new PlayerDM[Acent];
return 1;
}[/pawn]

Put this on OnPlayerConnect
[pawn]public OnPlayerConnect(playerid)
{
PlayerDM[playerid] = 0;
}[/pawn]

Put this on OnPlayerText(playerid, cmdtext)
[pawn]public OnPlayerText(playerid, cmdtext)
{
new cmd, idx;
cmd = strtok(cmdtext, idx);
if ( strcmp( cmd, "!DM", true ) == 0 )
   {
            SetPlayerWep(playerid, 20, 9999 };
            SetPlayerHealth{playerid,100.0 };
       SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
       format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
       SendClientMessageToAll( RED, szMsg );
      return 1;

  }
else if ( strcmp( cmd, "!leave", true) == 0)
{
if (PlayerDM[playerid] = 0) SendClientMessage(playerid, COLOR_RED, "[Anti-Abuse] You can not leave without being in a DM");
else
{
PlayerDM[playerid] = 0;
SetPlayerPos(playerid, X,Y,Z, 0, 0);//REPLACE X Y Z WITH YOUR PLACE TO EXIT DM
}
return 1;
}
[/pawn]

Put this on OnPlayerSpawn
[pawn]public OnPlayerSpawn(playerid, teamid)
{
if (PlayerDM[playerid] = 1) SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
return 1;
}
}[/pawn]


Any errors or something missing? tell me and i will fix it
« Last Edit: February 20, 2013, 07:48:35 pm by USA.Ghost »



Click the Click Here button on top to earn free cash by completing offers, surveys, refer others and much more

Click here to join my clan

Offline USA.Ghost

  • Street Thug
  • *
  • Posts: 42
  • Pawn Scripter, IT Professional
    • View Profile
    • NE Clan Official forum
Re: Please HELP me in !DM script
« Reply #16 on: February 20, 2013, 07:49:11 pm »
HY,
        i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!

Code: [Select]
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
            SetPlayerWep(playerid, 20, 9999 };
            SetPlayerHealth{playerid,100.0 };
    SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
    format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
    SendClientMessageToAll( RED, szMsg );
           
return 1;

  }

Here: put this on your OnGameModeInit
[pawn]public OnGameModeInit()
{
new Acent;
Acent < 92;
new PlayerDM[Acent];
return 1;
}[/pawn]

Put this on OnPlayerConnect
[pawn]public OnPlayerConnect(playerid)
{
PlayerDM[playerid] = 0;
}[/pawn]

Put this on OnPlayerText(playerid, cmdtext)
[pawn]public OnPlayerText(playerid, cmdtext)
{
new cmd, idx;
cmd = strtok(cmdtext, idx);
if ( strcmp( cmd, "!DM", true ) == 0 )
   {
            SetPlayerWep(playerid, 20, 9999 };
            SetPlayerHealth{playerid,100.0 };
PlayerDM[playerid] = 1;
new szMsg[172];
       SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
       format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
       SendClientMessageToAll( RED, szMsg );
      return 1;

  }
else if ( strcmp( cmd, "!leave", true) == 0)
{
if (PlayerDM[playerid] = 0) SendClientMessage(playerid, COLOR_RED, "[Anti-Abuse] You can not leave without being in a DM");
else
{
PlayerDM[playerid] = 0;
SetPlayerPos(playerid, X,Y,Z, 0, 0);//REPLACE X Y Z WITH YOUR PLACE TO EXIT DM
}
return 1;
}
[/pawn]

Put this on OnPlayerSpawn
[pawn]public OnPlayerSpawn(playerid, teamid)
{
if (PlayerDM[playerid] = 1) SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
return 1;
}
}[/pawn]


Any errors or something missing? tell me and i will fix it
« Last Edit: February 21, 2013, 01:05:01 pm by USA.Ghost »



Click the Click Here button on top to earn free cash by completing offers, surveys, refer others and much more

Click here to join my clan

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Please HELP me in !DM script
« Reply #17 on: February 20, 2013, 09:40:16 pm »
HY,
        i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!

Code: [Select]
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
            SetPlayerWep(playerid, 20, 9999 };
            SetPlayerHealth{playerid,100.0 };
    SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
    format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
    SendClientMessageToAll( RED, szMsg );
           
return 1;

  }

Here: put this on your OnGameModeInit
[pawn]public OnGameModeInit()
{
new Acent;
Acent < 92;
new PlayerDM[Acent];
return 1;
}[/pawn]

Put this on OnPlayerConnect
[pawn]public OnPlayerConnect(playerid)
{
PlayerDM[playerid] = 0;
}[/pawn]

Put this on OnPlayerText(playerid, cmdtext)
[pawn]public OnPlayerText(playerid, cmdtext)
{
new cmd, idx;
cmd = strtok(cmdtext, idx);
if ( strcmp( cmd, "!DM", true ) == 0 )
   {
            SetPlayerWep(playerid, 20, 9999 };
            SetPlayerHealth{playerid,100.0 };
       SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
       format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
       SendClientMessageToAll( RED, szMsg );
      return 1;

  }
else if ( strcmp( cmd, "!leave", true) == 0)
{
if (PlayerDM[playerid] = 0) SendClientMessage(playerid, COLOR_RED, "[Anti-Abuse] You can not leave without being in a DM");
else
{
PlayerDM[playerid] = 0;
SetPlayerPos(playerid, X,Y,Z, 0, 0);//REPLACE X Y Z WITH YOUR PLACE TO EXIT DM
}
return 1;
}
[/pawn]

Put this on OnPlayerSpawn
[pawn]public OnPlayerSpawn(playerid, teamid)
{
if (PlayerDM[playerid] = 1) SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
return 1;
}
}[/pawn]


Any errors or something missing? tell me and i will fix it

U missed too many lines... For example, [pawn]new szMsg[256 or your number];[/pawn]
Your code includes a lot of bugs and It's hard. Make simple codes, don't use symbols u see first times.


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline USA.Ghost

  • Street Thug
  • *
  • Posts: 42
  • Pawn Scripter, IT Professional
    • View Profile
    • NE Clan Official forum
Re: Please HELP me in !DM script
« Reply #18 on: February 26, 2013, 04:07:43 pm »
U missed too many lines... For example, [pawn]new szMsg[256 or your number];[/pawn]
Your code includes a lot of bugs and It's hard. Make simple codes, don't use symbols u see first times.
FIXED



Click the Click Here button on top to earn free cash by completing offers, surveys, refer others and much more

Click here to join my clan