Few warning and error
#1

pawn Код:
warning 219: local variable "X" shadows a variable at a preceding level
 warning 219: local variable "Y" shadows a variable at a preceding level
 warning 219: local variable "Z" shadows a variable at a preceding level
 error 035: argument type mismatch (argument 2)
 warning 213: tag mismatch
 warning 213: tag mismatch
 warning 213: tag mismatch
 warning 203: symbol is never used: "Z"
 warning 203: symbol is never used: "Y"
 warning 203: symbol is never used: "X"
Warnings and error.

Code:
pawn Код:
case 1:
        {
       
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        PlayerInfo[playerid][X1] = X;
        PlayerInfo[playerid][Y1] = Y;
        PlayerInfo[playerid][Z1] = Z;
        dini_IntSet(file, "Money", GetPlayerCash(playerid));
                dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
                dini_IntSet(file, "Frank",PlayerInfo[playerid][pFrank]);
        dini_IntSet(file, "Interior",PlayerInfo[playerid][pInterior]);
        dini_IntSet(file, "Skin",GetPlayerSkin(playerid));
        dini_IntSet(file, "Faction",PlayerInfo[playerid][pFaction]);
        dini_IntSet(file, "Sex",PlayerInfo[playerid][pGender]);
       
        dini_FloatSet(file, "Posx",PlayerInfo[playerid][X1]);
        dini_FloatSet(file, "Posy",PlayerInfo[playerid][Y1]);
        dini_FloatSet(file, "Posz",PlayerInfo[playerid][Z1]);
       
        }
This is under OnPlayerDiscconect, thanks in advance.
Reply
#2

pawn Код:
new Float:X, Float:Y, Float:Z;
either delete that line or rename the variables as they are already defined somewhere else.
Reply
#3

Ive check my script, they aren't, but ill try renaming, and god damn you posted quick.
Reply
#4

pawn Код:
(896) : error 035: argument type mismatch (argument 2)
Is the only error, along side the warnings.

Line 896:
pawn Код:
GetPlayerPos(playerid, X, Y, Z);
Reply
#5

Quote:
Originally Posted by Anthonyx3'
Посмотреть сообщение
pawn Код:
(896) : error 035: argument type mismatch (argument 2)
Is the only error, along side the warnings.

Line 896:
pawn Код:
GetPlayerPos(playerid, X, Y, Z);
There's nothing wrong with that if you have defined the variables properly like: Float:X.

Edit:
pawn Код:
case 1:
        {

        new Float:pX, Float:pY, Float:pZ;
        GetPlayerPos(playerid, pX, pY, pZ);
        PlayerInfo[playerid][X1] = pX;
        PlayerInfo[playerid][Y1] = pY;
        PlayerInfo[playerid][Z1] = pZ;
        dini_IntSet(file, "Money", GetPlayerCash(playerid));
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file, "Frank",PlayerInfo[playerid][pFrank]);
        dini_IntSet(file, "Interior",PlayerInfo[playerid][pInterior]);
        dini_IntSet(file, "Skin",GetPlayerSkin(playerid));
        dini_IntSet(file, "Faction",PlayerInfo[playerid][pFaction]);
        dini_IntSet(file, "Sex",PlayerInfo[playerid][pGender]);

        dini_FloatSet(file, "Posx",PlayerInfo[playerid][X1]);
        dini_FloatSet(file, "Posy",PlayerInfo[playerid][Y1]);
        dini_FloatSet(file, "Posz",PlayerInfo[playerid][Z1]);

        }
Reply
#6

pawn Код:
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
PlayerInfo[playerid][X1] = pX;
PlayerInfo[playerid][Y1] = pY;
PlayerInfo[playerid][Z1] = pZ;
Reply
#7

Edit: question answered above
Reply
#8

Lolz, exactly the same actually.
Reply
#9

Another question, why isnt my position being written to my char file at all, disconnect code:
pawn Код:
dini_FloatSet(file, "pX",PlayerInfo[playerid][X1]);
        dini_FloatSet(file, "pY",PlayerInfo[playerid][Y1]);
        dini_FloatSet(file, "pX",PlayerInfo[playerid][Z1]);
Connect Code:
pawn Код:
PlayerInfo[playerid][X1] = dini_Float(file, "pX");

            PlayerInfo[playerid][Y1] = dini_Float(file, "pY");

            PlayerInfo[playerid][Z1] = dini_Float(file, "pZ");

           

            SetSpawnInfo(playerid, PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][X1], PlayerInfo[playerid][Y1], PlayerInfo[playerid][Z1], 1.0, -1, -1, -1, -1, -1, -1);

            SpawnPlayer(playerid);
Spawns player at 0.0 and doesnt show the pos in the user file.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)