Author Topic: help me  (Read 4069 times)

0 Members and 1 Guest are viewing this topic.

SOMAAN

  • Guest
help me
« on: July 06, 2013, 01:46:19 pm »
plz give me function for a pickup from it we are freezed for 10 sec and then we got 1000$.
my code is gups

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: help me
« Reply #1 on: July 06, 2013, 05:39:11 pm »
Lol

in the beginning (behind OnGameModeInit):
[pawn]
forward frztmr();
new pickedup[MAX_PLAYERS];
[/pawn]

now paste the code in public OnPickedUp (I'll paste the code with public, if it doesn't exist in ur .pwn file):
[pawn]
public OnPickedUp(pickupid, playerid)
{
   if(pickupid == 1)//replace "1" with the pickupid u wish to pass functions typed behind
   {
        SetTimer("frztmr", 10000, 0);
        TogglePlayerControllable(playerid, 0);
        pickedup[playerid]=1;
   }
   return 1;
}
[/pawn]

Now the public:
[pawn]
public frztmr()
{
   for(new p=0; p<MAX_PLAYERS; p++)
   {
      if(pickedup[p]==1)
      {
          TogglePlayerControllable(p, 1);
                    SetPlayerMoney(p, GetPlayerMoney(p) + 1000);
                    pickedup[playerid]=0;
      }
   }
   return 1;
}
[/pawn]

it's beta, I hope aledark (or someone else) will fix the mistakes I made
« Last Edit: July 07, 2013, 08:49:40 pm by NeskWriter »


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: help me
« Reply #2 on: July 06, 2013, 06:58:12 pm »

Put this behind of another new in the top of the script

[pawn]new PickCash[MAX_PLAYERS];[/pawn]

Put this in OngameModeInit

[pawn]AddStaticPickup(120,501,-944.65417,-343.91436,7.22693); // this is the location of the bank vault[/pawn]

Add this in OnPickedUp


[pawn]    if(pickupid == 120) {
          format(string, sizeof(string), "%s take $ 1000 from the Bank", gPlayers[playerid]);
    SendClientMessageToAll(AMARILLO, string);
IncPlayerHandCash(playerid,1000);
TogglePlayerControllable(playerid,0);
SetTimer( "Cash", 10000,false);
PickCash[playerid] = 1;
 }[/pawn]
Put this in the end of the script
[pawn]//================================================================
public Cash() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(PickCash == 1) {
          SendClientMessage(i,0xFFFF00AA,"You picked up $1000!");
         TogglePlayerControllable(i,1);
           PickCash = 0;
      }
  }
      }
}
//==============================================================================[/pawn]


I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: help me
« Reply #3 on: July 07, 2013, 08:51:38 pm »

Put this behind of another new in the top of the script

[pawn]new PickCash[MAX_PLAYERS];[/pawn]

Put this in OngameModeInit

[pawn]AddStaticPickup(120,501,-944.65417,-343.91436,7.22693); // this is the location of the bank vault[/pawn]

Add this in OnPickedUp


[pawn]    if(pickupid == 120) {
          format(string, sizeof(string), "%s take $ 1000 from the Bank", gPlayers[playerid]);
    SendClientMessageToAll(AMARILLO, string);
IncPlayerHandCash(playerid,1000);
TogglePlayerControllable(playerid,0);
SetTimer( "Cash", 10000,false);
PickCash[playerid] = 1;
 }[/pawn]
Put this in the end of the script
[pawn]//================================================================
public Cash() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(PickCash == 1) {
          SendClientMessage(i,0xFFFF00AA,"You picked up $1000!");
         TogglePlayerControllable(i,1);
           PickCash = 0;
      }
  }
      }
}
//==============================================================================[/pawn]

All the public functions must be forwarded, if my memory serves me. So, else:
[pawn]forward Cash();[/pawn]
in the top


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: help me
« Reply #4 on: July 07, 2013, 08:55:37 pm »

Put this behind of another new in the top of the script

[pawn]new PickCash[MAX_PLAYERS];[/pawn]

Put this in OngameModeInit

[pawn]AddStaticPickup(120,501,-944.65417,-343.91436,7.22693); // this is the location of the bank vault[/pawn]

Add this in OnPickedUp


[pawn]    if(pickupid == 120) {
          format(string, sizeof(string), "%s take $ 1000 from the Bank", gPlayers[playerid]);
    SendClientMessageToAll(AMARILLO, string);
IncPlayerHandCash(playerid,1000);
TogglePlayerControllable(playerid,0);
SetTimer( "Cash", 10000,false);
PickCash[playerid] = 1;
 }[/pawn]
Put this in the end of the script
[pawn]//================================================================
public Cash() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(PickCash == 1) {
          SendClientMessage(i,0xFFFF00AA,"You picked up $1000!");
         TogglePlayerControllable(i,1);
           PickCash = 0;
      }
  }
      }
}
//==============================================================================[/pawn]

All the public functions must be forwarded, if my memory serves me. So, else:
[pawn]forward Cash();[/pawn]
in the top

I think your memory failure, as the settimer I use is "false" only works once, and starts at the pick the pickup if I remember correctly takes more than 30 seconds to appear

remember that you died for something
« Last Edit: July 07, 2013, 08:57:08 pm by aledark24 »
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: help me
« Reply #5 on: July 07, 2013, 08:57:11 pm »


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline vinesh

  • Street Thug
  • *
  • Posts: 20
    • View Profile
Re: help me
« Reply #6 on: August 05, 2013, 08:52:59 am »

Put this behind of another new in the top of the script

[pawn]new PickCash[MAX_PLAYERS];[/pawn]

Put this in OngameModeInit

[pawn]AddStaticPickup(120,501,-944.65417,-343.91436,7.22693); // this is the location of the bank vault[/pawn]

Add this in OnPickedUp


[pawn]    if(pickupid == 120) {
        new string[128];
          format(string, sizeof(string), "%s take $ 1000 from the Bank", gPlayers[playerid]);
    SendClientMessageToAll(AMARILLO, string);
IncPlayerHandCash(playerid,1000);
TogglePlayerControllable(playerid,0);
SetTimer( "Cash", 10000,false);
PickCash[playerid] = 1;
 }[/pawn]
Put this in the end of the script
[pawn]//================================================================
public Cash() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(PickCash == 1) {
          SendClientMessage(i,0xFFFF00AA,"You picked up $1000!");
         TogglePlayerControllable(i,1);
           PickCash = 0;
      }
  }
      }
}
//==============================================================================[/pawn]

All the public functions must be forwarded, if my memory serves me. So, else:
[pawn]forward Cash();[/pawn]
in the top

I think your memory failure, as the settimer I use is "false" only works once, and starts at the pick the pickup if I remember correctly takes more than 30 seconds to appear

remember that you died for something

I think u forgot to put new string[128];

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: help me
« Reply #7 on: August 11, 2013, 11:02:32 pm »
If i rejoin from the server,i can pickup it again, and simultaneously make me a richman -_-.
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________