SA-MP Forums Archive
Pickup, Just for admin - 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: Pickup, Just for admin (/showthread.php?tid=188434)

Pages: 1 2


Pickup, Just for admin - Larsey123IsMe - 07.11.2010

How to make a pickup that only admins can pickup?

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == HealthPickup) {
      SetPlayerHealth(playerid, 100);
      SendClientMessage(playerid,COLOR_ORANGERED,"You picked up Health!");
      }
    return 1;
    }



Re: Pickup, Just for admin - blackwave - 07.11.2010

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == HealthPickup) {
    if(IsPlayerAdmin(playerid)) {
      SetPlayerHealth(playerid, 100);
      SendClientMessage(playerid,COLOR_ORANGERED,"You picked up Health!");
      }
    else return SendClientMessage(playerid, COLOR_ORANGERED, "YOu're an admin");
     }
    return 1;
    }



Re: Pickup, Just for admin - Cameltoe - 07.11.2010

Here:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
     if( pickupid == HealthPickup && IsPlayerAdmin(playerid))
     {
          SetPlayerHealth(playerid, 100);
          SendClientMessage(playerid,COLOR_ORANGERED,"You picked up Health!");
     }
     return 1;
}
You could also add an streamer, and only stream the chosen pickups for admins only.


Re: Pickup, Just for admin - Larsey123IsMe - 07.11.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Here:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
     if( pickupid == HealthPickup && IsPlayerAdmin(playerid))
     {
          SetPlayerHealth(playerid, 100);
          SendClientMessage(playerid,COLOR_ORANGERED,"You picked up Health!");
     }
     return 1;
}
You could also add an streamer, and only stream the chosen pickups for admins only.
Thank you <3


Re: Pickup, Just for admin - WillyP - 07.11.2010

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
Thank you <3
I hope you're not gay.


Re: Pickup, Just for admin - blackwave - 07.11.2010

Quote:

Originally Posted by [FU]Victious
I hope you're not gay.

lols xD .


Re: Pickup, Just for admin - Larsey123IsMe - 07.11.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
I hope you're not gay.
LoL im not xD


Re: Pickup, Just for admin - playbox12 - 07.11.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
I hope you're not gay.
What would it matter if he's gay or not lol?


Re: Pickup, Just for admin - Larsey123IsMe - 07.11.2010

The scrip looks like this:

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
      }
    return 1;
 }
And it works, but i want it to say this "You cannot enter, Just for admins" when an non-admin try to enter.


Re: Pickup, Just for admin - WillyP - 07.11.2010

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
      else
      {
           GameTextForPlayer(playerid,"~r~YOU CANNOT ENTER.",4000,6);
     }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
      }
    return 1;
 }



Re: Pickup, Just for admin - Blatnoi - 07.11.2010

Quote:

And it works, but i want it to say this "You cannot enter, Just for admins" when an non-admin try to enter.

try this
Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
      else
	  {
	  SendClientMessage(playerid,COLOR_CRIMSON,"This house is for admins only ... (you are not admin!)");
	  }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
      }
	 
    return 1;
 }



Re: Pickup, Just for admin - gychem - 07.11.2010

Try this: ( i never tested it )
Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
   }
		return 1;
	}



Re: Pickup, Just for admin - WillyP - 07.11.2010

Quote:
Originally Posted by Blatnoi
Посмотреть сообщение
try this
(code)
Quote:
Originally Posted by gychem
Посмотреть сообщение
(code)
Maybe lrn2readpreviousposts? Thanks.

This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds.


Re: Pickup, Just for admin - Blatnoi - 07.11.2010

Quote:

Maybe lrn2readpreviousposts? Thanks.

Well i hope you undrestand that we all three started posting at the same time =D


Re: Pickup, Just for admin - Larsey123IsMe - 07.11.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
      else
      {
           GameTextForPlayer(playerid,"~r~YOU CANNOT ENTER.",4000,6);
     }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
      }
    return 1;
 }
Something is wrong... When i Enter the "House" (Non-admin) then the text shows and like i want it, but when i log on as admin and enter the house and Leave the House then the text shows up -.-


Re: Pickup, Just for admin - WillyP - 07.11.2010

Maybe
pawn Код:
!IsPlayerAdmin(playerid))



Re: Pickup, Just for admin - Larsey123IsMe - 07.11.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Maybe
pawn Код:
!IsPlayerAdmin(playerid))
LooL, I am noob, Where to put that? can you please send the whole scrip?


Re: Pickup, Just for admin - blackwave - 07.11.2010

ew dude, it's the singlest thing, as I said, if is even still the same question:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == HealthPickup) {
    if(IsPlayerAdmin(playerid)) {
      SetPlayerHealth(playerid, 100);
      SendClientMessage(playerid,COLOR_ORANGERED,"You picked up Health!");
      }
    else return SendClientMessage(playerid, COLOR_ORANGERED, "YOu're an admin");
     }
    return 1;
}



Re: Pickup, Just for admin - Larsey123IsMe - 07.11.2010

If it is so easy then fix this how i want it!

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
      else
      {
           GameTextForPlayer(playerid,"~r~YOU CANNOT ENTER.",4000,6);
     }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
      }
    return 1;
 }



Re: Pickup, Just for admin - HotRod - 07.11.2010

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
If it is so easy then fix this how i want it!

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_CRIMSON 0xDC143CAA

//Checkpoints
new EnterHouse, LeaveHouse;


public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Checkpoints By Larsey123");
    print("-------------------------------------------\n");

    //Checkpoints
    EnterHouse = CreatePickup(1273, 23, 966.84710693359,2133.0017089844,10.8203125);
    LeaveHouse = CreatePickup(1273, 23, 965.08758544922,-53.164505004883,1001.1245727539);

    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if( pickupid == EnterHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,963.37561035156,-53.307209014893,1001.124572);
      SetPlayerInterior(playerid,  3 );
      SendClientMessage(playerid,COLOR_CRIMSON,"Welcome to the Admin House!");
      }
      else
      {
           GameTextForPlayer(playerid,"~r~YOU CANNOT ENTER.",4000,6);
     }
    if( pickupid == LeaveHouse && IsPlayerAdmin(playerid))
    {
      SetPlayerPos(playerid,969.80432128906,2133.1311035156,10.8203);
      SetPlayerInterior(playerid,  0 );
      SendClientMessage(playerid,COLOR_CRIMSON,"You have left the Admin House!");
      }
    return 1;
 }
Instead of asking, go read wiki then come back. You won't learn nothing if you keep asking.