How can I fix thoose - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can I fix thoose (
/showthread.php?tid=184180)
How can I fix thoose -
Mean - 18.10.2010
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
Re: How can I fix thoose -
Cameltoe - 18.10.2010
Not:
But:
Read about statements here:
https://sampwiki.blast.hk/wiki/For
Re: How can I fix thoose -
Mean - 18.10.2010
Код:
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
Re: How can I fix thoose -
Babul - 18.10.2010
@Cameltoe: nice "mini" typo ^^
Re: How can I fix thoose -
Cameltoe - 18.10.2010
Quote:
Originally Posted by Babul
@Cameltoe: nice "mini" typo ^^
|
Lol, noticed xD..
Re: How can I fix thoose -
Mean - 18.10.2010
Please, return on topic...
Re: How can I fix thoose -
Cameltoe - 18.10.2010
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?
Re: How can I fix thoose -
Hiddos - 18.10.2010
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.
Re: How can I fix thoose -
Cameltoe - 18.10.2010
Quote:
Originally Posted by Hiddos
I think that 'rank' should be an array, so that all players's ranks can be stored there.
|
Yeah, i just added the variable so it would compile
How can I fix thoose -
[NoV]LaZ - 18.10.2010
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];
|