03.04.2009, 20:13
pawn Код:
if ((strcmp("/dm1", cmdtext, true, 10) == 0)&&(IsPlayerInDM[playerid] == 0))
{
new pName[MAX_PLAYER_NAME];
new string[256];
IsPlayerInDM[playerid] = 1;
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s has entered dm1. Type /dm1 to pwn him", pName);
SendClientMessageToAll(0xFFFFAEFF, string);
const MAX_POSITIONS = 3;
static Float:Positions[MAX_POSITIONS][4] =
{
{0.0, 0.0, 0.0, 0.0}, // pos 1
{0.0, 0.0, 0.0, 0.0}, // pos 2
{0.0, 0.0, 0.0, 0.0} // pos 3
}, bool:taken[MAX_POSITIONS];
new freePos;
for(; freePos < MAX_POSITIONS; freePos++)
if(!taken[freePos]) break;
if(freePos == MAX_POSITIONS) return 1; //no free positions left
SetPlayerPos(playerid, Positions[freePos][0], Positions[freePos][1], Positions[freePos][2]);
SetPlayerFacingAngle(playerid, Positions[freePos][3]);
taken[freePos] = true;