Taxi cars [help] - 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: Taxi cars [help] (
/showthread.php?tid=576682)
Taxi cars [help] -
Sn4ke2 - 06.06.2015
hello guys, i want to make Taxi Cars on rank's and i have too error's
this is the script
PHP код:
if(newcar == taxic[6]) // Rank Masini Taxi
{
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
if(PlayerInfo[playerid][pRank] > 6) { }
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 6.");
RemovePlayerFromVehicleEx(playerid);
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 6.");
RemovePlayerFromVehicleEx(playerid);
}
else if(newcar == taxic[4])
{
//if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
//{
if(PlayerInfo[playerid][pRank] > 4) { }
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 4.");
RemovePlayerFromVehicleEx(playerid);
}
//}
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 4.");
RemovePlayerFromVehicleEx(playerid);
}
}
and this is the error's
PHP код:
Current directory: C:\Documents and Settings\Pc\Desktop\Gamelife\gamemodes
Gamelife.pwn(8780) : error 029: invalid expression, assumed zero
Gamelife.pwn(8780) : warning 215: expression has no effect
Gamelife.pwn(8780) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
What it's wrong ?
Re: Taxi cars [help] -
JaydenJason - 06.06.2015
missing semicolon, what line is 8780?
Re: Taxi cars [help] -
Sn4ke2 - 06.06.2015
This is on line 8780
PHP код:
else if(newcar == taxic[4])
Re: Taxi cars [help] -
Vince - 06.06.2015
You can not have "else if" if you already had "else". Either something is true or it's not. There's no third option.
Re: Taxi cars [help] -
Sn4ke2 - 06.06.2015
Yeh ? How to continue function if can not use elseif ?
Re: Taxi cars [help] -
nezo2001 - 06.06.2015
PHP код:
if(newcar == taxic[6]) // Rank Masini Taxi
{
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
if(PlayerInfo[playerid][pRank] > 6) { }
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 6.");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(newcar == taxic[4])
{
//if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
//{
if(PlayerInfo[playerid][pRank] > 4) { }
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 4.");
RemovePlayerFromVehicleEx(playerid);
}
//}
else //Here should be another condition and should be else if not else cuz in the If...Else staments can be only one else not more than
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 6.");
RemovePlayerFromVehicleEx(playerid);
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 4.");
RemovePlayerFromVehicleEx(playerid);
}
}