SA-MP Forums Archive
Error Need 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error Need Help (/showthread.php?tid=256283)



Error Need Help - Angel- - 20.05.2011

Код:
C:\Users\Administrator\Desktop\AC-RP\AC-RP\gamemodes\AndreasCityRP.pwn(30255) : error 001: expected token: "*then", but found "{"
Код:
			else if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
			{
			 if IsPlayerInVehicle(playerid, 515)
this is line 30255	 { 
			    if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
			  	else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** %s(CB Radio): %s **", sendername, result); }
			 }
			 else
			 {
			 SendClientMessage(playerid, COLOR_GRAD2, "   You are not in the transport !");
			 return 1;
			 }
				{
					format(string, sizeof(string), "** %s(CB Radio): %s, over. **", sendername, result);
				}
				SendRadioMessage(17, TEAM_RADIO_COLOR, string);
				printf("%s", string);
				return 1;
			}



Re: Error Need Help - Backwardsman97 - 20.05.2011

pawn Код:
if(IsPlayerInVehicle(playerid, 515))



Re: Error Need Help - Angel- - 20.05.2011

ok so it compiles but even if i am in the truck it jumps to the line that says i am not in a truck


Re: Error Need Help - Toreno - 20.05.2011

It seems like your whole code is messed up, how did you open brackets without an if or anything else.


Re: Error Need Help - Vince - 20.05.2011

Looks like another classic case of a vehicleid/modelid mix-up. Please learn the difference between the two.
modelid != vehicleid


Re: Error Need Help - Angel- - 20.05.2011

so what do i do
i only want the radio to work if your in the truck
i am trying but its harder than coding lua its some what smiler but not the same


Re: Error Need Help - MadeMan - 20.05.2011

pawn Код:
if(IsPlayerInTruck(playerid))
pawn Код:
stock IsPlayerInTruck(playerid)
{
    switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
    {
        case 515: return 1;
    }
    return 0;
}



Re: Error Need Help - Angel- - 20.05.2011

Thank You Very Much MadeMan I Put Credits To You Be Side That Line In My Script