Author Topic: cmd problem  (Read 6377 times)

0 Members and 3 Guests are viewing this topic.

Offline shaeel ahmed

  • Street Thug
  • *
  • Posts: 11
    • View Profile
cmd problem
« 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;

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: cmd problem
« Reply #1 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]
I'm beginning to feel like a Lag God, Lag God

Offline shaeel ahmed

  • Street Thug
  • *
  • Posts: 11
    • View Profile
Re: cmd problem
« Reply #2 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

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: cmd problem
« Reply #3 on: December 27, 2011, 12:28:59 pm »
Does it really works ? Lol..
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 shaeel ahmed

  • Street Thug
  • *
  • Posts: 11
    • View Profile
Re: cmd problem
« Reply #4 on: December 27, 2011, 03:47:27 pm »
yup it works ;D

Offline shaeel ahmed

  • Street Thug
  • *
  • Posts: 11
    • View Profile
Re: cmd problem
« Reply #5 on: December 27, 2011, 04:00:57 pm »
but when player bring ball hent giving him m60? why :-\

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: cmd problem
« Reply #6 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
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 Morphine

  • Made Man
  • ***
  • Posts: 109
    • View Profile
Re: cmd problem
« Reply #7 on: December 31, 2011, 02:41:14 pm »
serial order?

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: cmd problem
« Reply #8 on: December 31, 2011, 04:02:49 pm »
one by one
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 DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: cmd problem
« Reply #9 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]
_______________________________________________
¬ 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.
_______________________________________________

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: cmd problem
« Reply #10 on: January 04, 2012, 05:05:15 am »
try changing if to else if or else, providing you only have two..
I'm beginning to feel like a Lag God, Lag God

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: cmd problem
« Reply #11 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" );
}

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: cmd problem
« Reply #12 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
}
_______________________________________________
¬ 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.
_______________________________________________

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: cmd problem
« Reply #13 on: January 05, 2012, 04:42:25 pm »
when i picked it up its doest show me nothing  :'( :-[ :-[ :-[
_______________________________________________
¬ 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.
_______________________________________________

Offline Morphine

  • Made Man
  • ***
  • Posts: 109
    • View Profile
Re: cmd problem
« Reply #14 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
                }
}