Author Topic: Function Pickups help plz  (Read 12313 times)

0 Members and 1 Guest are viewing this topic.

Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Function Pickups help plz
« on: February 28, 2011, 03:41:56 am »
Ok here is my problem ... I wanna made somthing like the same function for like 20 pickups how can i do it...i alrady tried this
Quote
}
    if(pickupid == 81 || (pickupid == 82)) {
      SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
        SendClientMessage(playerid,COLOR_JOIN,"Your Car Has Been repaired");

it work but i need help how to do it.. for more like for 20 more  or as much i want help plz !!!!! help plz   ???

thanks that's all
« Last Edit: March 02, 2011, 05:11:41 am by Castagna96 »
Castagna - EA Founder


Offline theway

  • Street Thug
  • *
  • Posts: 20
    • View Profile
Re: Plz i need help on pick ups some one can help me !!!
« Reply #1 on: February 28, 2011, 07:09:51 am »
AddStaticPickup(id,type,Float:X,Float:Y,Float:Z)

 and such as,  AddStaticPickup(5,514,Float:X,Float:Y,Float:Z)  , x and y and z,  u can in the game  type /s




//--
OnPickedUp(pickupid, playerid)

{
if (pickupid == 5 ){
SetPlayerHealth (playerid, 55);
}
//---like this
}


U know ?

Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Plz i need help on pick ups some one can help me !!!
« Reply #2 on: February 28, 2011, 08:29:54 am »
i think you didn't understood i said how to put like more than 20 id's of pickups to the same function but well thanks  ;D
Castagna - EA Founder


Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Function Pickups help plz
« Reply #3 on: March 02, 2011, 05:51:48 pm »
look here

Code: [Select]
if((pickupid == 80) || (pickupid == 85))
{
SetPlayerHealth(playerid,55+10); // :D
}
else if(pickupid == 20)
{
SetPlayerScore(playerid,0); // :))
}
else if etc...
  ::)   ::)  ::)

and for your question,here is what I made:

Code: [Select]
new i;
for(i>=20,i<=40,i++);
use
Code: [Select]
if(pickupid == i) {
SetPlayerHealth(playerid,0);
}
« Last Edit: March 02, 2011, 05:54:23 pm by heekz.shadow »
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Function Pickups help plz
« Reply #4 on: March 03, 2011, 06:36:16 am »
noo i know that i am saying like i wanna put in the function 1 thru 20 without doing  if((pickupid == 80) || (pickupid == 85))
 that but thanks for trying
Castagna - EA Founder


Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Function Pickups help plz
« Reply #5 on: March 03, 2011, 10:23:56 am »
You want all the pickups from 80 to 85? ok Here you go:

Code: [Select]
for(new i; i>=80; i<=85; i++) {
if(pickupid == i) {
// Things to happen
}

Understood? It is  (i) and it is repeating cuz I set that ++ there. So it is bigger or equal with 80 and its less or equal with 85. It is repeating so it will return every number between 80-85 including'em (80,81,82,83,84,85).
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: Function Pickups help plz
« Reply #6 on: March 03, 2011, 06:25:42 pm »
omg :o
Outdoor city server Administrator, FS server owner!

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Function Pickups help plz
« Reply #7 on: March 03, 2011, 07:46:14 pm »
What? you don't understand? It is logically. JUST LEARN MATH. Im no.1 in math in my class.
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Function Pickups help plz
« Reply #8 on: March 05, 2011, 07:02:04 am »
OMG i undertand it Cleen bre thank you ;D ;D THANKS!!!!!!!!1111
Castagna - EA Founder


Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Function Pickups help plz
« Reply #9 on: March 05, 2011, 07:06:10 am »
just algebra 1  ;D ;D
Castagna - EA Founder


Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Function Pickups help plz
« Reply #10 on: March 05, 2011, 08:58:37 am »
sorry about too many questions put the thing to that from id 91 to 103 plz just an example plz
Quote
}
    if(pickupid == 91 || (pickupid == 92) || (pickupid == 93) || (pickupid == 94) || (pickupid == 95) || (pickupid == 96) || (pickupid == 97) || (pickupid == 98) || (pickupid == 99) || (pickupid == 100) || (pickupid == 101) || (pickupid == 102) || (pickupid == 103)) {
         IncPlayerHandCash(playerid,100);
        }
Castagna - EA Founder


Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Function Pickups help plz
« Reply #11 on: March 05, 2011, 12:26:26 pm »
Code: [Select]
for(new i; i>=91; i<=103; i++) {
if(pickupid == i)
 {
IncPlayerHandCash(playerid,1000);
}
}
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Function Pickups help plz
« Reply #12 on: March 05, 2011, 11:12:57 pm »
thanks i will try ;D ;D
Castagna - EA Founder


Offline Castagna

  • VC:MP Beta Tester
  • Made Man
  • *
  • Posts: 129
  • Global Moderator
    • View Profile
Re: Function Pickups help plz
« Reply #13 on: March 05, 2011, 11:24:15 pm »
Quote
C:\Users\Tato\Desktop\servers de otra gente\server actualizado 5\gamemodes\mode.pwn(310) : warning 215: expression has no effect
C:\Users\Tato\Desktop\servers de otra gente\server actualizado 5\gamemodes\mode.pwn(310) : error 001: expected token: ")", but found ";"
C:\Users\Tato\Desktop\servers de otra gente\server actualizado 5\gamemodes\mode.pwn(310) : error 036: empty statement
C:\Users\Tato\Desktop\servers de otra gente\server actualizado 5\gamemodes\mode.pwn(310) : error 017: undefined symbol "i"
C:\Users\Tato\Desktop\servers de otra gente\server actualizado 5\gamemodes\mode.pwn(310) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


4 Errors.
those are my 4 errors  :(
Castagna - EA Founder


Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Function Pickups help plz
« Reply #14 on: March 05, 2011, 11:51:13 pm »
show me line 310
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players