SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/03/2015, 11:42 PM   #1
UnKnownEgyptain
Little Clucker
 
UnKnownEgyptain's Avatar
 
Join Date: Jul 2014
Location: Egypt
Posts: 7
Reputation: 5
Red face Need /drag command.

Hello there,I am trying to create /drag command using YCMD to my server but i failed,Can anyone help me please?
UnKnownEgyptain is offline   Reply With Quote
Old 14/03/2015, 12:10 AM   #2
awoo
Big Clucker
 
awoo's Avatar
 
Join Date: Feb 2015
Posts: 97
Reputation: 18
Default Re: Need /drag command.

Post your code to I help you.
__________________
Estudante de Física (UEPG)
awoo is offline   Reply With Quote
Old 14/03/2015, 12:13 AM   #3
UnKnownEgyptain
Little Clucker
 
UnKnownEgyptain's Avatar
 
Join Date: Jul 2014
Location: Egypt
Posts: 7
Reputation: 5
Default Re: Need /drag command.

Ahem,Can you help me and write a YCMD code for me please? I mean i don't know how to use SetPlayerPosition..etc I am new in scripting and need help..
UnKnownEgyptain is offline   Reply With Quote
Old 14/03/2015, 12:17 AM   #4
awoo
Big Clucker
 
awoo's Avatar
 
Join Date: Feb 2015
Posts: 97
Reputation: 18
Default Re: Need /drag command.

Look here: SetPlayerPos and SetPlayerFacingAngle
Your command would be like this:
Code:
YCMD:drag(playerid, params[], help)
{
	SetPlayerPos(playerid, X, Y, Z);
	SetPlayerFacingAngle(playerid, angle);
	return 1;
}
It's easy.
__________________
Estudante de Física (UEPG)
awoo is offline   Reply With Quote
Old 14/03/2015, 12:25 AM   #5
UnKnownEgyptain
Little Clucker
 
UnKnownEgyptain's Avatar
 
Join Date: Jul 2014
Location: Egypt
Posts: 7
Reputation: 5
Default Re: Need /drag command.

Code:
YCMD:drag(playerid, params[], help) {
	if(help) {
		SendClientMessage(playerid, X11_WHITE, "Drags someone.");
		return 1;
	}
	if(isPlayerFrozen(playerid)) {
		SendClientMessage(playerid, X11_TOMATO_2, "You can't use this while frozen!");
		return 1;
	}

	new faction = GetPVarInt(playerid, "Faction");
	new rank = GetPVarInt(playerid, "Rank");
	if(!IsValidFaction(faction) || faction == 0) {
		SendClientMessage(playerid, X11_TOMATO_2, "You aren't in a faction!");
		return 1;
	}
Alright,This is my server faction..etc all i need now is drag things..(It's Police command)
UnKnownEgyptain 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
I need Drag and stop drag command Jizz Scripting Help 5 24/02/2014 01:08 PM
Drag command FaZeRs Scripting Help 0 03/02/2014 02:13 PM
Drag command FaZeRs Scripting Help 22 02/02/2014 06:19 PM
Drag Command help! MaDsON Server Support 7 01/02/2014 10:06 PM
/Drag command. Humprabbit Scripting Help 2 29/03/2013 01:13 AM


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


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