• Welcome to Vice City Multiplayer.
 

Function Pickups help plz

Started by Castagna96, February 28, 2011, 01:41:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Castagna96

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

theway

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 ?

Castagna96

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

heekz.shadow

#3
look here

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:

new i;
for(i>=20,i<=40,i++);

use
if(pickupid == i) {
SetPlayerHealth(playerid,0);
}


Pro Scripter[/b][/i][/u]

Castagna96

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

heekz.shadow

You want all the pickups from 80 to 85? ok Here you go:

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).


Pro Scripter[/b][/i][/u]

BIG[H]

My Guru FORUM MUST VISITmegavcmp.freeforums.org

BIG[H] = BIG HaLL

heekz.shadow

What? you don't understand? It is logically. JUST LEARN MATH. Im no.1 in math in my class.


Pro Scripter[/b][/i][/u]

Castagna96

OMG i undertand it Cleen bre thank you ;D ;D THANKS!!!!!!!!1111

Castagna96


Castagna96

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

heekz.shadow

for(new i; i>=91; i<=103; i++) {
if(pickupid == i)
{
IncPlayerHandCash(playerid,1000);
}
}


Pro Scripter[/b][/i][/u]

Castagna96


Castagna96

QuoteC:\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  :(

heekz.shadow



Pro Scripter[/b][/i][/u]