Class Selection - 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: Class Selection (
/showthread.php?tid=284789)
Class Selection -
sherlock - 20.09.2011
On class selection say you have police,robber etc. How could i make a class so you have to enter a password to spawn when you click spawn?
Re: Class Selection -
=WoR=Varth - 20.09.2011
https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn
Re: Class Selection -
sherlock - 20.09.2011
But i dont wanna make it admin class i wanna make it passworded
Re: Class Selection -
=WoR=Varth - 20.09.2011
-.- have you read that wiki page?
Quote:
Returning 0 in this callback will prevent the player from spawning
|
Make a check if player isn't login/type the password.
Re: Class Selection -
sherlock - 20.09.2011
Quote:
Originally Posted by =WoR=Varth
-.- have you read that wiki page?
Make a check if player isn't login/type the password.
|
Yes i read the page. I know nothing about scripting and you have confuzzled me now.
Re: Class Selection -
sherlock - 20.09.2011
Will this work?
https://sampwiki.blast.hk/wiki/How_to_pa..._protect_skins
Re: Class Selection -
Issam - 20.09.2011
Quote:
Originally Posted by sherlock
|
Yes,it will, if you done it as they wrote.
Re: Class Selection -
=WoR=Varth - 20.09.2011
Quote:
Originally Posted by sherlock
|
Why don't you give a try?
Re: Class Selection -
sherlock - 20.09.2011
Hmm the gamemode im using already has classes but doesnt have a AddPlayerClass...not one. So im kinda stuck. It has one OnplayerRequestClass but after that all the classes are set out as
case ClassPolice:
Re: Class Selection -
Fj0rtizFredde - 20.09.2011
You can do it quite simple with something like this (You have to change the teams and the "SuperPassword" ofc):
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(team == COPS) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Enter Password To Spawn!", "Please Enter A Password To Spawn:", "Ok", "Nope"), 0;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response)
{
if(!strcmp(inputtext, "SuperPassword", true))
{
SpawnPlayer(playerid);
SendClientMessage(playerid,-1,"Your password was correct! Enjoy the server!");
}
}
return 1;
}