change spawn
#1

how can i change the spawn point when he select's in the dialog:
Los Santos
because now when i select Los Santos i go to a spawn place in los santos
but if i do /kill i go to the normal spawn point in san fierro
how can i change that if they select Los Santos and do /kill or become dead they go to the spawn point in LS?
this is the OnDialogResponse:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {

  if (dialogid == 1) {
    if (!response) {SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!"); return false;}
    new message[196];
    format(message, sizeof(message), "You are teleported to: %s", inputtext);
    SendClientMessage(playerid, 0xFFFFFFFF, message);
    if(PlayerInfo[playerid][pRank] == 0)
    {
        if (listitem == 0) {SetPlayerPos(playerid, -2721.1340,-317.2228,7.8438);} //san fiero
        else if (listitem == 1) {SetPlayerPos(playerid, 1753.1827,-1930.0162,13.5764);} //los santos
        }
        if(PlayerInfo[playerid][pRank] == 1)
        {
          if (listitem == 0) {SetPlayerPos(playerid, -1591.8439,716.2068,-5.2422);}
          else if (listitem == 1) {SetPlayerPos(playerid, 1525.8792,-1677.7924,5.8906);}
        }
        if(PlayerInfo[playerid][pRank] == 2)
    {
        if (listitem == 0) {SetPlayerPos(playerid, -1346.0887,492.5026,11.2027);} //san fiero
        else if (listitem == 1) {SetPlayerPos(playerid, 2746.1128,-2453.8596,13.8623);} //los santos
        }
    if(PlayerInfo[playerid][pHouseKey] != INVALID_HOUSE_ID)
        {
          new houseid = PlayerInfo[playerid][pHouseKey];
          if (listitem == 0) {SetPlayerPos(playerid, HouseInfo[houseid][hExitx], HouseInfo[houseid][hExity], HouseInfo[houseid][hExitz]);} //san fiero
          if (listitem == 1) {SetPlayerPos(playerid, HouseInfo[houseid][hExitx], HouseInfo[houseid][hExity], HouseInfo[houseid][hExitz]);} //san fiero
            SetPlayerInterior(playerid, HouseInfo[houseid][hInt]);
            SetPlayerVirtualWorld(playerid, HouseInfo[houseid][hWorld]);
            IsPlayerInHouse[playerid] = houseid;
            SetPlayerTeamColor(playerid);
        }

    return 1;
  }

  return 0;
}
Reply
#2

SetSpawnInfo(playerid, team, skin, Float, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
and SpawnPlayer(playerid);

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)