SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/08/2014, 05:59 PM   #1
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default leave cmd req

Hello,
i want dm command" when i write /LEAVE i must spawn here. see the code below"

Code:
AddPlayerClass(217,404.8082,2448.4775,16.5703,0.0000,0,0,0,0,0,0); // /aa
AddPlayerClass(217,1856.7678,-2281.7593,16.0903,90.0000,0,0,0,0,0,0); // /lsair
AddPlayerClass(217,1591.0516,1447.7815,13.3303,90.0000,0,0,0,0,0,0); // /lsvair
AddPlayerClass(217,-1374.3136,-257.4903,18.7700,270.0000,0,0,0,0,0,0); //
Spartaaaaa is offline   Reply With Quote
Old 06/08/2014, 06:00 PM   #2
dirigent00
Big Clucker
 
Join Date: Jul 2014
Posts: 72
Reputation: 1
Default Re: leave cmd req

Random of this coords or?
dirigent00 is offline   Reply With Quote
Old 06/08/2014, 06:02 PM   #3
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: leave cmd req

You mean when someone write /leave he must spawn at this place SEE CODES
Spartaaaaa is offline   Reply With Quote
Old 06/08/2014, 06:09 PM   #4
dirigent00
Big Clucker
 
Join Date: Jul 2014
Posts: 72
Reputation: 1
Default Re: leave cmd req

Try:

Code:
new Float:RandomSpawns[][] = 
{
	{404.8082,2448.4775,16.5703,0.0000}, // /aa
	{1856.7678,-2281.7593,16.0903,90.0000}, // /lsair
	{1591.0516,1447.7815,13.3303,90.0000}, // /lsvair
	{-1374.3136,-257.4903,18.7700,270.0000}	//
};

OnPlayerSpawn(playerid)
{
	 new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    return 1;
}
dirigent00 is offline   Reply With Quote
Old 06/08/2014, 06:48 PM   #5
HeLiOn_PrImE
High-roller
 
HeLiOn_PrImE's Avatar
 
Join Date: Jul 2010
Location: Cluj Napoca, Romania
Posts: 3,024
Reputation: 469
Default Re: leave cmd req

The text above + this:
Code:
if (strcmp(cmdtext, /leave", true) == 0)
{
    //check if he is in that specific dm arena
    SpawnPlayer(playerid);
    return 1;
}
You must have something like this around there somewhere.
__________________

"It's only a game, but people are real. You have to respect them." - Mick88
"You don't deserve a +rep, if you ask for it. Those who deserve it, don't have to ask." - me
"And yet people will still start new threads for the "dying" subject." - me

HeLiOn_PrImE is offline   Reply With Quote
Old 06/08/2014, 06:58 PM   #6
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: leave cmd req

but i don't have /leave command on my gm :c any help



Code:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
	//--------------------------------------------------------------------------
	if(GetPVarInt(playerid, "PlayerInDM") == 1 || GetPVarInt(playerid, "PlayerInRace") == 1 || GetPVarInt(playerid, "PlayerInGifts") == 1)
	{
	    //----------------------------------------------------------------------
 		if(strcmp(cmdtext, 	"/leave", 	true   ) == 0) 			return 0;
 		if(strcmp(cmdtext, 	"/ad", 		true   ) == 0) 			return 0;
 		if(strcmp(cmdtext,  "/myskin",  true   ) == 0)          return 0;
		if(strcmp(cmdtext, 	"/cmds", 	true   ) == 0) 			return 0;
		if(strcmp(cmdtext,  "/skin",    true   ) == 0)         	return 0;
		//----------------------------------------------------------------------
 		else GameTextForPlayer(playerid, "~w~Use ~r~/Leave~w~ to leave!", 6000, 4);
 		return 1;
	}
	//--------------------------------------------------------------------------
	if(GetPVarInt(playerid, "Jailed") == 1)
	{
	    SendClientMessage(playerid, red, "ERROR: You cannot use commands in Jail!");
		return 1;
	}
	//--------------------------------------------------------------------------
	else return 0;
}
Spartaaaaa is offline   Reply With Quote
Old 06/08/2014, 08:26 PM   #7
Spartaaaaa
Huge Clucker
 
Spartaaaaa's Avatar
 
Join Date: May 2014
Location: Puma™
Posts: 262
Reputation: 16
Default Re: leave cmd req

bump
Spartaaaaa is offline   Reply With Quote
Old 06/08/2014, 08:29 PM   #8
JessThompson
Huge Clucker
 
JessThompson's Avatar
 
Join Date: Dec 2013
Location: Developer Lodge
Posts: 399
Reputation: 22
Default Re: leave cmd req

Add me on skype lenny9113


I have a idea for you
JessThompson is offline   Reply With Quote
Old 07/08/2014, 02:18 AM   #9
HeLiOn_PrImE
High-roller
 
HeLiOn_PrImE's Avatar
 
Join Date: Jul 2010
Location: Cluj Napoca, Romania
Posts: 3,024
Reputation: 469
Default Re: leave cmd req

I can't advise anything if you don't know your own gm. I hope lenny9113 can help you more.
And wait 24 hours to bump your topic. Early 3 hour bumps won't make the forum staff happy.
__________________

"It's only a game, but people are real. You have to respect them." - Mick88
"You don't deserve a +rep, if you ask for it. Those who deserve it, don't have to ask." - me
"And yet people will still start new threads for the "dying" subject." - me

HeLiOn_PrImE 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
You can't leave car KlooP Scripting Help 4 31/10/2012 02:19 PM
Leave? ScottCFR Help Archive 2 13/03/2010 08:22 PM


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


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