27.07.2017, 18:31
So i added like 1 DM with random spawns in the game nicely , I still got some that are in one position with no random spawns how ever i wonder how can i add in the other one cuz im worried it will interfere wit the 69 DM Coordinates here it is
69 script:
Top Script
OnPlayerSpawn
/west with only one position
So if you understood i just want west to be added with random spawns in the same way 69 is added without interfering with its coordinates.
69 script:
Top Script
PHP код:
new Float:DMSpawns[][4] =
{
{-491.3325,3513.3535,10.1867,90.865},
{-563.2787,3512.9126,23.5641,267.8248},
{-593.4873,3506.6257,11.5412,277.3773},
{-611.4570,3523.1394,6.7774,258.9531},
{-552.4916,3495.9238,6.3913,91.2295}
};
PHP код:
if(InDM[playerid] == 1)// tell the script to respawn only the players that inside DM
{
SetPlayerInterior(playerid, 0); // We will set the interior to 0 (
SetPlayerVirtualWorld(playerid, 10); // and we will make the Virtual World in different world, so we wont mix with other players
new rand = random(sizeof(DMSpawns)); // DM Spawn
SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);//set the player position at DM
SetPlayerFacingAngle(playerid, DMSpawns[rand][3]); // Also facing Angle
GivePlayerWeapon(playerid,38,9999);
}
PHP код:
COMMAND:69(playerid, params)
{
new PlayerName[MAX_PLAYER_NAME];//Player name
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(InDM[playerid] == 0)//if the player is not in DM
{//then
InDM[playerid] = 1; // Now we will set him in DM so he will respawn at DM
SendClientMessage(playerid, COLOR_LIGHTBLUE , "You have joined /69, to leave type /69 again");//Message to tell him that he joined DM
format(String, sizeof(String), "Server:{FFFFFF}%s(%d) has joined (/69)", PlayerName, playerid);
SendClientMessageToAll(COLOR_LIGHTBLUE, String);//Message to tell everyone that he joined DM
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 0); // we will set he's interior to 0
SetPlayerVirtualWorld(playerid, 10); // and same here Virtual World to 10
new rand = random(sizeof(DMSpawns)); // DM Spawn
SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);// set the player position at DM
SetPlayerFacingAngle(playerid, DMSpawns[rand][3]); // Also facing Angle
GivePlayerWeapon(playerid,38,99999);
}
else {//if the player is already in DM, he will leave
InDM[playerid] = 0; //So now we will set him as not in DM
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have left /69 to join again type /69");//We will send him a message to tell him that he left
SpawnPlayer(playerid);//We will spawn the player now
SetPlayerHealth(playerid, 100);//set he's health to 100
ResetPlayerWeapons(playerid);// and reset he's weapons
SetPlayerVirtualWorld(playerid, 0);//we will set he's virtual world to 0
SetPlayerInterior(playerid, 0);//also interior to 0
}
return 1;
}
}
PHP код:
COMMAND:west(playerid, params)
{
SetPlayerPos(playerid,2245.5874,-8967.5977,11.3574);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to Old West Gunfights!");
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,200);
GivePlayerWeapon(playerid,33,200);
GivePlayerWeapon(playerid,4,0);
return 1;
}