If statement condition not taking (playerid). -
Maheerali - 22.07.2016
PHP код:
new bool:Instafix[MAX_PLAYERS];
if (Instafix(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}
D:\SampSever\iPLEOMAX's TextDraw Editor\SAMP 0.3e Server\gamemodes\Untitled.pwn(219) : error 001: expected token: ";", but found ")"
D:\SampSever\iPLEOMAX's TextDraw Editor\SAMP 0.3e Server\gamemodes\Untitled.pwn(219) : error 029: invalid expression, assumed zero
I am using pwano
Re: If statement condition not taking (playerid). -
Sjn - 22.07.2016
When you create a player array, you cannot use () to wrap the playerid.
You need to do
Код:
if (Instafix[playerid] == true/false)
Also, you must assign true or false before checking for either one of it's state.
Quote:
Originally Posted by Maheerali
I am using pwano
|
Obviously...
Re: If statement condition not taking (playerid). -
K0P - 22.07.2016
Quote:
Originally Posted by Sjn
When you create a player array, you cannot use () to wrap the playerid.
You need to do
Код:
if (Instafix[playerid] == true/false)
Also, you must assign true or false before checking for either one of it's state.
|
Pawn will detect "if(Instafix[playerid])" as
true
And "if(!Instafix[playerid])" as
false
No need to add extra info there.
Quote:
Originally Posted by Sjn
Obviously...
|
Nop,he can use other editors too.
Код:
if (Instafix[playerid])
{
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
Re: If statement condition not taking (playerid). -
Maheerali - 22.07.2016
D:\SampSever\iPLEOMAX's TextDraw Editor\SAMP 0.3e Server\gamemodes\Untitled.pwn(159) : error 001: expected token: ";", but found "]"
Re: If statement condition not taking (playerid). -
K0P - 22.07.2016
Quote:
Originally Posted by Maheerali
D:\SampSever\iPLEOMAX's TextDraw Editor\SAMP 0.3e Server\gamemodes\Untitled.pwn(159) : error 001: expected token: ";", but found "]"
|
Show some previous lines
Re: If statement condition not taking (playerid). -
Maheerali - 22.07.2016
Quote:
Originally Posted by K0P
Pawn will detect "if(Instafix[playerid])" as true
And "if(!Instafix[playerid])" as false
No need to add extra info there.
Nop,he can use other editors too.
Код:
if (Instafix[playerid])
{
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
|
D:\SampSever\iPLEOMAX's TextDraw Editor\SAMP 0.3e Server\gamemodes\Untitled.pwn(159) : error 001: expected token: ";", but found "]"
Re: If statement condition not taking (playerid). -
Maheerali - 22.07.2016
CMD:armor(playerid, params[])
{
SetPlayerArmour(playerid, 100.00);
return 1;
}
CMD:fix(playerid, params[])
{
if (Instafix[playerid] == true)
{
RepairVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}
Re: If statement condition not taking (playerid). -
K0P - 22.07.2016
Код:
CMD:armor(playerid, params[])
{
SetPlayerArmour(playerid, 100.00);
return 1;
}
CMD:fix(playerid, params[])
{
if (Instafix[playerid] == true)
{
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
Re: If statement condition not taking (playerid). -
Maheerali - 22.07.2016
Quote:
Originally Posted by K0P
Код:
CMD:armor(playerid, params[])
{
SetPlayerArmour(playerid, 100.00);
return 1;
}
CMD:fix(playerid, params[])
{
if (Instafix[playerid] == true)
{
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
|
Still Error please help
Re: If statement condition not taking (playerid). -
SyS - 22.07.2016
brace is missing @ the end of 2nd cmd