Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: JaVeD on February 10, 2013, 12:49:04 pm

Title: Please HELP me in !DM script
Post by: JaVeD on February 10, 2013, 12:49:04 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;

  }
Title: Re: Please HELP me in !DM script
Post by: NeskWriter on February 10, 2013, 01:06:17 pm
JaVeD, make a new variable ( for example, playerisondm[MAX_PLAYERS];) and set it's value to 1 when player types "!DM"
then, in public OnPlayerSpawn
[pawn]
if(playerisonDM[playerid]==1)
{
            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 );
}
[/pawn]
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 10, 2013, 02:04:50 pm
Not Working :( Please can u give me this command ?
Title: Re: Please HELP me in !DM script
Post by: mrockxkingbutt on February 10, 2013, 03:09:30 pm
new DM[MAX_PLAYERS];

then
[pawn]      else if ( strcmp( cmd, "!DM", true ) == 0 )
   {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else
      {
       SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
         SendClientMessageToAll( COLOR_GREEN, "Started The DM Fight" );
         RemovePlayerMarker( playerid );
         DM[playerid] = 1;
      }
      return 1;
   }[/pawn]
you can edit this
put this in onplayerspawn
[pawn]      if(DM[playerid] == 1) {

        SendClientMessage(playerid,0xAA3333AA,"You Have Entered Into DM");
        SetPlayerHealth( playerid, 100.100 );
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
}[/pawn]
put in onplayerdeath
[pawn]DM[playerid] = 0;[/pawn]
leave cmd
[pawn]         else if ( strcmp( cmd, "!leave", true ) == 0 )
   {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else
      {
         SendClientMessageToAll( COLOR_GREEN, "DM end" );
         RemovePlayerMarker( playerid );
   DM[playerid] = 0;
      }
      return 1;
   }[/pawn]

Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 10, 2013, 03:38:17 pm
THNXXX MAN ITS WORKED ROCKING MAN !!!!! 8)

Title: Re: Please HELP me in !DM script
Post by: mrockxkingbutt on February 10, 2013, 03:42:50 pm
My Pleasure And Need More Help? ask here
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 10, 2013, 05:39:10 pm
Man its bugged OnPlayerDeath >>  DM[playerid] = 0; then player spawn at road without typing !leave and DM[playerid] = 1; then player spawn at dm if we type or don't type !leave!

Can you fix this bug ?
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 10, 2013, 05:46:07 pm
LOL I Spawn in dm when i die hahaha without entering !DM lol man please fix this bug
Title: Re: Please HELP me in !DM script
Post by: NeskWriter on February 10, 2013, 07:10:35 pm
Oh ok so lemme give u dat:
in the beginning of your gm:
[pawn]new Float:xbefore, Float:ybefore, Float:zbefore;
new playerisondm[MAX_PLAYERS];[/pawn]

then

[pawn]public OnPlayerDisconnect(playerid, reason)
{
   playerisondm[playerid]=0;
   return 0;
}[/pawn]

then

[pawn]public OnPlayerSpawn(playerid, classid)
{
   if(playerisondm[playerid])
   {
        SetPlayerPos(playerid, 112.35513, -1150.53576, 31.30939, 0, 0);
   }
   return 1;
}[/pawn]

and then

[pawn]public OnPlayerText(playerid, text[])
{
   if(strcmp(text, "!dm", true)==0)
   {
      GetPlayerPos(playerid, xbefore, ybefore, zbefore);
      playerisondm[playerid]=1;
      SetPlayerPos(playerid, 112.35513, -1150.53576, 31.30939, 0, 0);
      SendClientMessage(playerid, 0xFF0000AA, "You have joined DM!");
   }
   else if(strcmp(text, "!leavedm", true)==0)
   {
       if(playerisondm[playerid])
       {
          playerisondm[playerid]=1;
          SetPlayerPos(playerid, xbefore, ybefore, zbefore, 0, 0);
          playerisondm[playerid]=0;
          SendClientMessage(playerid, 0xFF0000AA, "You have left the DM!");
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not on DM!");
      }
      return 1;
   }
   return 1;
}[/pawn]
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 11, 2013, 06:14:43 am
NOT WORKING! There is too many errors in pawn man i am using GUPS but i modified the GUPS and changed the script but some of my function is GUPS function. Please change your !DM system to GUPS.
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 11, 2013, 08:38:07 am
WORKED!!! my friends thnxx alot command worked mrockxkingbutt's command worked we need to remove DM[playerid] =0; from OnplayerDeath :D thnx u all for helping me Thank you nestwriter.
Title: Re: Please HELP me in !DM script
Post by: NeskWriter on February 11, 2013, 08:48:45 am
WORKED!!! my friends thnxx alot command worked mrockxkingbutt's command worked we need to remove DM[playerid] =0; from OnplayerDeath :D thnx u all for helping me Thank you nestwriter.

my pleasure) Use DM[playerid]=0 in public OnPlayerDisconnect(playerid), but it's for servers with registrarion sys
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 11, 2013, 09:01:43 am
I have registration system in my server but it work without DM[playerid] =0; :D
Title: Re: Please HELP me in !DM script
Post by: sseebbyy on February 11, 2013, 04:03:27 pm
NOT WORKING! There is too many errors in pawn man i am using GUPS but i modified the GUPS and changed the script but some of my function is GUPS function. Please change your !DM system to GUPS.
IS THIS SCRIPT WORKING FOR YOU ?
WORKED!!! my friends thnxx alot command worked mrockxkingbutt's command worked we need to remove DM[playerid] =0; from OnplayerDeath :D thnx u all for helping me Thank you nestwriter.

Don't make triple post next time ok ? Use <EDIT> button ;)
Title: Re: Please HELP me in !DM script
Post by: JaVeD on February 11, 2013, 05:43:59 pm
SORRY sseebbyy i am new in forum i use edit next time :D
Title: Re: Please HELP me in !DM script
Post by: USA.Ghost 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
Title: Re: Please HELP me in !DM script
Post by: USA.Ghost 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
Title: Re: Please HELP me in !DM script
Post by: NeskWriter 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.
Title: Re: Please HELP me in !DM script
Post by: USA.Ghost 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