SA-MP Forums Archive
[Tutorial] Entering building when enters CP - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Entering building when enters CP (/showthread.php?tid=194471)



Entering building when enters CP - Sub Zero - 29.11.2010

Here is some easy tutorial.

What is this tutorial about?
You enter a checkpoint and it shows you a dialog"do you want to enter building or not".
YOU MUST HAVE STREAMER PLUGIN


So lets start..

On top of your script add

Code:
new hello;
Under public OnGameModeInIt add

Code:
hello = CreateDynamicCP(x,y,z, 1.5, -1, -1, -1, 40.0);
Find public OnPlayerEnterDynamicCP i under it add

Code:
if(checkpointid == hello) ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX," Do you want to enter this building",tempstring,"Yes","No");
Now we need to make what will happen if player chooses "Yes"

Under OnDialogResponse add

Code:
if(dialogid == 1 && response)
 {
SetPlayerPos(playerid,x,y,z);
}
If you get error that tempstring is not defined,under public OnPlayerEnterDynamicCP
add

Code:
new tempstring[100];
Sorry for my bad English,Im from Bosnia
dont watch posts,This is my first post on this forum because I come from balkan-samp.com


Re: Entering building when enters CP - Tee - 29.11.2010

Nice tut. But you forgot to say that where you have example (SetPlayerPos(playerid,x,y,z)) the x,y and z are where they are to Set the players position after the response 1.


Re: Entering building when enters CP - Sub Zero - 30.11.2010

didnt thought I need to do it..

Oh yes I forgot to say,you can enter building with car,so to prevent that you just need to add IsPlayerInAnyVehicle,RemovePlayerFromVehicle and SetPlayerPos
Code:
if(dialogid == 1 && response)
 {
SetPlayerPos(playerid,x,y,z);
}



Re: Entering building when enters CP - the.et - 31.12.2011

i kept on getting the error "error 017: undefined symbol "checkpointid" please help.


Re: Entering building when enters CP - Mr.Dexter - 31.03.2013

i get this

C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(6105) : error 021: symbol already defined: "Streamer_OnGameModeInit"
C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(610 : error 021: symbol already defined: "OnPlayerEnterDynamicCP"
C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(6109) : error 010: invalid function or declaration
C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(6112) : error 010: invalid function or declaration
C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(6116) : warning 203: symbol is never used: "Tempstring"
C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(6116) : warning 203: symbol is never used: "hello"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Re: Entering building when enters CP - thefatshizms - 31.03.2013

This isn't a tutorial.. Once again it's one of those "put this there" "put that there" "copy this there".

Explain what each function is. You never said to change the xyz in the checkpoint adding, people just copying this (you're telling them to copy) will get errors because the variables xyz have not been declared.


Re: Entering building when enters CP - Mr.Dexter - 02.04.2013

i need to fix this error and yes i have put the new in the top of my script where all the other news are

C:\Users\Parent\Desktop\backup123\gamemodes\trd.pw n(722) : warning 204: symbol is assigned a value that is never used: "Prison"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


Re: Entering building when enters CP - RajatPawar - 02.04.2013

You need to explain where to put it, why to put it, also, you didn't set the interior which is kind of the main point. (For a building, enter -- > interior.)


Re: Entering building when enters CP - cuemur - 15.05.2013

Dialog is not showin for me? ( i just get into the red circle and that's all..