using less than once
#1

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.
Reply
#2

Quote:
Originally Posted by ToPhrESH
Посмотреть сообщение
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.
Huh, I think You want something like this:

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;
}
Reply
#3

thank you
Reply
#4

Indent your code *facepalm*
Reply
#5

Quote:
Originally Posted by TheInnocentOne
Посмотреть сообщение
Indent your code *facepalm*
What? Sorry but my english sucks.
Reply
#6

Ohh, I know. I found the mistake, thank you TheInnocentOne.
Changed the bad code in my first post.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)