12.07.2010, 23:24
(
Последний раз редактировалось Nonameman; 13.07.2010 в 12:14.
)
Quote:
i have a pickup to where it is special action. If you get the pickup it creates a diaglog and ask you to be invisible. I want to know how do i make it to where him and his team can use it only once every 3 minutes if they own this territory.
|
pawn Код:
new InvisiblePickup;
public OnGameModeInit()
{
MakePickup();
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == InvisiblePickup)
{
if(GetPlayerTeam(playerid) != TERRITORY_OWNER_TEAM) return SendClientMessage(playerid, color, "You cannot use this pickup!");
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MEGBOX, "Want To Be Invisible?", "", "Yes", "No");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if((dialogid == 0) && (response))
{
//Change the vitrualworld or something like that
DestroyPickup(InvisiblePickup);
SetTimer("MakePickup", 3*60*1000, false);
SetTimerEx("MakePlayerVisible", 60*1000, false, "d", playerid);//Also added a timer to make the player visible after a time
}
return 1;
}
forward MakePickup();
public MakePickup()
{
InvisiblePickup = CreatePickup(model, type, x, y, z, -1);
return 1;
}
forward MakePlayerVisible(playerid);
public MakePlayerVisible(playerid)
{
//Change back the Virtual World?
return 1;
}