SA-MP Forums Archive
What Wrong Here why error? - 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: What Wrong Here why error? (/showthread.php?tid=363727)



What Wrong Here why error? - Tuntun - 28.07.2012

Hey
Код:
F:\test.pwn(7) : warning 217: loose indentation
F:\test.pwn(14) : error 030: compound statement not closed at the end of file (started at line 6)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You are not in a vehicle!");
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, -1, "Your vehicle has been sucessfully repaired(fixed)!");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;



Re: What Wrong Here why error? - Kindred - 28.07.2012

Did you close the function? It says it started at line 6, which is the opening bracket, so make a closing bracket after return 1


Re: What Wrong Here why error? - BlackWolf120 - 28.07.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You are not in a vehicle!");
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, -1, "Your vehicle has been sucessfully repaired(fixed)!");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}//forgot that bracket!