SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 29/11/2010, 04:24 PM   #1
Sub Zero
Little Clucker
 
Join Date: Sep 2010
Posts: 5
Reputation: 0
Cool Entering building when enters CP

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
Sub Zero is offline   Reply With Quote
Old 29/11/2010, 10:56 PM   #2
Tee
Gangsta
 
Join Date: Sep 2010
Posts: 836
Reputation: 81
Default Re: Entering building when enters CP

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.
__________________
1.3 inch/360 - pretty high for precision
Tee is offline   Reply With Quote
Old 30/11/2010, 06:25 AM   #3
Sub Zero
Little Clucker
 
Join Date: Sep 2010
Posts: 5
Reputation: 0
Default Re: Entering building when enters CP

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);
}
Sub Zero is offline   Reply With Quote
Old 31/12/2011, 03:11 PM   #4
the.et
Little Clucker
 
Join Date: Jul 2011
Posts: 41
Reputation: 5
Default Re: Entering building when enters CP

i kept on getting the error "error 017: undefined symbol "checkpointid" please help.
the.et is offline   Reply With Quote
Old 31/03/2013, 05:11 PM   #5
Mr.Dexter
Big Clucker
 
Join Date: Sep 2012
Location: Hampshire, england
Posts: 75
Reputation: 0
Default Re: Entering building when enters CP

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 (c) 1997-2006, ITB CompuPhase


4 Errors.
__________________
Join our server now

The Real Dudes
IP: 5.152.197.55:7779

Forum: www.rdclan.smffy.com
Mr.Dexter is offline   Reply With Quote
Old 31/03/2013, 05:14 PM   #6
thefatshizms
High-roller
 
thefatshizms's Avatar
 
Join Date: Dec 2011
Location: England
Posts: 1,750
Reputation: 259
Default Re: Entering building when enters CP

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.
__________________
SFCNR ******* | SFCNR Forum
thefatshizms is offline   Reply With Quote
Old 02/04/2013, 07:25 AM   #7
Mr.Dexter
Big Clucker
 
Join Date: Sep 2012
Location: Hampshire, england
Posts: 75
Reputation: 0
Default Re: Entering building when enters CP

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 (c) 1997-2006, ITB CompuPhase


1 Warning.
__________________
Join our server now

The Real Dudes
IP: 5.152.197.55:7779

Forum: www.rdclan.smffy.com
Mr.Dexter is offline   Reply With Quote
Old 02/04/2013, 07:31 AM   #8
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,180
Reputation: 311
Default Re: Entering building when enters CP

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.)
RajatPawar is offline   Reply With Quote
Old 15/05/2013, 12:56 PM   #9
cuemur
Big Clucker
 
cuemur's Avatar
 
Join Date: Apr 2013
Posts: 68
Reputation: 1
Default Re: Entering building when enters CP

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entering a building with "ENTER" Luis- Help Archive 5 27/08/2010 09:42 PM
Check Player if he enters Pay'n'nSpray's [MF]FACE Help Archive 2 13/07/2010 12:42 PM
how to make like if you press "F" or enter then enters building? hardstop Help Archive 3 28/04/2010 12:18 PM
When player Enters vehicle...help! Static_X Help Archive 23 02/02/2009 09:55 PM


All times are GMT. The time now is 11:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.