Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: shaeel ahmed on December 27, 2011, 09:59:01 am

Title: cmd problem
Post by: shaeel ahmed on December 27, 2011, 09:59:01 am
i add a pickup of ball when a person bring this ball he get gun m60
i made a command but still errors are comming . see these commands and tell me what i did wrong
[pawn][/pawn] public OnPickedUp( pickupid, playerid )
{

   if ( strcmp( PickupInfo[ pickupid ]
        GivePlayerWeapon(playerid,21,10000);
}
 return 1;
Title: Re: cmd problem
Post by: Fuzzy168 on December 27, 2011, 10:29:53 am
Fail..  :-X
Anyway its this I think
[pawn]if ( strcmp( PickupInfo[ pickupid ][/pawn]
I believe the id of the "beach" ball is 526. So,
[pawn]public OnPickedUp( pickupid, playerid )
{
   if( pickupid == 526)
   GivePlayerWeapon( playerid, 21, 9999);
   SendClientMessage( playerid, YOUR_COLOUR, "You found the Beach Ball! Here's an M60." );
   return 1;
}
[/pawn]
Title: Re: cmd problem
Post by: shaeel ahmed on December 27, 2011, 11:04:59 am
thnkssssssssssss aaaaaaaaaaaaaaaaalooooooooooooooooooooooooooooooooooooooooot fuzzyyyyy ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
Title: Re: cmd problem
Post by: heekz.shadow on December 27, 2011, 12:28:59 pm
Does it really works ? Lol..
Title: Re: cmd problem
Post by: shaeel ahmed on December 27, 2011, 03:47:27 pm
yup it works ;D
Title: Re: cmd problem
Post by: shaeel ahmed on December 27, 2011, 04:00:57 pm
but when player bring ball hent giving him m60? why :-\
Title: Re: cmd problem
Post by: heekz.shadow on December 31, 2011, 10:40:16 am
Cause it should be the id of the pickup in-script, not the MODEL of the pickup. Give me all your lines you got in script starting with


 AddStaticPickup ( in serial order ) including this one
Title: Re: cmd problem
Post by: Morphine on December 31, 2011, 02:41:14 pm
serial order?
Title: Re: cmd problem
Post by: heekz.shadow on December 31, 2011, 04:02:49 pm
one by one
Title: Re: cmd problem
Post by: DilsonTB on January 04, 2012, 01:14:58 am
I dont know why this lines Get me into error:

[pawn]public OnPickedUp(pickupid, playerid)
{
   if( pickupid == 407)
   SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 407" );
   return 1;
   }
   if( pickupid == 406)   // This is the 256 Line
   SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 406" );
   }[/pawn]

ERROR:

[pawn](256) : error 010: invalid function or declaration[/pawn]
Title: Re: cmd problem
Post by: Fuzzy168 on January 04, 2012, 05:05:15 am
try changing if to else if or else, providing you only have two..
Title: Re: cmd problem
Post by: Force on January 04, 2012, 06:19:23 am
I looked at that for about 2 seconds and it's pretty obvious he's missed a { on each of the if statements.

Code: [Select]
public OnPickedUp(pickupid, playerid)
{
if( pickupid == 407)
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 407" );
return 1;
}
   if( pickupid == 406)   // This is the 256 Line
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 406" );
}
Title: Re: cmd problem
Post by: DilsonTB on January 04, 2012, 04:10:09 pm
I looked at that for about 2 seconds and it's pretty obvious he's missed a { on each of the if statements.

Code: [Select]
public OnPickedUp(pickupid, playerid)
{
if( pickupid == 407)
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 407" );
return 1;
}
   if( pickupid == 406)   // This is the 256 Line
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 406" );
        }
  return 1; // And you are lose in this
}
Title: Re: cmd problem
Post by: DilsonTB on January 05, 2012, 04:42:25 pm
when i picked it up its doest show me nothing  :'( :-[ :-[ :-[
Title: Re: cmd problem
Post by: Morphine on January 05, 2012, 05:07:03 pm
Derp. This should help.

Code: [Select]
public OnPickedUp(pickupid, playerid)
{
if( pickupid == 407)
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 407" );
return 1;
}
    else if( pickupid == 406)   // This is the 256 Line
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 406" );
       
  return 1; // And you are lose in this
                }
}
Title: Re: cmd problem
Post by: stormeus on January 05, 2012, 10:56:31 pm
I hope when you use 406 and 407, you mean actual pickup IDs.

pickupid is NOT THE SAME AS THE MODEL OF THE PICKUP.
Title: Re: cmd problem
Post by: Morphine on January 06, 2012, 11:42:10 am
Woops, then it would be the first value you specified in AddStaticPickup.

Code: [Select]
public OnPickedUp(pickupid, playerid)
{
if( pickupid == 1 ) // The Pickup number here
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 407" );
return 1;
}
    else if( pickupid == 2)   // The second pickup number here
{
SendClientMessage(playerid, COLOR_YELLOW, "Esto es un Pickup ID 406" );
       
  return 1; // And you are lose in this
                }
}

Something like this. I don't know what your Pickup IDs are so configure them yourself.
Title: Re: cmd problem
Post by: shaeel ahmed on January 07, 2012, 05:36:53 am
guys u cant help me but i made this cmd my own it works
public OnPickedUp( pickupid, playerid )
{
if(pickupid = 526)
{
SetPlayerWeapon(playerid,32,9999999);
}
else if(pickupid = 510)
{
SetPlayerHealth(playerid,100.0);
 }
return 1;
}
Title: Re: cmd problem
Post by: Fuzzy168 on January 07, 2012, 11:56:31 am
That thing won't work. The first pickup you add to your script, pickupid is 1. So AddStaticPickup( 1, 526, X, Y, Z ). So, whenever you put
Code: [Select]
if( pickupid == 1), it will refer to the first pickup..