Err's :@
#1

pawn Код:
#include <a_samp>

stock LazerStatus(playerid)    // this is a laser system
{
SetPVarInt(playerid, "laser", 0) return SetPVarInt(playerid, "laser", 1);
SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));  
ApplyAnimation(playerid,"PYTHON","python_crouchreload",4.1,0,0,0,0,0,1); // animation while loading laser pointer
}
else if(SetPVarInt(playerid, "laser", 1)); return SetPVarInt(playerid, "laser", 0); //Line 10
}
return 1; //Line 12
}
pawn Код:
D:\SA-MP Server\pawno\new.pwn(10) : error 010: invalid function or declaration
D:\SA-MP Server\pawno\new.pwn(12) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Your calling a "else if" while you never called a single if statement in your stock
Try this:
pawn Код:
stock LazerStatus(playerid)    // this is a laser system
{
    if(SetPVarInt(playerid, "laser", 1));
    {
        SetPVarInt(playerid, "laser", 0);
    }
    else
    {
        SetPVarInt(playerid, "laser", 0) return SetPVarInt(playerid, "laser", 1);
        SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));  
        ApplyAnimation(playerid,"PYTHON","python_crouchreload",4.1,0,0,0,0,0,1); r
    }
    return 1;
}
Reply
#3

It will set laser to 1 and that's it - the rest of the code won't be called because you used return. You also need to GetPVarInt and not set in the if check. It's also pointless to set an already set value (the color).

pawn Код:
stock LazerStatus(playerid)
{
    if (!GetPVarInt(playerid, "laser")
    {
        SetPVarInt(playerid, "laser", 1);
        ApplyAnimation(playerid,"PYTHON","python_crouchreload",4.1,0,0,0,0,0,1); // animation while loading laser pointer
    }
    else SetPVarInt(playerid, "laser", 0);
}
Reply
#4

pawn Код:
stock LazerStatus(playerid)    // this is a laser system
{
    if(SetPVarInt(playerid, "laser", 0))
    {
        SetPVarInt(playerid, "laser", 1);
        SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));  
        ApplyAnimation(playerid,"PYTHON","python_crouchreload",4.1,0,0,0,0,0,1);
    }
    else
    {
        SetPVarInt(playerid, "laser", 0);
    }
    return 1;
}
Your error was
pawn Код:
else if(SetPVarInt(playerid, "laser", 1)); return SetPVarInt(playerid, "laser", 0); //Line 10
You had a Semi Colon.
Reply
#5

[QUOTE=J4mmyHD;2836579]
pawn Код:
stock LazerStatus(playerid)    // this is a laser system
{
    if(SetPVarInt(playerid, "laser", 0))
    { // 7556 Line
        SetPVarInt(playerid, "laser", 1);
        SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));  
        ApplyAnimation(playerid,"PYTHON","python_crouchreload",4.1,0,0,0,0,0,1);
    }
    else
    {
        SetPVarInt(playerid, "laser", 0);
    }
    return 1;
}
pawn Код:
D:\SA-MP Server\gamemodes\Raza.pwn(7556) : error 001: expected token: ")", but found "{"
Reply
#6

pawn Код:
if(SetPVarInt(playerid, "laser", 0)) // lool?
    {
use this

pawn Код:
if(GetPVarInt(playerid, "laser") == 0)
    {
Reply
#7

hmm brah's still not working can any one conevert it into OnPlayerKeyStateChange YES key?
Reply
#8

bump :/
Reply
#9

Allright uhm, try this
pawn Код:
//on top of your script
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_YES))
    {
        if (!GetPVarInt(playerid, "laser")
        {
            SetPVarInt(playerid, "laser", 1);
            ApplyAnimation(playerid,"PYTHON","python_crouchreload",4.1,0,0,0,0,0,1);
        }
        else SetPVarInt(playerid, "laser", 0);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)