More than code under OnPlayerEnterVehicle.
#1

Hey,

I have a problem, when i try to add more than one code under OnPlayerEnterVehicle it does not work, one compiles fine tho

here is my code;

pawn Код:
if (GVM(vehicleid) == 534 || GVM(vehicleid) == 566 || GVM(vehicleid) == 535 || GVM(vehicleid) == 567 || GVM(vehicleid) == 412 && GPS(playerid) == 114 || GPS(playerid) == 115 || GPS(playerid) == 116 || GPS(playerid) == 173 || GPS(playerid) == 174 || GPS(playerid) == 175 || GPS(playerid) == 48)
    {
    SendClientMessage(playerid,0xFFFFFFAA,"Welcome to your faction's vehicle!");
    }
    else
    {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
                SetPlayerPos(playerid, X, Y, Z);
                SendClientMessage(playerid,0x63AFF00A,"You don't have the keys for this vehicle!");
                }
                return 1;
        }
then here it is with more than just that one;

pawn Код:
if (GVM(vehicleid) == 534 || GVM(vehicleid) == 566 || GVM(vehicleid) == 535 || GVM(vehicleid) == 567 || GVM(vehicleid) == 412 && GPS(playerid) == 114 || GPS(playerid) == 115 || GPS(playerid) == 116 || GPS(playerid) == 173 || GPS(playerid) == 174 || GPS(playerid) == 175 || GPS(playerid) == 48)
    {
    SendClientMessage(playerid,0xFFFFFFAA,"Welcome to your faction's vehicle!");
    }
    else
    {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
                SetPlayerPos(playerid, X, Y, Z);
                SendClientMessage(playerid,0x63AFF00A,"You don't have the keys for this vehicle!");
                }
                return 1;
        }

    else if (GVM(vehicle) == 567 && GPS(playerid) == 109)
    {
        SendClientMessage(playerid,0xFFFFFFAA,"Welcome to your faction's vehicle!");
    }
    else
    {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
                SetPlayerPos(playerid, X, Y, Z);
                SendClientMessage(playerid,0x63AFF00A,"You don't have the keys for this vehicle!");
                }
                return 1;
        }
NOTE; GVM is for GetVehicleModel and GPS is for GetPlayerSkin

I then get these erros/warnings;

Код:
 : 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
 : 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 010: invalid function or declaration
 : error 010: invalid function or declaration
 : error 021: symbol already defined: "GetPlayerPos"
 : error 010: invalid function or declaration
: warning 203: symbol is never used: "X"
: warning 203: symbol is never used: "Y"
 : warning 203: symbol is never used: "Z"
all of which feature on the lines i've submitted.

Any help pls?
Reply
#2

Show complete ONPlayerEnterVehicle(onpastebin).
Reply
#3

http://pastebin.com/m29798fe0

Thts the one with errors.
Reply
#4

Try:
http://pastebin.com/m129d2979
Reply
#5

Thanks, that has helped, only i get these errors now;

Код:
error 029: invalid expression, assumed zero
: warning 215: expression has no effect
 : error 001: expected token: ";", but found "if"
error is on this line;

pawn Код:
else if (GVM(vehicleid) == 567 && GPS(playerid) == 109)
:S
Reply
#6

for which lines?
Reply
#7

I already edited previous post with the line

pawn Код:
else if (GVM(vehicleid) == 567 && GPS(playerid) == 109)
all on that one
Reply
#8

GPS[playerid] instead of GPS(playerid)
Reply
#9

that just gives me more errors
Reply
#10

if -> else -> else if -> else

It just doesn't work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)