Vice City Multiplayer

General Discussion => Support => Tutorials => Topic started by: JackDawZ on October 24, 2012, 12:14:41 pm

Title: How to use OnPickedUp.
Post by: JackDawZ on October 24, 2012, 12:14:41 pm
if you want to make the pickup with many functions, read my article.

For a beginning:
Quote
#define JACK_WHITE 0xFFFFFFAA // Copypast to your pwn file

1st Step. To add pickup

Quote
public OnGameModeInit()
{
AddStaticPickup (1, 410, -442.8760, -315.8749, 11.1867); // Hidden Package
AddStaticPickup (2, 356, -703.3553, -411.1085, 10.5188); // Box

2nd Step. to make a function of the pickup

Quote
public OnPickedUp(playerid,pickupid)
{
if ( pickupid == 1) // Function of 1st pickup
{
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 5000); // +5.000$ to the cash
SendClientMessage(playerid, JACK_WHITE, "You picked up hidden package! Award: 5000$");
}
if ( pickupid == 2) // Function of 2nd pickup
{
SetPlayerWeapon(playerid, 21, 500); // Gives a stubby
SendClientMessage(playerid, JACK_WHITE, "You picked up box with a stubby shotgun!");
}
return 1;
}
Title: Re: How to use OnPickedUp.
Post by: sseebbyy on October 24, 2012, 01:53:42 pm
Good Job.

Good for begginers !  ;)

P.S.: Next time use [ code ] not [ quote ]
Exist and [ pawn ] but is a bit bugged so ... use [ code ]

CODE:
Code: [Select]
Is for code => can be used for scripts.
QUOTE:
Quote
Isn't for code / pawno code => is not for scripts.

PAWN:
[pawn]Is for Pawno Code.[/pawn]

When you copy/paste a script in [ pawn ] , is possible to show wrong some parts !

[pawn]new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};[/pawn]

Same code but I used [ code ]

Code: [Select]
new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};
Title: Re: How to use OnPickedUp.
Post by: heekz.shadow on October 24, 2012, 02:32:45 pm
Good Job.

Good for begginers !  ;)

P.S.: Next time use [ code ] not [ quote ]
Exist and [ pawn ] but is a bit bugged so ... use [ code ]

CODE:
Code: [Select]
Is for code => can be used for scripts.
QUOTE:
Quote
Isn't for code / pawno code => is not for scripts.

PAWN:
[pawn]Is for Pawno Code.[/pawn]

When you copy/paste a script in [ pawn ] , is possible to show wrong some parts !

[pawn]new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};[/pawn]

Same code but I used [ code ]

Code: [Select]
new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};

It's not pawno code, but PAWN code. ( Pawno is the editor, PAWN is the language.. )
Title: Re: How to use OnPickedUp.
Post by: sseebbyy on October 24, 2012, 02:40:24 pm
It's not pawno code, but PAWN code. ( Pawno is the editor, PAWN is the language.. )

I know.

But I told Pawno Code cuse "Pawno Code" appears above code. ;)
First time I typed "Pawn Code" , but I saw that and I wanted to tell how is there.

[pawn]Pawno Code[/pawn]
Title: Re: How to use OnPickedUp.
Post by: JackDawZ on October 26, 2012, 11:38:22 am
Good Job.

Good for begginers !  ;)

P.S.: Next time use [ code ] not [ quote ]
Exist and [ pawn ] but is a bit bugged so ... use [ code ]

CODE:
Code: [Select]
Is for code => can be used for scripts.
QUOTE:
Quote
Isn't for code / pawno code => is not for scripts.

PAWN:
[pawn]Is for Pawno Code.[/pawn]

When you copy/paste a script in [ pawn ] , is possible to show wrong some parts !

[pawn]new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};[/pawn]

Same code but I used [ code ]

Code: [Select]
new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};

Ok thanks. I have understood.