SA-MP Forums Archive
Why isn't this working ? - 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: Why isn't this working ? (/showthread.php?tid=367538)



Why isn't this working ? - LukeTheMajor - 10.08.2012

Hi there!

Just wondering what the issue was with this

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1)
	}
    SetPlayerWantedLevel(playerid, 0);
    SetPlayerInterior(playerid, 10);
    SetPlayerPos(playerid,263.9106,77.6354,1001.0391);
	{
	else
	}
    SendClientMessage(playerid, 0xFFFF00C8, "- - - - Los Santos Police Department - - - - ");
    SendClientMessage(playerid, 0x80404000, "This is where criminals hand them selfs in");
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}
Doesn't seem to be working.


Re: Why isn't this working ? - KingyKings - 10.08.2012

Quote:
Originally Posted by LukeTheMajor
Посмотреть сообщение
Hi there!

Just wondering what the issue was with this

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1)
	}
    SetPlayerWantedLevel(playerid, 0);
    SetPlayerInterior(playerid, 10);
    SetPlayerPos(playerid,263.9106,77.6354,1001.0391);
	{
	else
	}
    SendClientMessage(playerid, 0xFFFF00C8, "- - - - Los Santos Police Department - - - - ");
    SendClientMessage(playerid, 0x80404000, "This is where criminals hand them selfs in");
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}
Doesn't seem to be working.
Your brackets

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1)
	{
    SetPlayerWantedLevel(playerid, 0);
    SetPlayerInterior(playerid, 10);
    SetPlayerPos(playerid,263.9106,77.6354,1001.0391);
	}
	else
	{
    SendClientMessage(playerid, 0xFFFF00C8, "- - - - Los Santos Police Department - - - - ");
    SendClientMessage(playerid, 0x80404000, "This is where criminals hand them selfs in");
	return 1;
       }
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}



Re: Why isn't this working ? - LukeTheMajor - 10.08.2012

Thank you,

Do you know what would be causing this though ?

function "OnPlayerEnterCheckpoint" should return a value

It is something to do with that code because it was fine before I added it earlier


Re: Why isn't this working ? - IceMeteor - 10.08.2012

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1)
    {
        SetPlayerWantedLevel(playerid, 0);
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid,263.9106,77.6354,1001.0391);
    }
    else
    {
        SendClientMessage(playerid, 0xFFFF00C8, "- - - - Los Santos Police Department - - - - ");
        SendClientMessage(playerid, 0x80404000, "This is where criminals hand them selfs in");
    }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}
Your mistakes is on the usage of { and }


Re: Why isn't this working ? - LukeTheMajor - 10.08.2012

Quote:
Originally Posted by IceMeteor
Посмотреть сообщение
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1)
    {
        SetPlayerWantedLevel(playerid, 0);
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid,263.9106,77.6354,1001.0391);
    }
    else
    {
        SendClientMessage(playerid, 0xFFFF00C8, "- - - - Los Santos Police Department - - - - ");
        SendClientMessage(playerid, 0x80404000, "This is where criminals hand them selfs in");
    }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}
Your mistakes is on the usage of { and }
Ahh,

Hi there that works ! great thank you mate.