[Tutorial] Entering building when enters CP
#1

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
Reply
#2

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.
Reply
#3

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);
}
Reply
#4

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

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.
Reply
#6

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.
Reply
#7

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.
Reply
#8

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.)
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)