SA-MP Forums Archive
Anyone can help me Please ?! - 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: Anyone can help me Please ?! (/showthread.php?tid=296459)



Anyone can help me Please ?! - Eug3N - 11.11.2011

I got this after compile
Код:
C:\Users\user\Desktop\samp03csvr_R2-2_win32\gamemodes\lvdm.pwn(956) : error 030: compound statement not closed at the end of file (started at line 936)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
this is the script
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new newcar = GetPlayerVehicleID(playerid);
	if(newcar == dr1)  // pui numele care l-ai pus la new si la masina respectiva,in caz ca adaugi alta
	{
        new PlayerName[MAX_PLAYER_NAME];
        new playerState = GetPlayerState(playerid);
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(strcmp(PlayerName, "dR.", true) == 0) // aici schimbi in numele jucatorului caruia vrei sa-i dai masina
        {
            SendClientMessage(playerid, 0xFF0000FF,"* E masina ta dR ! Bucura-te de Scriptul lui EugenEBv.");  //mesajul care apare cand intrii in masina
        }
        else if (playerState == PLAYER_STATE_PASSENGER)
        {
            SendClientMessage(playerid, 0xFF0000FF,"* Ai intrat in masina lui dR..");  // mesajul care apare pasagerilor
        }
        else
        {
            RemovePlayerFromVehicle(playerid);
            new Float:cx, Float:cy, Float:cz;
	        GetPlayerPos(playerid, cx, cy, cz);
	        SetPlayerPos(playerid, cx,  cy, cz);
            SendClientMessage(playerid, COLOR_RED,"* Aceasta masina ii apartine lui dR."); // mesajul care apare daca incearca cineva sa intre ca sofer ,dar nu este masina lui
	return 1;
}



Re: Anyone can help me Please ?! - Cypress - 11.11.2011

You forgot 2 brackets.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new newcar = GetPlayerVehicleID(playerid);
    if(newcar == dr1)  // pui numele care l-ai pus la new si la masina respectiva,in caz ca adaugi alta
    {
        new PlayerName[MAX_PLAYER_NAME];
        new playerState = GetPlayerState(playerid);
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(strcmp(PlayerName, "dR.", true) == 0) // aici schimbi in numele jucatorului caruia vrei sa-i dai masina
        {
            SendClientMessage(playerid, 0xFF0000FF,"* E masina ta dR ! Bucura-te de Scriptul lui EugenEBv.");  //mesajul care apare cand intrii in masina
        }
        else if (playerState == PLAYER_STATE_PASSENGER)
        {
            SendClientMessage(playerid, 0xFF0000FF,"* Ai intrat in masina lui dR..");  // mesajul care apare pasagerilor
        }
        else
        {
            RemovePlayerFromVehicle(playerid);
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
            SendClientMessage(playerid, COLOR_RED,"* Aceasta masina ii apartine lui dR."); // mesajul care apare daca incearca cineva sa intre ca sofer ,dar nu este masina lui
        } // 1
    } // 2
    return 1;
}



Re: Anyone can help me Please ?! - Eug3N - 11.11.2011

No ..this is not working..same problem
Код:
C:\Users\eBv\Desktop\samp03csvr_R2-2_win32\gamemodes\lvdm.pwn(957) : error 030: compound statement not closed at the end of file (started at line 933)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
but this time it is at 933 .. 933 is at
Код:
    new newcar = GetPlayerVehicleID(playerid);



Re: Anyone can help me Please ?! - Cypress - 11.11.2011

Sorry, I didn't noticed it before. However I don't know if that was the problem, the code compiles fine to me.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new newcar; // <
    newcar = GetPlayerVehicleID(playerid); // <
    if(newcar == dr1)  // pui numele care l-ai pus la new si la masina respectiva,in caz ca adaugi alta
    {
        new PlayerName[MAX_PLAYER_NAME];
        new playerState = GetPlayerState(playerid);
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(strcmp(PlayerName, "dR.", true) == 0) // aici schimbi in numele jucatorului caruia vrei sa-i dai masina
        {
            SendClientMessage(playerid, 0xFF0000FF,"* E masina ta dR ! Bucura-te de Scriptul lui EugenEBv.");  //mesajul care apare cand intrii in masina
        }
        else if (playerState == PLAYER_STATE_PASSENGER)
        {
            SendClientMessage(playerid, 0xFF0000FF,"* Ai intrat in masina lui dR..");  // mesajul care apare pasagerilor
        }
        else
        {
            RemovePlayerFromVehicle(playerid);
            new Float:cx, Float:cy, Float:cz;
            GetPlayerPos(playerid, cx, cy, cz);
            SetPlayerPos(playerid, cx,  cy, cz);
            SendClientMessage(playerid, COLOR_RED,"* Aceasta masina ii apartine lui dR."); // mesajul care apare daca incearca cineva sa intre ca sofer ,dar nu este masina lui
        } // 1
    } // 2
    return 1;
}