still getting execute
#1

Код:
CMD:spawn(playerid,params[])
{
	if(pInfo[playerid][Registered] == 0)
	{
		GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
		GetPlayerFacingAngle(playerid, Angle[playerid]);
	 	GetPlayerInterior(playerid);
		GameTextForPlayer(playerid,"~y~Spawn Point ~n~~g~Saved",2000,3);
		return 1;
	}
	else return SendClientMessage(playerid, white,"{FF0000}>> You must be register to the server before using this command");
}
How come it was still getting called?

EDIT: Okay I got it working now...


How about under on player spawn

Код:
if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 )
{
SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
SetPlayerFacingAngle( playerid, Angle[ playerid ] );
SetPlayerInterior( playerid, Interior[ playerid ] );
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);

	 	}
		else
	 	{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
}
how do I add

Код:
if(pInfo[playerid][Registered] == 1 && pInfo[playerid][Logged] == 1)
{

else return SendClientMessage(playerid, white,"{FF0000}>> You must register first before using this command");
}
Reply
#2

When a player connects, make sure you're resetting the variables before reparsing them under the login / registration. Maybe the previous player was logged in, did /q, and the pInfo[playerid][Registered] = 1 remained as it was when the user file was parsed.
Reply
#3

Код HTML:
    if(pInfo[playerid][Registered] == 1 && pInfo[playerid][Logged] == 1)
    {
	if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 )
	   {
	        SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
	        SetPlayerFacingAngle( playerid, Angle[ playerid ] );
	        SetPlayerInterior( playerid, Interior[ playerid ] );
	        SetCameraBehindPlayer(playerid);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerInterior(playerid, 0);
	    }
	    else return 1;
	}
         else
	{
	  	new Random = random(sizeof(RandomSpawns));
	    	SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1],    RandomSpawns[Random][2]);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerInterior(playerid, 0);
	  }
   }
My pawno not responding..
Reply
#4

I tried to make a rspawn but still spawning where I use /spawn. Can you please help me make a reset spawn and change it to my normal random spawn point?


Код:
CMD:rspawn(playerid,params[])
{
	if(pInfo[playerid][Registered] == 1 && pInfo[playerid][Logged] == 1)
    {
  		new Random = random(sizeof(RandomSpawns));
 		SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
		GameTextForPlayer(playerid,"~y~Spawn Point ~n~~r~Reset",2000,3);
		GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
		GetPlayerFacingAngle(playerid, Angle[playerid]);
		return 1;
		
	}
	else return SendClientMessage(playerid, white,"{FF0000}>> You must register first before using this command");
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)