Class Selection
#1

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?
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn
Reply
#3

But i dont wanna make it admin class i wanna make it passworded
Reply
#4

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

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

Will this work?

https://sampwiki.blast.hk/wiki/How_to_pa..._protect_skins
Reply
#7

Quote:
Originally Posted by sherlock
Посмотреть сообщение
Yes,it will, if you done it as they wrote.
Reply
#8

Quote:
Originally Posted by sherlock
Посмотреть сообщение
Why don't you give a try?
Reply
#9

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:
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)