PDA

View Full Version : I have 2 warnings


Frosty_LV
22/06/2012, 12:20 PM
Hello! May you please help me fix 2 warnings? :/

error 001: expected token: ";", but found "return"
warning 204: symbol is assigned a value that is never used: "Shop"

Line which gaved me problems:

return 1;

Yeah, its wierd, because this line have only this, but it still gives me 2 errors :S

Djumza
22/06/2012, 12:27 PM
show us a little more ,maybe that part of script.

ryansheilds
22/06/2012, 12:27 PM
Show the line before the return.

Frosty_LV
22/06/2012, 12:29 PM
public OnGameModeInit()
{
Shop = CreatePickup(1318,1,1352.1962,-1756.9938,13.5078)
// Don't use these lines if it's a filterscript

Here you go.

Skaizo
22/06/2012, 12:30 PM
Shop = CreatePickup(1318,1,1352.1962,-1756.9938,13.5078);

ryansheilds
22/06/2012, 12:30 PM
Add ';' to the end of the 'Shop = CreatePickup(1318,1,1352.1962,-1756.9938,13.5078)'.

Frosty_LV
22/06/2012, 12:32 PM
Thanks for advice, but now it gives me this:

warning 204: symbol is assigned a value that is never used: "Shop"

Skaizo
22/06/2012, 12:33 PM
you have at top of script
new Shop;
?if no, add this
Edit: you need add function of Shop
exemple

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Shop) GivePlayerMoney(playerid,10000);
return 1;
}

ryansheilds
22/06/2012, 12:34 PM
You never use it after creating the pickup, like to destroy it, so it's not needed. You can just remove 'shop' when creating the pickup and remove the global variable of it, in-less you're planning to use it somewhere else.

Frosty_LV
22/06/2012, 12:42 PM
Well, I removed that ''Shop'' and now works fine, except thing that I want to give name for that marker. Now it's just a marker, without name, people wont know what is in there :/

ryansheilds
22/06/2012, 01:01 PM
If you ever plan to use it somewhere else, like 'OnPlayerPickUpPickup', you can just re-add it.

[jS]Thomas
22/06/2012, 01:13 PM
Well, I removed that ''Shop'' and now works fine, except thing that I want to give name for that marker. Now it's just a marker, without name, people wont know what is in there :/

You could use Create3DTextLabel so people know what the pickup is, add it under OnGameModeInit:
Create3DTextLabel("Shop", 0x33CCFFAA, 1352.1962, -1756.9938, 13.5078, 40.0, 0, 0);

Frosty_LV
22/06/2012, 01:15 PM
Hmm, ok thanks for you all! + Reputation for you all :)