leave cmd req
#1

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

Код:
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); //
Reply
#2

Random of this coords or?
Reply
#3

You mean when someone write /leave he must spawn at this place SEE CODES
Reply
#4

Try:

Код:
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;
}
Reply
#5

The text above + this:
Код:
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.
Reply
#6

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



Код:
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;
}
Reply
#7

bump
Reply
#8

Add me on skype lenny9113


I have a idea for you
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)