NEED HELP
#1

Hello guys,

I am a beginner scripter.I want to know how to make some simple commands like /bike,/car etc...
And how to make a teleport command which tele us to a place with our vehicle.Thanks

-Vaibhav
Reply
#2

first, you got to get the coordinates for the teleport location. use the debugger mode and /save function. there will be savedpositions file in your gta directory if you /save. the command is like /save [comment] so you should enter something like /save telespot1 to recognise the info. Next if you were on foot there should be AddPlayerClass(blablabla, coordinates, weapons, ..). You need to get the first three coordinates. They are as following: x, y, z. then there is angle. if you want you can use that one too.

now for the command i use dcmd function, but as ou're new you could use strcmp just now.

pawn Код:
//OnPlayerCommandText(playerid, cmdtext[])
if(strcmp(cmdtext, "/goto_cars", true) == 0)
{
SetPlayerPos(playerid, /*coordinate x*/, /*coordinate y*/, /*coordinate z*/);
/* use this if you want to us angle :*/
SetPlayerFacingAngle(playerid, /* angle here);
return SendClientMessage(playerid, 0xFFFFFFFF, "You have been teleported to cars!");
}
note to replace my comments wit actual x y z and angle coordinates.

hope it helped!
Reply
#3

The Wiki is your best friend
Reply
#4

Quote:
Originally Posted by Ignas1337
first, you got to get the coordinates for the teleport location. use the debugger mode and /save function. there will be savedpositions file in your gta directory if you /save. the command is like /save [comment] so you should enter something like /save telespot1 to recognise the info. Next if you were on foot there should be AddPlayerClass(blablabla, coordinates, weapons, ..). You need to get the first three coordinates. They are as following: x, y, z. then there is angle. if you want you can use that one too.

now for the command i use dcmd function, but as ou're new you could use strcmp just now.

pawn Код:
//OnPlayerCommandText(playerid, cmdtext[])
if(strcmp(cmdtext, "/goto_cars", true) == 0)
{
SetPlayerPos(playerid, /*coordinate x*/, /*coordinate y*/, /*coordinate z*/);
/* use this if you want to us angle :*/
SetPlayerFacingAngle(playerid, /* angle here);
return SendClientMessage(playerid, 0xFFFFFFFF, "You have been teleported to cars!");
}
note to replace my comments wit actual x y z and angle coordinates.

hope it helped!
Thanks
ill go and test it.
Reply
#5

Ok this teleport is working and what about /bike and /car command?
Or do you know how to make a command which looks like this /car [Vehicle ID/Vehicle name]
Reply
#6

It doesn't work because you need the correct coordinates, and replace it with the commented text.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)