SA-MP Forums Archive
using less than once - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: using less than once (/showthread.php?tid=159298)



using less than once - ToPhrESH - 12.07.2010

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.


Re: using less than once - Nonameman - 12.07.2010

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;
}



Re: using less than once - ToPhrESH - 12.07.2010

thank you


Re: using less than once - TheInnocentOne - 13.07.2010

Indent your code *facepalm*


Re: using less than once - Nonameman - 13.07.2010

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


Re: using less than once - Nonameman - 13.07.2010

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