SA-MP Forums Archive
Delete button spawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Delete button spawn (/showthread.php?tid=356445)



Delete button spawn - Urefeu - 03.07.2012

Hello.

When a new player come on my server, he has to register. The problem is that there is a spawn button and the player can play if he isn't registered.

My question is how to delete the spawn button and just spawn the player when I do SpawnPlayer(playerid) ?

Thanks !


Re: Delete button spawn - FalconX - 03.07.2012

Quote:
Originally Posted by Urefeu
Посмотреть сообщение
Hello.

When a new player come on my server, he has to register. The problem is that there is a spawn button and the player can play if he isn't registered.

My question is how to delete the spawn button and just spawn the player when I do SpawnPlayer(playerid) ?

Thanks !
If you want them to not spawn until they log in you could do the following:-

pawn Код:
if( !IsPlayerLoggedIn( playerid ) ) // change this to your own var
    {
        SendClientMessage( playerid, -1, "Error: You must log in before you spawn!" );
        return 0;
    }
Put this in OnPlayerRequestSpawn and your problem will be fixed

Regards,
FalconX


Re: Delete button spawn - ReneG - 03.07.2012

Force the player into spectator mode when the player connects with
pawn Код:
TogglePlayerSpectating(playerid, 1);
Then, before he spawns, force them out.


Re: Delete button spawn - Urefeu - 03.07.2012

return 0; don't fonction

How to set the camera of the player in an other place ?

I have put : SetPlayerCameraPos(playerid, -2031.539184, -116.349197, 1036.240234); at the begining of the OnPlayerConnect, but it change anything ...


Re: Delete button spawn - [MM]RoXoR[FS] - 04.07.2012

pawn Код:
//Under OnPlayerConnect
TogglePlayerSpectating(playerid, 1);

//After register /Login
TogglePlayerSpectating(playerid, 0);



Re: Delete button spawn - Urefeu - 04.07.2012

TogglePlayerSpectating function, the spawn button has disappeared.

Now, I have two problems :

- When the player logs, I do : TogglePlayerSpectating(playerid, 0); (When the spectating is turned off, OnPlayerSpawn will automaticly be called.). The problem is that, when the player logs, the player doesn't spawn : the spawn button appears and the player has to click it for spawn. I added SpawnPlayer(playerid); but it doesn't function...

- I do TogglePlayerSpectating(playerid, 1); I have a view over a sea. How to change it ? On a lot of servers, there is a view on offices during connection or registration...

Thanks in advance !


Re: Delete button spawn - Urefeu - 04.07.2012

Any idea ?


Re: Delete button spawn - [MM]RoXoR[FS] - 04.07.2012

Quote:
Originally Posted by Urefeu
Посмотреть сообщение
TogglePlayerSpectating function, the spawn button has disappeared.

TogglePlayerSpectating(playerid, 0); (When the spectating is turned off, OnPlayerSpawn will automaticly be called.!
Actually , OnPlayerSpawn is not called..
OnRequestPlayerClass is called.

Also, show the code and try this
pawn Код:
SetSpawnInfo(playerid......)//All the things needed
https://sampwiki.blast.hk/wiki/SetSpawnInfo


Re: Delete button spawn - Urefeu - 04.07.2012

I have already done that :

Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 217, 4687.5126, 1520.8243, 8.2256, 1.5945, 0, 0, 0, 0, 0, 0);
    
	return 1;
}



Re: Delete button spawn - Urefeu - 04.07.2012

It not functions :/ An other idea ?