Help here
#1

Код:
C:\Users\Robins\Desktop\Rebound Roleplay server\pawno\include\/CRP/Publics/AttachObjectCorrectly.pwn(2) : warning 219: local variable "object" shadows a variable at a preceding level
code
pawn Код:
forward AttachObjectCorrectly(playerid, object);
public AttachObjectCorrectly(playerid, object)
{
    if(object == 1550)
    {
        SetPlayerAttachedObject(playerid, 3,1550,3,0.1,0.1,-0.1,0.0,270.0,0.0);
    }
    else if(object == 373)
    {
        SetPlayerAttachedObject(playerid, 3,373,1,0.3,-0.0,-0.1,70.0,25.0,35.0);
    }
    else if(object == 2992)
    {
        SetPlayerAttachedObject(playerid, 3,2992,2,0.2,0.0,0.0,0.0,90.0,0.0);
    }
    else if(object == 3265)
    {
        SetPlayerAttachedObject(playerid, 3,3265,1,-0.5,0.0,0.0,0.0,90.0,180.0);
    }
    else if(object == 1575)
    {
        SetPlayerAttachedObject(playerid, 3,1575,6,0.0,0.0,0.0,0.0,90.0,0.0);
    }
    else if(object == 1210)
    {
        SetPlayerAttachedObject(playerid, 3,1210,5,0.3,0.1,0.0,0.0,270.0,0.0);
    }
    else if(object == 3026)
    {
        SetPlayerAttachedObject(playerid, 3,3026,1,-0.1,-0.0,0.0,0.0,0.0,0.0);
    }
    else if(object == 2054)
    {
        SetPlayerAttachedObject(playerid, 3,2054,2,0.1,0.0,-0.0,0.0,90.0,180.0);
    }
    else if(object == 2053)
    {
        SetPlayerAttachedObject(playerid, 3,2053,2,0.1,0.0,0.0,0.0,90.0,0.0);
    }
    else if(object == 2052)
    {
        SetPlayerAttachedObject(playerid, 3,2052,2,0.1,0.0,0.0,0.0,90.0,0.0);
    }
    else return SendClientMessage(playerid, COLOR_GREY,"[DEBUG]: Unkown Object, Contact a developer!");
    return 1;
}
Reply
#2

Ermmm, you have "object" define before this function is called.
Reply
#3

You have

pawn Код:
new object;
Somewhere in your script, you can either change your script around, or modify the function you're creating. I also recommend using a switch statement rather than a bunch of if statements.

pawn Код:
switch ( object )
{
case 1550:
{
}
// ect.
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)