How can I fix thoose
#1

I know, these are just warnings, but I like to keep my script clean on warnings:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new vehicle;
    vehicle = GetPlayerVehicleID(playerid);
    if(vehicle = 432)
    {
    if(Rank < 2) return SCM(playerid, COLOR_BRIGHTRED, "You need to be rank 2 to use tanks");
    }
    return 1;
}
Код:
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\GAMEMO~1\FLHP2.pwn(1854) : warning 211: possibly unintended assignment
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\GAMEMO~1\FLHP2.pwn(1856) : warning 213: tag mismatch
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\GAMEMO~1\FLHP2.pwn(1856) : warning 206: redundant test: constant expression is non-zero
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\GAMEMO~1\FLHP2.pwn(1854) : warning 204: symbol is assigned a value that is never used: "vehicle"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
EDIT:
BTW and players with rank less than 2 can enter tanks, and when u are rank 6 it still shows the msg, and btw how can i make it to eject a player if he isnt rank 2
Reply
#2

Not:
pawn Код:
if(vehicle = value)
But:
pawn Код:
if(vehicle == value)
Read about statements here: https://sampwiki.blast.hk/wiki/For
Reply
#3

Код:
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\GAMEMO~1\FLHP2.pwn(1856) : warning 213: tag mismatch
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\GAMEMO~1\FLHP2.pwn(1856) : warning 206: redundant test: constant expression is non-zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
EDIT: now it doesnt even send a msg if you are rank 2 below
Reply
#4

Код:
if(vehicle == 432)
@Cameltoe: nice "mini" typo ^^
Reply
#5

Quote:
Originally Posted by Babul
Посмотреть сообщение
Код:
if(vehicle == 432)
@Cameltoe: nice "mini" typo ^^
Lol, noticed xD..
Reply
#6

Please, return on topic...
Reply
#7

pawn Код:
new Rank = 5;

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new
        vehicle = GetPlayerVehicleID(playerid);
    if(vehicle == 432)
    {
    if(Rank < 2) return SendClientMessage(playerid, COLOR_RED, "You need to be rank 2 to use tanks");
    }
    return 1;
}
Compiled fine here.. how did you define the Rank?
Reply
#8

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
new Rank = 5;

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new
        vehicle = GetPlayerVehicleID(playerid);
    if(vehicle == 432)
    {
    if(Rank < 2) return SendClientMessage(playerid, COLOR_RED, "You need to be rank 2 to use tanks");
    }
    return 1;
}
Compiled fine here.. how did you define the Rank?
I think that 'rank' should be an array, so that all players's ranks can be stored there.

pawn Код:
new rank[MAX_PLAYERS];
Reply
#9

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
I think that 'rank' should be an array, so that all players's ranks can be stored there.

pawn Код:
new rank[MAX_PLAYERS];
Yeah, i just added the variable so it would compile
Reply
#10

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Yeah, i just added the variable so it would compile
He already has it, in an enum structure.

Quote:
Originally Posted by Mean
Посмотреть сообщение
..., this is my rank info:
pawn Код:
enum Info
{
   AdminLevel,
   Rank,
}
new PlayerInfo[MAX_PLAYERS][Info];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)