Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started 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;
-
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]
-
thnkssssssssssss aaaaaaaaaaaaaaaaalooooooooooooooooooooooooooooooooooooooooot fuzzyyyyy ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
-
Does it really works ? Lol..
-
yup it works ;D
-
but when player bring ball hent giving him m60? why :-\
-
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
-
serial order?
-
one by one
-
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]
-
try changing if to else if or else, providing you only have two..
-
I looked at that for about 2 seconds and it's pretty obvious he's missed a { on each of the if statements.
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" );
}
-
I looked at that for about 2 seconds and it's pretty obvious he's missed a { on each of the if statements.
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
}
-
when i picked it up its doest show me nothing :'( :-[ :-[ :-[
-
Derp. This should help.
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
}
}
-
I hope when you use 406 and 407, you mean actual pickup IDs.
pickupid is NOT THE SAME AS THE MODEL OF THE PICKUP.
-
Woops, then it would be the first value you specified in AddStaticPickup.
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.
-
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;
}
-
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
if( pickupid == 1)
, it will refer to the first pickup..