11.04.2015, 17:11
pawn Код:
new bool:pDMEvent[MAX_PLAYERS] = false,
Float:pLastPos[MAX_PLAYERS][3];
CMD:dm(playerid, params[])
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
for(new i = 0; i < 3; i ++) pLastPos[playerid][i] = pos[i];
pDMEvent[playerid] = true;
return 1;
}
CMD:leave(playerid, params[])
{
SetPlayerPos(playerid, pLastPos[0], pLastPos[1], pLastPo[2]);
for(new i = 0; i < 3; i ++) pLastPos[playerid][i] = 0.0;
pDMEvent[playerid] = false;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(pDMEvent[playerid])
{
SetPlayerPos(playerid, pLastPos[0], pLastPos[1], pLastPo[2]);
for(new i = 0; i < 3; i ++) pLastPos[playerid][i] = 0.0;
pDMEvent[playerid] = false;
}
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(pDMEvent[playerid])
{
if(strcmp("/leave", cmdtext))
{
SendClientMessage(playerid, -1, "You can't use command in a dm event, use /leave first.");
return 0;
}
}
return 1;
}

