10.05.2014, 19:29
(
Последний раз редактировалось Jefff; 10.05.2014 в 20:13.
)
Basic example
login
OnPlayerConnect
OnPlayerSpawn
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;
}
pawn Код:
PlayerHouseSpawnID[playerid] = -1;
pawn Код:
if(PlayerHouseSpawnID[playerid] != -1)
{
new ID = PlayerHouseSpawnID[playerid];
// interior
// virtualworld
SetPlayerPos(playerid,HouseInfo[ID][hX],HouseInfo[ID][hY],HouseInfo[ID][hZ]);
return 1;
}