SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/06/2019, 06:37 PM   #1
nbx2000
Big Clucker
 
Join Date: Dec 2016
Posts: 150
Reputation: 5
Default ask ..telepor

it is possible to use using cmd teleport that allows to choose example position / telepors location 1 2 3 4 5. using zcmd and strcmp It would be better with switch.? could you give me an examplo thank you
nbx2000 is offline   Reply With Quote
Old 30/06/2019, 07:12 PM   #2
SiaReyes
Huge Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 299
Reputation: 20
Default Re: ask ..telepor

Can you explain more? i don't understand anything
__________________
Hey guys,
We've just started up our own hosting company and we are offering cheap game hosting. Our SAMP servers start at only $0.50 cents for 32 slots per month, or $1.50 for 64. We have ONE FREE spot left for a first month free subscription for any game host of your choice. We host most many major games such as SAMP, Call of Duty, 7 Days to Die, Minecraft, CounterStrike, ARK: Survival Evolved, and many more!

Cheapest hosting company official site : http://main-hosts.com/

Cheap Hosting Company is looking for an experience staff.

Sign up to our forums and Control Panel and order one of our cheap game servers. First to sign up will receive a free SA:MP server! Join on discord https://discord.gg/J82JgQJ for more information!

Quote:
Originally Posted by Toroi View Post
blackmail people that join your server using their ip address as hostage

or get a job and play sa-mp for fun
SiaReyes is offline   Reply With Quote
Old 30/06/2019, 07:24 PM   #3
nbx2000
Big Clucker
 
Join Date: Dec 2016
Posts: 150
Reputation: 5
Default Re: ask ..telepor

example

MAKE A TELE CMD BUT THE OPTION CHOOSE THE POSITION 1 2 3 4 5
cmd:telepor
SendClientMessage(playerid, COLOR_YELLOW, TELEPORT LOCATION 1 2 3 4 5

1
SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
2
SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
3
SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
4
SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
nbx2000 is offline   Reply With Quote
Old 30/06/2019, 07:31 PM   #4
khRamin78
Huge Clucker
 
Join Date: Jun 2015
Posts: 311
Reputation: 30
Default Re: ask ..telepor

PHP Code:
//Need to use sscanf for easy use

include <sscanf>


CMD:teleport(playerid,params[])
{
    new 
opt;
    if(
sscanf(params,"d",opt)) return SendClientMessage(playerid,-1,"1 for .. 2 for ..  3 for ..");

    switch(
opt)
    {
        case 
1:
        {
            ..
tele to first
        
}
        case 
2:
        {}
        case 
3:
        {}
        .
        .
        .
    }
    return 
1;

You can use native OnPlayerCommandText too anyway everyone use zcmd and sscanf these days
khRamin78 is offline   Reply With Quote
Old 30/06/2019, 07:32 PM   #5
SiaReyes
Huge Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 299
Reputation: 20
Default Re: ask ..telepor

You mean like this
pawn Code:
CMD:teleport(playerid, params[])
{
    new option;
    if(sscanf(params, "i" option)) return SendClientMessage(playerid, -1, " /teleport <1-4>");
    if(option < 1 ||  option > 4)  return SendClientMessage(playerid, -1, " Min 1 and max 4");
    switch(option)
   {
case 1:  SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
case 2: SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
case 3: SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
case 4: SetPlayerPos(playerid, 1838.4725,-2470.1597,13.5547,179.0624);
   }
   return 1;
}
__________________
Hey guys,
We've just started up our own hosting company and we are offering cheap game hosting. Our SAMP servers start at only $0.50 cents for 32 slots per month, or $1.50 for 64. We have ONE FREE spot left for a first month free subscription for any game host of your choice. We host most many major games such as SAMP, Call of Duty, 7 Days to Die, Minecraft, CounterStrike, ARK: Survival Evolved, and many more!

Cheapest hosting company official site : http://main-hosts.com/

Cheap Hosting Company is looking for an experience staff.

Sign up to our forums and Control Panel and order one of our cheap game servers. First to sign up will receive a free SA:MP server! Join on discord https://discord.gg/J82JgQJ for more information!

Quote:
Originally Posted by Toroi View Post
blackmail people that join your server using their ip address as hostage

or get a job and play sa-mp for fun
SiaReyes is offline   Reply With Quote
Old 30/06/2019, 07:45 PM   #6
nbx2000
Big Clucker
 
Join Date: Dec 2016
Posts: 150
Reputation: 5
Default Re: ask ..telepor

Thanks to two for helping me with my doubt- two perfect functional code
nbx2000 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



All times are GMT. The time now is 09:02 AM.


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