29.04.2014, 01:48
Hmm. I wanted it so if a house row owned by a player is deleted in the database and the player has the house id (PlayerInfo[playerid][pHouse]) in their variable, it lets them know via message.
I added this into where my players log in and it doesn't send the message when I buy a house and delete the row:
I use Player(playerid) to set the owner of the house
Thanks
I added this into where my players log in and it doesn't send the message when I buy a house and delete the row:
pawn Код:
new id = PlayerInfo[playerid][pHouse];
if(PlayerInfo[playerid][pHouse] >= 0)
{
if(strcmp(Player(playerid), HouseInfo[id][hOwner], false) == 0)
{
SendClientMessage(playerid, COLOR_ORANGE, "You have been removed as ownership from your house.");
}
}
pawn Код:
stock Player(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
![Smiley](images/smilies/smile.png)