SA-MP Forums Archive
Enter City Hall problem... +REP - 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: Enter City Hall problem... +REP (/showthread.php?tid=330624)



Enter City Hall problem... +REP - TheMightyEddy - 01.04.2012

So I have the coordinates here for the Los Santos city hall...

entering city hall (outside city hall where icon should be)
Код:
119,1458.8438,-1012.3053,26.8438,179.3265,0,0,0,0,0,0

And when player is inside city hall
Код:
119,387.5417,173.6052,1008.3828,89.7358,0,0,0,0,0,0
I would like a red checkpoint or a yellow information icon to be where the first coordinate is so when someone goes there, all they have to do is type /enter and and they go into city hall which means they will go into the second coordinate (inside city hall).

And when they're inside city hall, all they have to do is be beside where coordinate #2 is and type /exit and they will exit city hall and be teleported to coordinate #1 which is outside city hall where they can enter again. How can I do this? +REP


Re: Enter City Hall problem... +REP - TzAkS. - 01.04.2012

Код:
new cityhall;
OnGameModeInit

Код:
cityhall= CreatePickup(1239, 23, 119,1458.8438,-1012.3053,26.8438,179.3265, -1);
OnPlayerPickUpPickup(playerid, pickupid)

Код:
if (pickupid == cityhall)
    {
        // Something here like gametextforplayer or sendclientmessage or setplayerpos
    }
And you need to make a enter command.

Код:
if(strcmp(cmdtext, "/enter", true) == 0)
    {
	 if PlayerToPoint(5,playerid,1458.8438,-1012.3053,26.8438)
	{
	SetPlayerPos(playerid,387.5417,173.6052,1008.3828);
	SetPlayerInterior(playerid, Interior ID);
	return 1;
	}
	}
And exit command

Код:
if(strcmp(cmdtext, "/exit", true) == 0)
    {
	 if PlayerToPoint(5,playerid,387.5417,173.6052,1008.3828)
	{
	SetPlayerPos(playerid,1458.8438,-1012.3053,26.8438);
	SetPlayerInterior(playerid, 0);
	return 1;
	}
	}



Re: Enter City Hall problem... +REP - TheMightyEddy - 02.04.2012

Thanks for your help but when I put the first 3 codes, I get 3 warnings:

Код:
warning 213: tag mismatch
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
And I don't know where to put the last two codes under which callout?


Re: Enter City Hall problem... +REP - TzAkS. - 02.04.2012

My bad
cityhall = CreatePickup(1239, 23, 1458.8438, -1012.3053, 26.8438, -1);

The last?Do you mean /exit and /enter?
OnPlayerCommandText just search for a command and copy it there.


Re: Enter City Hall problem... +REP - TheMightyEddy - 02.04.2012

Okay well this is what I have now:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/enter", true) == 0)
    {
	 if PlayerToPoint(5,playerid,1458.8438,-1012.3053,26.8438)
	{
	SetPlayerPos(playerid,387.5417,173.6052,1008.3828);
	SetPlayerInterior(playerid, Interior ID);
	return 1;
	}

	if(strcmp(cmdtext, "/exit", true) == 0)
    {
	 if PlayerToPoint(5,playerid,387.5417,173.6052,1008.3828)
	{
	SetPlayerPos(playerid,1458.8438,-1012.3053,26.8438);
	SetPlayerInterior(playerid, 0);
	return 1;
	}
}
And here are the errors that it gives me:

Код:
error 004: function "ResetGVars" is not implemented
error 017: undefined symbol "PlayerName"
error 017: undefined symbol "LogPlayer"
error 017: undefined symbol "PlayerName"
error 017: undefined symbol "RegisterPlayer"
error 004: function "RemoveVariables" is not implemented
error 017: undefined symbol "SelectSkill"
error 004: function "SendCopMessage" is not implemented
error 004: function "SendCopMessage" is not implemented
error 004: function "IncreaseWantedLevel" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
error 004: function "getCheckpointType" is not implemented
There are a lot of repeated errors but on different lines.
Please help me someone! +REP!


Re: Enter City Hall problem... +REP - TheMightyEddy - 02.04.2012

Anyone please?


Re: Enter City Hall problem... +REP - TzAkS. - 02.04.2012

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/enter", true) == 0)
    {
	 if PlayerToPoint(5,playerid,1458.8438,-1012.3053,26.8438)
	{
	SetPlayerPos(playerid,387.5417,173.6052,1008.3828);
	SetPlayerInterior(playerid, Interior ID);
	return 1;
	}
   }

	if(strcmp(cmdtext, "/exit", true) == 0)
    {
	 if PlayerToPoint(5,playerid,387.5417,173.6052,1008.3828)
	{
	SetPlayerPos(playerid,1458.8438,-1012.3053,26.8438);
	SetPlayerInterior(playerid, 0);
	return 1;
	}
}



Re: Enter City Hall problem... +REP - TheMightyEddy - 02.04.2012

Still with errors....


Re: Enter City Hall problem... +REP - TzAkS. - 02.04.2012

Here public OnPlayerCommandText(playerid, cmdtext[]) you got just this commands?
That errors is becouse is missing "}" somewhere


Re: Enter City Hall problem... +REP - TheMightyEddy - 02.04.2012

Where is it missing at? Can you please give me the whole previous code without the missing }? Thanks so much.