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!
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