16.07.2016, 21:50
Hello, I found some gamemode which I wanted to try, when I logged in I couldn't spawn, it should give me a dialog of register and login, it just doesn't show it.. anyone can help me with that?
Post your callback of public OnPlayerConnect and then your public OnDialogResponse
|
public OnPlayerConnect(playerid) { new IP[16]; GetPlayerIp(playerid, IP, sizeof(IP)); if(IsPlayerNPC(playerid)) { //if(strcmp(IP, "127.0.0.1") != 0) if(strcmp(IP, "162.220.33.252") != 0 && strcmp(IP, "127.0.0.1") != 0) { SendClientMessage(playerid, COLOR_RED, "Sorry, we don't allow NPC connections from external IP addresses."); printf("[Security]: NPC connection from %s rejected.", IP); Kick(playerid); return 1; } } if(!BobTheBuilder[playerid]) { RemoveServerBuildings(playerid); //faction/server maps maps ect //DestroyAllBuildings(playerid); //removeMineObjects(playerid); //mine objects (can be added to server buildings later) //check if player is banned new query[200]; mysql_format(sqlGameConnection, query, sizeof(query), "SELECT * FROM `banlist` INNER JOIN `players` ON `players`.`ID` = `banlist`.`userID` WHERE `players`.`Name` = '%e' OR `banlist`.`IP` = '%e'", PlayerName(playerid), IP); //QueryLog(playerid, query); mysql_pquery(sqlGameConnection, query, "OnBanListCheck", "d", playerid); } BobTheBuilder[playerid] = 0; //PlayerOnFire[playerid] = 0; resetPlayerVars(playerid); DisablePlayerCheckpoint(playerid); DisablePlayerCheckpointEx(playerid); TogglePlayerAllDynamicCPs(playerid, false); dOnPlayerConnect(playerid); //donorScripts.inc return 1; } stock BanAccount(giveplayerid, playerid, reason[], expires[] = "2030-01-01") { new IP[16]; GetPlayerIp(giveplayerid, IP, sizeof(IP)); new name[MAX_PLAYER_NAME]; if(playerid == INVALID_PLAYER_ID) { format(name, sizeof(name), "Autoban"); } else { GetPlayerName(playerid, name, sizeof(name)); } new query[256]; mysql_format(sqlGameConnection, query, sizeof(query), "INSERT INTO `banlist` (`ID`, `userID`, `IP`, `Reason`, `BannedBy`, `Date`, `Expires`, `Banned`) VALUES(NULL, %d, '%e', '%e', '%e', NOW(), '%e', 1)", PlayerInfo[giveplayerid][pID], IP, reason, name, expires); //QueryLog(playerid, query); mysql_pquery(sqlGameConnection, query); PlayerInfo[giveplayerid][pBand] = 3; BanEx(giveplayerid, reason); //change this back to kick in future //Kick(giveplayerid); return 1; } CMD:bans(playerid, params[]){ if(PlayerInfo[playerid][pAdmin] >= 2){ new name[24], query[128]; if(sscanf(params, "s[24]", name))return SendClientMessage(playerid, COLOR_GREY, "USAGE: /bans [player_name]"); { mysql_format(sqlGameConnection, query, sizeof(query), "SELECT `ID` FROM `players` WHERE `Name`='%e' LIMIT 1", name); mysql_pquery(sqlGameConnection, query, "onBansChecked", "is", playerid, name); } } else return AdmErrorMsg; return 1; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { //printf("OnDialogResponse(playerid: %d, dialogid: %d)", playerid, dialogid); if( ammo_OnDialogResponse( playerid, dialogid, response, listitem, inputtext ) == 1 ) return 1; if( dialogid == DIALOG_TUTORIAL_AGE ) { if( !response ) return ShowPlayerDialog( playerid, DIALOG_TUTORIAL_AGE, DIALOG_STYLE_INPUT, "Enter an age for your character", "The age must be between 18 and 80.", "Okay", "" ); new age = strval( inputtext ); if( age < 18 || age > 80 ) { return ShowPlayerDialog( playerid, DIALOG_TUTORIAL_AGE, DIALOG_STYLE_INPUT, "Enter an age for your character", "The age must be between 18 and 80.", "Okay", "" ); } PlayerInfo[playerid][pAge] = age; PlayerTutStage[playerid]++; Tutorial( playerid, PlayerTutStage[playerid] ); return 1; }
There is nothing there stating a login / registration system. Therefore that is why you aren't spawning.
|
enum { OnPlayerConnect DIALOG_LOGIN, DIALOG_REGISTER,