SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 26/05/2011, 11:34 AM   #1
Gemini
Big Clucker
 
Join Date: Dec 2010
Posts: 144
Reputation: 12
Default What is not correct about this? Help.

I am learning to use dcmd to create teleports, but why doesnt this code work properly?

PHP Code:
dcmd_drift1(playeridparams[])
{
    
#pragma unused params
    
SetPlayerInterior(playerid,0);
    if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {
        
SendClientMessage(playerid,COLOR_RED,"You must be the driver to teleport this vehicle!");
     }
     else
    {
         if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            
SetVehiclePos(playerid,-355.2756,1529.9248,75.3594);
        }
         else
          {
              
SetPlayerPos(playerid,-355.2756,1529.9248,75.3594);
        }
    }
    return 
1;

as you can see, I want persons to be teleported to big ear drift when they write /drift1. IF a player is in any vehicle he will be teleported, and also if a player is on foot (I will change the coords later so that if player is on foot he will be teleported else where). AND IF a player is as a passenger in someones car, he can not teleport the vehicle.

But for some reason, the teleporting for persons IN VEHICLES does not work. Help please.

Thanks in advance.

Last edited by Gemini; 26/05/2011 at 11:37 AM. Reason: Sorry the code messes up here...
Gemini is offline  
Old 26/05/2011, 11:40 AM   #2
pen_theGun
Big Clucker
 
pen_theGun's Avatar
 
Join Date: Jan 2008
Posts: 179
Reputation: 0
Default Re: What is not correct about this? Help.

Quote:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(playerid,-355.2756,1529.9248,75.3594);
}
else
{
SetPlayerPos(playerid,-355.2756,1529.9248,75.3594);
}
Its should be vehicleid, not playerid

ClickMe
__________________



pen_theGun is offline  
 

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
Correct? Luis- Help Archive 5 25/12/2010 11:05 PM
please Correct it AzTeCaS Help Archive 3 23/11/2010 10:54 AM
How to do this the correct way? Torran Help Archive 6 22/02/2010 11:52 PM
Correct me. Thanks! Daniel_June Help Archive 0 28/01/2010 08:18 PM
Someone correct this for me JoeDaDude Help Archive 13 22/01/2010 11:10 PM


All times are GMT. The time now is 06:30 AM.


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