Respawn in dms
#1

Well im trygint to find a code that when a player etc...go to /shipwar dm
after killed then respawn in the dm
is there a code of it or something else?
Reply
#2

pawn Код:
new Float:RandomShipwarSpawn[][] =
{
   {XX,YY,ZZ},
   {XX,YY,ZZ},
   {XX,YY,ZZ},
   {XX,YY,ZZ}
};
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid,"ShipwarSpawn"))
{
    new Random = random(sizeof(RandomShipwarSpawn));
    SetPlayerPos(playerid,RandomShipwarSpawn[Random][0], RandomShipwarSpawn[Random][1], RandomShipwarSpawn[Random][2]);
    SetPlayerFacingAngle(playerid, RandomShipwarSpawn[Random][3]);
}
pawn Код:
CMD:shipwar(playerid, params[])
{
  //Your postion and other stuffs..
  new Random = random(sizeof(RandomShipwarSpawn));
  SetPlayerPos(playerid, RandomShipwarSpawn[Random][0], RandomShipwarSpawn[Random][1],RandomShipwarSpawn[Random][2]);
  SetPlayerFacingAngle(playerid, RandomShipwarSpawn[Random][3]);
  return 1;
}
Reply
#3

yes it can eaisly be done

pawn Код:
//------ On top of script
new SHIP_WAR[MAX_PLAYERS];

public OnPlayerConnect(playerid) //------ Onplayerconnect call back when player join you server
{
    SHIP_WAR[playerid] = 0; //-------- setting a player varible to 0
    //------ your other code goes here
    return 1;
}

public OnPlayerSpawn(playerid) //------ Onplayerspawn call back when player spawn. after death and after connecting server
{
    if(SHIP_WAR[playerid] == 1) //-------- checking if player variable is to 1 mean if he joined the ship war
    {
        //-------- you dm code here same code that you post in command
    }
    return 1;
}

CMD:shipwar(playerid, params[])
{
    SHIP_WAR[playerid] = 1;
    //------------ your other code goes here
    return 1;
}
Reply
#4

Can someone connect me with the Teamviewer?
Reply
#5

Can someone tell me exactly the code?
my tp cmd its:
pawn Код:
SetPlayerPos(playerid, -2455.4314,1543.6951,23.1481);
Reply
#6

Quote:
Originally Posted by Pro_Drifter
Посмотреть сообщение
Can someone tell me exactly the code?
my tp cmd its:
pawn Код:
SetPlayerPos(playerid, -2455.4314,1543.6951,23.1481);
pawn Код:
new Float:RandomShipwarSpawn[][] =
{
   {-2455.4314,1543.6951,23.1481}
};
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid,"ShipwarSpawn"))
{
    new Random = random(sizeof(RandomShipwarSpawn));
    SetPlayerPos(playerid,RandomShipwarSpawn[Random][0], RandomShipwarSpawn[Random][1], RandomShipwarSpawn[Random][2]);
    SetPlayerFacingAngle(playerid, RandomShipwarSpawn[Random][3]);
}
pawn Код:
CMD:shipwar(playerid, params[])
{
  new Random = random(sizeof(RandomShipwarSpawn));
  SetPlayerPos(playerid, RandomShipwarSpawn[Random][0], RandomShipwarSpawn[Random][1],RandomShipwarSpawn[Random][2]);
  SetPlayerFacingAngle(playerid, RandomShipwarSpawn[Random][3]);
  return 1;
}
Oh my bad. also add the facing angle. {XX.YY.ZZ.ANGLE}
Reply
#7

but when im making the cmd like:
pawn Код:
CMD:shipwar(playerid, params[])
{
  new Random = random(sizeof(RandomShipwarSpawn));
  SetPlayerPos(playerid, RandomShipwarSpawn[Random][0], RandomShipwarSpawn[Random][1],RandomShipwarSpawn[Random][2]);
  SetPlayerFacingAngle(playerid, RandomShipwarSpawn[Random][3]);
  return 1;
}
its not working...All my tp cmds its like:
pawn Код:
if (strcmp("/shipwar", cmdtext, true, 10) == 0)
    {
    new string[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string,sizeof(string),"*** %s Teleported to [DM]Shipwar", playername);
    SendClientMessageToAll(0x80FF0099, string);
    GivePlayerWeapon(playerid,27, 100);
    GivePlayerWeapon(playerid,28, 100);
    SetPlayerPos(playerid, -2455.4314,1543.6951,23.1481);
    SendClientMessage(playerid, COLOR_GREEN,"Welcome To Shipwar");
    SetPlayerInterior(playerid,0);
    return 1;
    }
can i make the tp cmd like mine?
Reply
#8

.V CAN U COME WITH TEAMVIEWER PLEASE?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)