05.07.2011, 18:42
So im making a Free Roam and i want to type /dm And It will bring me to a Deathmatch Area(area 51). But I Want it to Teleport Me To More Than just one Teleport Place While type /dm.
Any Help?
Any Help?
new Float:gRandomSpawns [MAX_SPAWNS] [4] = {
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
....
{x,y,z},
{x,y,z}
};
for(new i;i<MAX_PLAYERS;i++)
SetPlayerPos(playerid,gRandomSpawns [i] [1],gRandomSpawns [i] [2],gRandomSpawns [i] [3]}
pawn Код:
|
new Float:gRandomSpawns [MAX_SPAWNS] [4] = {
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z},
....
{x,y,z},
{x,y,z}
};
SetPlayerPos(playerid,gRandomSpawns [random(sizeof(Float:gRandomSpawns ))] [0],gRandomSpawns random(sizeof(Float:gRandomSpawns ))] [1],gRandomSpawns [random(sizeof(Float:gRandomSpawns ))] [2]}
new Float:RandomSpawn[][4] = { {283.3869, 1805.9667, 17.6406}, {217.2084, 1852.7458, 12.7484}, {248.5981, 1858.0115, 14.0840} }; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/dm", cmdtext, true, 10) == 0) { new rand = random(sizeof(RandomSpawn)); SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]); GivePlayerWeapon(playerid, 31, 99999); GivePlayerWeapon(playerid, 26, 99999); GivePlayerWeapon(playerid, 34, 99999); SetTimer("time", 900, 1); new name[MAX_PLAYER_NAME], string[44]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s has joined the DM!",name); SendClientMessageToAll(0xFFFF00AA, string); GameTextForPlayer(playerid, "~y~Welcome to the ~r~DM ~y~zone! Type: /leavedm to leave the DM!", 3000, 3); return 1; } if (strcmp(cmdtext, "/leavedm", true) == 0) { { new name[MAX_PLAYER_NAME], string[44]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s has Left the DM!",name); SendClientMessageToAll(0xFFFF00AA, string); SetPlayerPos(playerid,2799.8398,-2547.7798,13.6282); } return 1;
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid,name,sizeof(name));
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME] = GetPlayerName(playerid,name,sizeof(name));
return 1;
}