SA-MP Forums Archive
Pickup case help .. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pickup case help .. (/showthread.php?tid=364330)



Pickup case help .. - Pokiri_Boii - 30.07.2012

Hey Guys when i compiled my script i got this error

Код:
D:\SATDM v11 SA-MP 0.3e\filterscripts\LuxuriousHouse.pwn(462) : error 008: must be a constant expression; assumed zero
D:\SATDM v11 SA-MP 0.3e\filterscripts\LuxuriousHouse.pwn(462) : error 036: empty statement
D:\SATDM v11 SA-MP 0.3e\filterscripts\LuxuriousHouse.pwn(467) : error 010: invalid function or declaration
D:\SATDM v11 SA-MP 0.3e\filterscripts\LuxuriousHouse.pwn(452) : warning 204: symbol is assigned a value that is never used: "heliout"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
here is the pawn script i used

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    switch (pickupid)
    {

    case heli;
    {
    SetPlayerPos(playerid,-2383.6670,-1602.5835,507.5224);
    GameTextForPlayer(playerid, "~b~Teleported to ~g~Heli Stand", 3000, 5);
    }
    case heliout;
    {
    SetPlayerPos(playerid,-2325.2319,-1613.5901,483.7204);
    GameTextForPlayer(playerid, "~b~Back ~r~Home", 3000, 5);
    }

i defined it at the top of my script


pawn Код:
new heli;
new heliout;
Can anyone help me ??


Re: Pickup case help .. - Devilxz97 - 30.07.2012

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == heli)
    {
        SetPlayerPos(playerid,-2383.6670,-1602.5835,507.5224);
        GameTextForPlayer(playerid, "~b~Teleported to ~g~Heli Stand", 3000, 5);
    }
    else if(pickupid == heliout)
    {
        SetPlayerPos(playerid,-2325.2319,-1613.5901,483.7204);
        GameTextForPlayer(playerid, "~b~Back ~r~Home", 3000, 5);
    }
    return 1;
}



Re: Pickup case help .. - ReneG - 30.07.2012

-removed-


Re: Pickup case help .. - Pokiri_Boii - 30.07.2012

Thanks Guyz Reputed yew both ..


Re: Pickup case help .. - Vince - 30.07.2012

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
pawn Код:
case heli:
{
    SetPlayerPos(playerid,-2383.6670,-1602.5835,507.5224);
    GameTextForPlayer(playerid, "~b~Teleported to ~g~Heli Stand", 3000, 5);
}
case heliout:
{
    SetPlayerPos(playerid,-2325.2319,-1613.5901,483.7204);
    GameTextForPlayer(playerid, "~b~Back ~r~Home", 3000, 5);
}
Learn how switch statements work.
How does that even work? The compiler cannot determine the values of these variables at compile time, so this shouldn't compile.


Re: Pickup case help .. - Pokiri_Boii - 30.07.2012

Its ok.. !!


Re: Pickup case help .. - SomebodyAndMe - 30.07.2012

Ok Vince, I have to go offtopic.

Your signature: "If your topic says "Help", I ignore it. Choose a descriptive title."

Topic name:
Pickup case 'help' ..

Did you just respond?
Yes you did ;p


Re: Pickup case help .. - ReneG - 30.07.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
How does that even work? The compiler cannot determine the values of these variables at runtime, so this shouldn't compile.
Didn't think about that. Edited my post.


Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
Ok Vince, I have to go offtopic.

Your signature: "If your topic says "Help", I ignore it. Choose a descriptive title."

Topic name:
Pickup case 'help' ..

Did you just respond?
Yes you did ;p
He corrected my misinforming post, and 'pickup case' is more descriptive than "HELP PLS REPP+++++"


Re: Pickup case help .. - SomebodyAndMe - 30.07.2012

But still he says he ignores the topic if it says 'help' no matter if he corrected you or not.


Re: Pickup case help .. - ReneG - 30.07.2012

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
But still he says he ignores the topic if it says 'help' no matter if he corrected you or not.
Just because 'help' was in the thread title, doesn't stop people from going through it. He went through it, saw my bad post, and corrected it. Anyways, this thread has strayed far enough off-topic.