Is it Possible? - 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)
+--- Thread: Is it Possible? (
/showthread.php?tid=348369)
Is it Possible? -
CrazyChoco - 05.06.2012
Hai there, i am scripting/mapping a Hotel and i added a money box which will have a lot of money, but is it possible to add a password system like you go to the checkpoint then you shall type the correct password or if you type wrong he will be killed.
Re: Is it Possible? -
Firo - 05.06.2012
Yes.
Take it as basic , and change to whatever you need.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new string[256];
switch(getCheckpointType(playerid))
{
case CP_HOSPITALin:
{
if(GetPlayerVirtualWorld(playerid) == 1) { // LS MARKET
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1177.1379,-1325.4160,14.0559);
SendClientMessage(playerid,COLOR_YELLOW,"You have exited All Saints General Hospital.");
SetPlayerFacingAngle(playerid,271.3165);
SetPlayerVirtualWorld(playerid,0);
Of course return the public, and start to work on dialog to password and add else if the player wrong Kill him.
Now
pawn Код:
if(strcmp(cmdtext, "/moneybox", true)==0)
{
if(IsPlayerInCheckpoint(playerid))
{
else
{
SendClientMessage(playerid, red, "Error: You need to be in at the checkpoint to use the moneybox!");
}
}
else
{
SendClientMessage(playerid, red, "Error: You are not in the checkpoint!");
}
return 1;
}
Add dialog, a else if player missing blabla.
Re: Is it Possible? -
CrazyChoco - 05.06.2012
Thanks