Select House Spawn (Dailog)
#2

Basic example

login
pawn Код:
for(new houseid = 0; houseid != MAX_HOUSES_IN_GAME; houseid++)
    if(HouseInfo[houseid][Ownerid] == PlayerInfo[playerid][accountID])
        format(str,sizeof(str),"%sYour houseID: %d\n",str,houseid);

if(str[0] != '\0')
{
    str[ strlen(str) - 2] = '\0';
    ShowPlayerDialog(DIALOG_CHOOSE_SPAWN, str);
}
else
{
    // not owning anyone
}
pawn Код:
if(dialogid == DIALOG_CHOOSE_SPAWN)
{
    if(response)
    {
        new pos = strfind(inputtext,":",true);
        if(pos != -1)
        {
            PlayerHouseSpawnID[playerid] = strval(inputtext[pos + 2]);
        }
    }
    return 1;
}
OnPlayerConnect
pawn Код:
PlayerHouseSpawnID[playerid] = -1;
OnPlayerSpawn

pawn Код:
if(PlayerHouseSpawnID[playerid] != -1)
{
    new ID = PlayerHouseSpawnID[playerid];
    // interior
    // virtualworld
    SetPlayerPos(playerid,HouseInfo[ID][hX],HouseInfo[ID][hY],HouseInfo[ID][hZ]);
    return 1;
}
Reply


Messages In This Thread
Select House Spawn (Dailog) - by yoran765 - 10.05.2014, 17:36
Re: Select House Spawn (Dailog) - by Jefff - 10.05.2014, 19:29
Re: Select House Spawn (Dailog) - by yoran765 - 10.05.2014, 20:02
Re: Select House Spawn (Dailog) - by Jefff - 10.05.2014, 20:18
Re: Select House Spawn (Dailog) - by yoran765 - 10.05.2014, 20:24
Re: Select House Spawn (Dailog) - by Jefff - 11.05.2014, 00:26

Forum Jump:


Users browsing this thread: 1 Guest(s)