public OnPlayerConnect(playerid) { //================================================================================ // Paul Walker RemoveBuildingForPlayer(playerid, 732, 910.7500, -1062.4063, 22.8203, 0.25); CreateObject(19347, 910.97375, -1068.29272, 22.47440, 0.00000, 0.00000, 0.00000); CreateObject(19347, 911.22949, -1068.10132, 22.47440, 0.00000, 0.00000, 0.00000); CreateObject(19347, 911.07080, -1068.17114, 22.47440, 0.00000, 0.00000, 0.00000); CreateObject(19347, 911.51978, -1068.29272, 22.47440, 0.00000, 0.00000, 0.00000); CreateObject(19347, 911.34381, -1068.17114, 22.47440, 0.00000, 0.00000, 0.00000); CreateObject(870, 913.46228, -1067.75488, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 908.88531, -1069.28369, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 909.18475, -1066.82068, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 911.01068, -1065.90430, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 913.45782, -1067.19128, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 912.42670, -1066.18079, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 909.77399, -1065.93750, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 908.93610, -1068.30920, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(870, 913.55927, -1069.32764, 23.65180, 0.00000, 0.00000, 0.00000); CreateObject(9915, 911.88306, -1053.46875, 7.80270, 0.00000, 0.00000, 270.00000); CreateObject(2896, 911.24249, -1069.19043, 22.15340, 0.00000, 0.00000, 270.00000); //================================================================================ //============ clickedplayer[playerid]=-1; Killing_Spree_Count[playerid] = 0; SetTimerEx("ConnectIRC", 200, false, "d", playerid); BlindFold[playerid] = false; LoadPlayerAnimLibs(playerid); new playerip[32]; GetPlayerIp(playerid,playerip,32); format(PlayerTemp[playerid][IP], 32, "%s", playerip); dini_IntSet(globalstats, "connects", dini_Int(globalstats,"connects")+1); new nome[ MAX_STRING ], nome2[ MAX_STRING ]; format( nome, sizeof(nome), "14[JOIN] %s[%d] has joined Sicilian Mafia. (IP: %s) - Connects: %d | Online: %d",PlayerName(playerid), playerid, playerip, dini_Int(globalstats,"connects"), ConnectedPlayers()); iEcho( nome ); PlayerLoop(i) { if(PlayerTemp[i][jqmessage]) { format(nome,sizeof(nome),"[JOIN] %s(%d) has joined Sicilian Mafia",RPName(playerid),playerid); format(nome2,sizeof(nome2),"[JOIN] %s(%d) has joined Sicilian Mafia (IP: %s)",RPName(playerid),playerid, playerip); if(PlayerInfo[i][power]) SendClientMessage(i,COLOR_LIGHTGREY, nome2); else SendClientMessage(i,COLOR_LIGHTGREY, nome); } } new afkname[24]; GetPlayerName(playerid,afkname,sizeof(afkname)); if(!IsARolePlayName(afkname)) { SendClientMSG(playerid,COLOR_WHITE,"{ff0000}%s you have been kicked for having an invalid name!",afkname); SendClientMSG(playerid,COLOR_WHITE,"{ff0000}Feel free to reload with a RP Name! (Firstname_Lastname)",afkname); Kick(playerid); return 1; } if(strfind(afkname,"NoBodY", true)!=-1) { SendClientError(playerid, "You have been kicked due to the fact of a invalid name."); Kick(playerid); } new pname[24], friend[128], savingstring[128], query[250]; PlayerLoop(p) { if(PLAYERLIST_authed[p]) { GetPlayerName(p, pname, sizeof(pname)); format(query, sizeof(query), "SELECT `friend` FROM `FriendInfo` WHERE `you` = '%s'", pname); mysql_query(query); mysql_store_result(); while(mysql_fetch_row_format(query, "|")) { mysql_fetch_field_row(savingstring, "friend"); myStrcpy(friend, savingstring); new playerID = GetPlayerId(friend); if(IsPlayerConnected(playerID)) { if(playerID == playerid) { SendClientMSG(p, COLOR_ADMIN_PM, "[FRIEND] Your friend %s has Connected to the server.", RPName(playerid)); } } } mysql_free_result(); } } //===================================== Misc::ClearWindow(playerid); SendClientMessage(playerid, -1, " Loading .."); SetTimerEx("WelcomeMessage",2000,0,"ii",playerid,0); new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); PLAYERLIST_authed[playerid]=false; //===========[Phones] PlayerTemp[playerid][onphone] = -1; PlayerTemp[playerid][lastpm] = 666; PnSCMIndex[playerid] = 1; RecentlyShot[playerid] = 0; TextDrawHideForPlayer(playerid, PlayerTemp[playerid][Status]); TextDrawHideForPlayer(playerid, LocationTD[playerid]); TextDrawHideForPlayer(playerid, TextDraw__News); TextDrawHideForPlayer(playerid, TextDraw__OOCMode); TextDrawHideForPlayer(playerid, TextDraw__Death); TextDrawShowForPlayer(playerid, TextDraw__Top1); TextDrawShowForPlayer(playerid, TextDraw__Bottom1); TextDrawHideForPlayer(playerid, IMtxt); gPlayerUsingLoopingAnim[playerid] = 0; gPlayerAnimLibsPreloaded[playerid] = 0; PlayerTemp[playerid][RobbingHouse] = -1; myStrcpy(PlayerInfo[playerid][accent],"None"); return 1; }
echo Executing Server Config...
lanmode 1
rcon_password 2015
maxplayers 50
port 7777
hostname Testing server
gamemode0 Mafia02
filterscripts
plugins streamer.dll sscanf.dll irc.dll mysql.dll
query 1
chatlogging 0
weburl www.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]
Hello guys.
I got a gamemode from my friend but it has a problem. there problem is when i connect to game it wont show the register or login dialogs it just shows arrows left right and Spawn if i click spawn nothing happens. Please someone who can fix it post an reply here and ill give skype so you can see what i mean. |
if(dialogid == 1) //Dialog Register
{
if(response)
{
if(!strlen(inputtext) || strlen(inputtext) > 20)
{
SendClientError(playerid, "You need to login, otherwise you can not spawn");
Kick(playerid);
}
else if(strlen(inputtext) > 0 && strlen(inputtext) < 20)
{
new escpass[20];
mysql_real_escape_string(inputtext, escpass);
MySQL_Register(playerid, escpass);
}
}
if(!response)
{
SendClientInfo(playerid, "You need to login before you can play here");
Kick(playerid);
}
}
if(dialogid == 2) //Dialog login
{
if(!response) //If they click the cancel button
{
SendClientError(playerid, "You must login before you spawn!"); //Sends the client a error message
Kick(playerid);
}
if(response) //If the player clicked login
{
new query[200], pname[24], escapepass[100];
GetPlayerName(playerid, pname, 24); //Gets the players name
mysql_real_escape_string(inputtext, escapepass); //We escape the inputtext to avoid SQL injections.
format(query, sizeof(query), "SELECT `user` = '%s' FROM `PlayerInfo` WHERE `user` = '%s' AND password = '%s'", pname, pname, escapepass);
mysql_query(query);
mysql_store_result();
new numrows = mysql_num_rows();
if(numrows == 1) MySQL_Login(playerid);
if(!numrows) MySQL_LoginFailed(playerid);
mysql_free_result();
}
}