pawn Код:
#include <a_samp>
#define COLOR_LIGHTBLUE 0x33CCFF19
#include <zcmd>
new String[256];
new InDM[MAX_PLAYERS];
new Float:DMSpawns[][4] =
{
{247.5956,1458.5726,43.0946,185.8330},
{199.6086,1394.2821,43.0946,350.1746},
{247.5956,1458.5726,43.0946,185.8330},
{167.4688,1426.9861,26.2922,244.9503},
{186.0784,1456.1190,60.1355,184.6759},
{246.0688,1410.4255,23.3703,94.1182},
{287.6833,1411.3716,10.3918,82.7555}
};
public OnPlayerConnect(playerid)
{
InDM[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(InDM[playerid] == 1)
{
//set the players position to the DM
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
InDM[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(InDM[playerid] == 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 10);
new rand = random(sizeof(DMSpawns));
SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);
SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
GivePlayerWeapon(playerid, 35, 1500); // RPG
GivePlayerWeapon(playerid, 36, 1500); // HS Rocket
}
return 1;
}
CMD:rocket(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(InDM[playerid] == 0)
{
InDM[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE , "You have joined /rocket, to leave type /rocket again");
format(String, sizeof(String), "Server:{FFFFFF}%s(%d) has joined RocketDM(/rocket)", PlayerName, playerid);
SendClientMessageToAll(COLOR_LIGHTBLUE, String);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 10);
new rand = random(sizeof(DMSpawns));
SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);position at DM
SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
GivePlayerWeapon(playerid, 35, 1500); // RPG
GivePlayerWeapon(playerid, 36, 1500); // HS Rocket
}
else
{
InDM[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have left /rocket to join again type /rocket");
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 50);
ResetPlayerWeapons(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
}
return 1;
}