spawn problem help please
#1

hi dear,
i'm using An event system, it's working Good but when i create an event at place 'A' according to this eventsystem eveyone who do /join should be spawned at place 'A', but problem is that i dosn't spawn players at 'A' instead it spawn them at random places .

(it just works for creator only,it spawn eventcreator(admin) on correct place not all players) : can some one please slove this ?

i'll be thankfull to u :

sorry for bad english <3

have a nice day
//------------------------------------


Код:
CMD:startevent(playerid,params[])
{
	new string[128]; new sstring[128];
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Unknown command. Please use the correct commands.");
	if(joinable==1) return SendClientMessage(playerid,COLOR_RED,"There is already an event going on.");
	else if(sscanf(params,"s[128]iiiiii",ename,eprize,gun1,ammo1,gun2,ammo2))
	return	SendClientMessage(playerid,COLOR_PINK,"USAGE: /startevent [Event name (to be displayed)] [Prize] [Event weapon 1] [Ammo] [Event weapon 2] [Ammo].");
		
	else if(gun1 > 39 || gun1 < 0) return SendClientMessage(playerid,COLOR_ORANGE,"What do you expect, a stick? Use weapon IDs within 0-40!");
	else if(gun2 > 39 || gun2 < 0) return SendClientMessage(playerid,COLOR_ORANGE,"What do you expect, a stick? Use weapon IDs within 0-40!");
		else
		{
		format(string,128,"'%s' has been started as an event! Use /join to join the fun!",ename);
	    format(sstring,128,"~n~~n~~b~'%s' ~w~has been started!~w~Use ~g~/join to join the fun!",ename);
	    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
	    GameTextForAll(sstring,5000,5);
	    joinable=1;
	    new Float:p1; new Float:p2; new Float:p3;
		GetPlayerPos(playerid,p1,p2,p3);
		SetPVarFloat(playerid,"locx",p1);
		SetPVarFloat(playerid,"locy",p2);
		SetPVarFloat(playerid,"locz",p3);
		}


	return 1;
}
CMD:join(playerid,params[])
{
	new s[128];
	if(joinable==0) return SendClientMessage(playerid,COLOR_RED,"No events are going on, currently.");
	if(locked==1)
	{
	format(s,128,"The event '%s' has been locked by an admin. You cannot join it.",ename);
	SendClientMessage(playerid,COLOR_RED,s);
	return 1;}

	else
	{
	    SetPlayerPos(playerid,GetPVarFloat(playerid, "locx"),GetPVarFloat(playerid, "locy"),GetPVarFloat(playerid, "locz"));
		SendClientMessage(playerid,COLOR_GREEN,"You have joined the event!");
		GivePlayerWeapon(playerid,gun1,ammo1);
		GivePlayerWeapon(playerid,gun2,ammo2);
		joined[playerid]=1;

		}
	return 1;
}
Reply
#2

Please edit your main post with [code][./code] tag around your commands, its really unpleasant to read without them.
Reply
#3

Quote:
Originally Posted by Ritzy
Посмотреть сообщение
Please edit your main post with [code][./code] tag around your commands, its really unpleasant to read without them.
Sorry eddited
Reply
#4

Is someone interested to help me ?
Reply
#5

Mind your bumps, 24 hour bumps only.


It's because you're using PVars, which are only set for the person who made the event.

Use an array instead.

Код:
new Float:EventCoord[3];
Код:
GetPlayerPos(playerid,EventCoord[0],EventCoord[1],EventCoord[2]);
Код:
SetPlayerPos(playerid,EventCoord[0],EventCoord[1],EventCoord[2]);
You may also want to track the facing angle of the person so instead of everyone facing random ways, they all face the way that you want to head them in the right direction first.

Otherwise they will spawn in facing the direction they were facing when they teleported in.

Another thing to be aware of is that you'll likely want to add Virtual World, and Interior to your system as well as then you'll be able to make events in areas where people frequent, yet keep the event separate, and the interiors, so you can run an event inside an interior. If you do this without adding these 2 things, you'll have players falling from the sky and ending up glitched if you do do it inside an interior. (This could also cause issue with someone teleporting from an interior or another virtual world, where they'll tele in and no-one will see them)

Код:
GetPlayerFacingAngle (Float)
GetPlayerInterior (Int)
GetPlayerVirtualWorld (Int)
Код:
SetPlayerFacingAngle
SetPlayerInterior
SetPlayerVirtualWorld
PVars are individual to all players, and this was why your setup isn't working for anyone other than the creator.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)