Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: Castagna96 on February 28, 2011, 01:41:56 AM

Title: Function Pickups help plz
Post by: Castagna96 on February 28, 2011, 01: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
Title: Re: Plz i need help on pick ups some one can help me !!!
Post by: theway on February 28, 2011, 05: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 ?
Title: Re: Plz i need help on pick ups some one can help me !!!
Post by: Castagna96 on February 28, 2011, 06: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
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 02, 2011, 03:51:48 PM
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);
}
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 03, 2011, 04: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
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 03, 2011, 08:23:56 AM
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).
Title: Re: Function Pickups help plz
Post by: BIG[H] on March 03, 2011, 04:25:42 PM
omg :o
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 03, 2011, 05:46:14 PM
What? you don't understand? It is logically. JUST LEARN MATH. Im no.1 in math in my class.
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 05, 2011, 05:02:04 AM
OMG i undertand it Cleen bre thank you ;D ;D THANKS!!!!!!!!1111
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 05, 2011, 05:06:10 AM
just algebra 1  ;D ;D
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 05, 2011, 06: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);
        }
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 05, 2011, 10:26:26 AM
for(new i; i>=91; i<=103; i++) {
if(pickupid == i)
{
IncPlayerHandCash(playerid,1000);
}
}
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 05, 2011, 09:12:57 PM
thanks i will try ;D ;D
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 05, 2011, 09:24:15 PM
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  :(
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 05, 2011, 09:51:13 PM
show me line 310
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 05, 2011, 09:59:32 PM
ok
Quotefor(new i = 0; i>=91; i<=103; i++) {
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 06, 2011, 09:50:28 AM
try this
for(new i; i<=91; i>=93; i++) {

you can change just 91 and 93 but man,close the bracket I putted {
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 06, 2011, 05:55:02 PM
ok thanks i will try
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 06, 2011, 05:58:29 PM
 :o :o :o still the same 4 errors maby we need to identify the i whats the function of the i
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 06, 2011, 06:15:21 PM
new i; i>=91; i<=103;
if(pickupid == i++)
{
// Things to come
}


try this
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 07, 2011, 02:09:04 AM
ok i will try thanks ;D
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 08, 2011, 03:05:23 AM
Oh my Gosh i think works no errors but warns i will try in the game if works ok thanks so much !!!!!!!!!!!11 ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 08, 2011, 03:09:20 AM
no errors,yes warns,don't work mmm ???
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 08, 2011, 03:13:02 AM
QuoteC:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : warning 215: expression has no effect
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : warning 215: expression has no effect
that is the warn but is not working when i pickup the pickup does not give me money mmmm rare ??? thanks as well
Title: Re: Function Pickups help plz
Post by: shivambansal on March 08, 2011, 07:11:15 AM
use modify button :-\
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 08, 2011, 07:19:27 AM
for(new i; i>90; i<104; i++)
{
// things to happen
}
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 08, 2011, 04:21:40 PM
QuoteC:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : warning 215: expression has no effect
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : error 001: expected token: ")", but found ";"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : error 036: empty statement
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : error 017: undefined symbol "i"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : 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.
Oh My Gosh we already tried all type of cmds and dont work  ???

line 308
   for(new i; i>91; i<103; i++)
maby we need to  define the function of the i
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 08, 2011, 04:22:06 PM
thanks for trying still ;D
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 08, 2011, 07:04:29 PM
oough I think I got this.

for(new i=0; i++);
if((i++ >= 93) || (i++ <=103)) {
// things to happen
}
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 09, 2011, 02:20:52 AM
i think let me try ok ;D ;D
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 09, 2011, 03:19:40 AM
QuoteC:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : error 001: expected token: ";", but found ")"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : error 036: empty statement
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(309) : error 017: undefined symbol "i"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(1980) : warning 204: symbol is assigned a value that is never used: "MaxPlayers"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(2586) : warning 204: symbol is assigned a value that is never used: "enstr"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(3668) : warning 213: tag mismatch
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4824) : warning 204: symbol is assigned a value that is never used: "LMSkiller"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4921) : warning 209: function "GetPlayersinLMS" should return a value
Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


3 Errors.
OMG i think we are close bro thanks still for trying to help me :DDDD
Title: Re: Function Pickups help plz
Post by: yazeen on March 09, 2011, 07:24:53 AM
This prop can be solved

C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(308) : error 001: expected token: ";", but found ")"

its the proplem of ; at last u may have forgoten to put ; at last show me the 308 line plse
Title: Re: Function Pickups help plz
Post by: heekz.shadow on March 09, 2011, 05:48:26 PM
found:D
new i;
for(i=0; i++);
if((i>=93) || (i<=103))
{
// things to happen
}

Title: Re: Function Pickups help plz
Post by: Castagna96 on March 10, 2011, 02:15:04 AM
    new i;
for(i=0; i++);
if((i>=91) || (i<=103))
{
IncPlayerHandCash(playerid,100);
}
<=============== there is the code
QuoteC:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(309) : error 001: expected token: ";", but found ")"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(309) : error 036: empty statement
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(1982) : warning 204: symbol is assigned a value that is never used: "MaxPlayers"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(2589) : warning 204: symbol is assigned a value that is never used: "enstr"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(3680) : warning 213: tag mismatch
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4577) : warning 213: tag mismatch
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4578) : warning 202: number of arguments does not match definition
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4584) : warning 213: tag mismatch
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4896) : warning 204: symbol is assigned a value that is never used: "LMSkiller"
C:\Users\Tato\Desktop\servers de otra gente\server xa v6\gamemodes\mode.pwn(4993) : warning 209: function "GetPlayersinLMS" should return a value
Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


2 Errors.
The F*** Errors thanks still mmmm i have an idea why yo dont try in all forms possible in a new script and maybe we found it :D
Title: Re: Function Pickups help plz
Post by: Castagna96 on March 12, 2011, 12:49:11 AM
thanks for try bre i found the way to do it thanks for all ;D ;D
Title: Re: Function Pickups help plz
Post by: tato on March 30, 2011, 05:11:31 AM
i got the code i will lock this allright  ;D thanks for all your help
If you need the code i'll give to you :P