warning 211: possibly unintended assignment - 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)
+--- Thread: warning 211: possibly unintended assignment (
/showthread.php?tid=643881)
warning 211: possibly unintended assignment -
n00blek - 29.10.2017
http://prntscr.com/h3i4z8
errors:
PHP код:
C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\AdminPlugin.pwn(938) : warning 211: possibly unintended assignment
C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\AdminPlugin.pwn(942) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
raw code:
https://pastebin.com/QhMnhKt8
Re: If errors. simple af but i like to complicate things -
Konstantinos - 29.10.2017
You check if X is equal to Y using double "equal sign"
pawn Код:
// correct:
if (X == 1)
// wrong:
if (X = 1)
Re: If errors. simple af but i like to complicate things -
Zeth - 29.10.2017
PHP код:
switch(dialogid)
{
case DIALOG_RENT_PRODUZI:
{
if(!response)
{
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
RentaVozilo[playerid] = 0;
SCM(playerid,COLOR_RED,"[RMT Rent a car]:Odustali ste od produzetka renta vozila!");
IzvanRentVozila[playerid] = 1;
SacuvajRentPoruku[playerid] = 0;
return 1;
}
new vehid = GetPlayerVehicleID(playerid);
if(VoziloZaRent[vehid] == 1)
{
if(RentaVozilo[playerid] == 0)
{
if(VoziloRentano[vehid] == 0)
{
if(GetPlayerMoney(playerid) >= RENT_CIJENA_PREMIER)
{
VoziloRentano[vehid] = 1;
RentaVozilo[playerid] = 1;
IDRentVozila[playerid] = vehid;
GivePlayerMoney(playerid,-RENT_CIJENA_PREMIER);
TogglePlayerControllable(playerid,1);
SetTimerEx("DialogRentProduzi", 300000, false, "i", playerid);
IzvanRentVozila[playerid] = 0;
SacuvajRentPoruku[playerid] = 0;
}
else
{
SCM(playerid,COLOR_RED,"[RMT Rent a car]:Nemate dovoljno novca, da rentate ovo vozilo!");
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
IzvanRentVozila[playerid] = 1;
SacuvajRentPoruku[playerid] = 0;
}
}
}
if(IzvanRentVozila[playerid] == 1)
{
SacuvajRentPoruku[playerid] = 1;
}
if(SacuvajRentPoruku[playerid] == 1)
{
new str[400];
format(str,sizeof(str),""COL_RED"----------------------------\n"COL_WHITE"Dali zelite produziti rentanje vaseg vozila za 5 minuta za istu cijenu kao na pocetku?\n----------------------------");
Dialog(playerid,DIALOG_RENT_PRODUZI,DIALOG_STYLE_MSGBOX,""COL_BLUE"Produzetak renta:",str,""COL_WHITE"Produzi",""COL_WHITE"Odustani");
}
}
return 1;
}
}
return 1;
}
Try this.
Actually it should be
if(IzvanRentVozila[playerid] == 1) instead of a single "=" there.
EDIT: a bit late than Konstantinos
Re: If errors. simple af but i like to complicate things -
n00blek - 29.10.2017
ooooh what stupid mistakes i was just copy pyasting from above.
lol that seems funny
rep both of you just bcz of my stupidity