The pickups won't show up in my server :S (No Errors or Warnings)
#1

I know the wiki and I read the pickup guide but it doesn't help me. am I doing something wrong? ugh Yes, lol.
I'm just busy for TWO (2) Days trying to ADD just FIVE (5) fucking pickups? The problem is, they won't show up in the server :S There are no errors or warnings in the script
Here is the script:

Код:
#include <a_samp>

#define GivePlayerHealth
#define pickup
#define GivePlayerArmor
#define GivePlayerWeapon
#define OnPlayerPickupPickup
#if defined playerid
new Health;
new Health;
new Armor;
new Sawnoff
new TEC-9

public OnGameModeInit()
{

Health = CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
Health = CreatePickup(1240, 2, 2099.9, 2186.5, 13.4); //Health
Armor = CreatePickup(1242, 2, 2100, 2184,.3, 13.4); //Armor
Sawnoff = CreatePickup(350, 2, 2100.8, 2168.8, 13.4); //Sawnoff
TEC-9 = CreatePickup(372, 2, 2100.9, 2170.9, 10.8); //TEC-9
return 1;
}

public OnPlayerPickupPickup(playerid, pickupid);
{

if(pickupid == Health) {
GivePlayerHealth(playerid, 1240, 100);


if(pickupid == Health) {
GivePlayerHealth(playerid, 1240, 100);

if(pickupid == Armor) {
GivePlayerArmor(playerid, 1242, 100);

if(pickupid == Sawnoff) {
GivePlayerWeapon(playerid, 350, 100);

if(pickupid == TEC-9) {
GivePlayerWeapon(playerid, 372, 1000);

return 1;
}

#endif
The pickups: A Health pickup on the ship
Health and Armor at FC
TEC-9 and Sawnoff at FC

The problem is, they won't show up there.
Can somebody help me please?

Reply
#2

Firstly make sure they are in this format:

pawn Код:
CreatePickup(model,type,Float:X,Float:Y,Float:Z)
And take out this rubbish:

pawn Код:
#define GivePlayerHealth
#define pickup
#define GivePlayerArmor
#define GivePlayerWeapon
#define OnPlayerPickupPickup
#if defined playerid
You don't need to define something that is already defined. Either way you are defining them as nothing.
Reply
#3

I took out the rubbish but I kept #if defined playerid. f i take that out, I get 6 errors >_<

ok, it still won't show the pickups on the server. I also tried AddStaticPickup. but didn't work either. what do I fucking wrong? it's fun to script bt I'm a nub at it I want to learn plz 2 days is too long for just 5 pickups that doesn't even work.

Код:
#include <a_samp>

#if defined playerid

new Health;
new Health;
new Armor;
new Sawnoff
new TEC-9

public OnGameModeInit()
{

CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
CreatePickup(1240, 2, 2099.9, 2186.5, 13.4); //Health
CreatePickup(1242, 2, 2100, 2184,.3, 13.4); //Armor
CreatePickup(350, 2, 2100.8, 2168.8, 13.4); //Sawnoff
CreatePickup(372, 2, 2100.9, 2170.9, 10.8); //TEC-9

Health = CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
Health = CreatePickup(1240, 2, 2099.9, 2186.5, 13.4); //Health
Armor = CreatePickup(1242, 2, 2100, 2184,.3, 13.4); //Armor
Sawnoff = CreatePickup(350, 2, 2100.8, 2168.8, 13.4); //Sawnoff
TEC-9 = CreatePickup(372, 2, 2100.9, 2170.9, 10.8); //TEC-9
return 1;
}

public OnPlayerPickupPickup(playerid, pickupid);
{

if(pickupid == Health) {
GivePlayerHealth(playerid, 1240, 100);


if(pickupid == Health) {
GivePlayerHealth(playerid, 1240, 100);

if(pickupid == Armor) {
GivePlayerArmor(playerid, 1242, 100);

if(pickupid == Sawnoff) {
GivePlayerWeapon(playerid, 350, 100);

if(pickupid == TEC-9) {
GivePlayerWeapon(playerid, 372, 1000);

return 1;
}

#endif
Reply
#4

Quote:
Originally Posted by speedruntrainer
CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
Are you sure the last float is a correct Z axis coordinate? They look a little small to me....


Quote:
Originally Posted by speedruntrainer
I took out the rubbish but I kept #if defined playerid. f i take that out, I get 6 errors >_<
That means you're doing something wrong, playerid is always defined where it is needed. Customly defining a playerid will result in doing the action to a non-existent player (or id 0, i'm not sure).
Reply
#5

If you want to learn to script, check my sig.
Reply
#6

Quote:
Originally Posted by ferriswheel
Quote:
Originally Posted by speedruntrainer
CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
Are you sure the last float is a correct Z axis coordinate? They look a little small to me....
Yes, I get the coordinates ingame if I do /getinfo 0, so where I stand, I get the coordinates. I can take screenshots if you want :P
The /getinfo is in the Ladmin script, very useful :P
Reply
#7

Your problem is that you never #define playerid, so everything between #if defined playerid and #endif, isn't compiled. Start by removing the #if / #endif..
Reply
#8

Remove #if?? Nice errors will show up :O

Код:
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(3) : error 031: unknown directive
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(8) : error 001: expected token: ";", but found "-"
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(15) : error 001: expected token: "-identifier-", but found "-integer value-"
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(15) : warning 215: expression has no effect
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(15) : warning 215: expression has no effect
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(15) : error 001: expected token: ";", but found ")"
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(15) : error 029: invalid expression, assumed zero
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\pickups.pwn(15) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
This is the pawn code now, sorry, I don't understand it much, but i will learn
Код:
#include <a_samp>

#defined playerid

new Health;
new Armor;
new Sawnoff;
new TEC-9;

public OnGameModeInit()
{

CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
CreatePickup(1240, 2, 2099.9, 2186.5, 13.4); //Health
CreatePickup(1242, 2, 2100, 2184,.3, 13.4); //Armor
CreatePickup(350, 2, 2100.8, 2168.8, 13.4); //Sawnoff
CreatePickup(372, 2, 2100.9, 2170.9, 10.8); //TEC-9

Health = CreatePickup(1240, 2, 2000.7, 1568.0, 15.3); //Health
Health = CreatePickup(1240, 2, 2099.9, 2186.5, 13.4); //Health
Armor = CreatePickup(1242, 2, 2100, 2184,.3, 13.4); //Armor
Sawnoff = CreatePickup(350, 2, 2100.8, 2168.8, 13.4); //Sawnoff
TEC-9 = CreatePickup(372, 2, 2100.9, 2170.9, 10.8); //TEC-9
return 1;
}

public OnPlayerPickupPickup(playerid, pickupid);
{

if(pickupid == Health) {
GivePlayerHealth(playerid, 1240, 100);


if(pickupid == Health) {
GivePlayerHealth(playerid, 1240, 100);

if(pickupid == Armor) {
GivePlayerArmor(playerid, 1242, 100);

if(pickupid == Sawnoff) {
GivePlayerWeapon(playerid, 350, 100);

if(pickupid == TEC-9) {
GivePlayerWeapon(playerid, 372, 1000);

return 1;
}

#end
Please do not get crazy of me. I'm getting Crazy on this script now! I need to get it to work
Reply
#9

I definitely know there is one problem:
Replace
pawn Код:
TEC-9
With something like
pawn Код:
Tec_9
EDIT: and oh yeh why are u usiing this?
pawn Код:
#defined playerid
there is no need for that, you rplayerid will not work properly, if at all.
Reply
#10

Look at my other post, I deleted the if but then, 6 errors comes up -.- and I don't understand what the fuck is going wrong -.- I'm sure it's not the TEC-9 but somwthing worse. And if I remove them completely, I still have errors -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)