02.10.2014, 07:59
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for(new i = 1; i <= HousesCreated; i++)
{
if(pickupid == HouseInfo[i][HouseExitPickup])
{
KickFromHouse(playerid, i);
}
else if(pickupid == HouseInfo[i][HouseEnterPickup])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(pInfo[playerid][JustLeft] == 1) return 0;
if(HouseInfo[i][hOwned] == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "» Use /buyhouse to buy this house!");
return 1;
}
else if(HouseInfo[i][hOwned] == 1)
{
if(HouseInfo[i][hLocked] == 1)
{
if(strcmp(name, HouseInfo[i][hOwner]) != 0)
{
if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid, COL_RED, "ERROR: "CYELLOW"This house is currently locked!");
}
}
SetPlayerHousePos(playerid, i);
SetPlayerVirtualWorld(playerid, HouseInfo[i][hWorld]);
pInfo[playerid][InHouseID] = i;
break;
}
else continue;
}
}
if(pickupid == VH)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health == 100) return 0;
PlaySound(playerid,1138);
SetPlayerHealth(playerid,100);
}
else if(pickupid == GH)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health == 100) return 0;
PlaySound(playerid,1138);
SetPlayerHealth(playerid,100);
}
else if(pickupid == BH)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health == 100) return 0;
PlaySound(playerid,1138);
SetPlayerHealth(playerid,100);
}
else if(pickupid == VK)
{
GivePlayerWeapon(playerid,8,1);
PlaySound(playerid,1150);
}
else if(pickupid == GG)
{
GivePlayerWeapon(playerid,16,10);
PlaySound(playerid,1150);
}
else if(pickupid == BSM)
{
GivePlayerWeapon(playerid,18,10);
PlaySound(playerid,1150);
}
return 1;
}