30.05.2010, 17:56
So, what is the problem??
I want to open login or register dialog, and i did that, but there is another problem.
If it load one from that dialogs, it don't load dialog with left, right and Spawn button, so when player login he/she need to press on Spawn, how to fix it?
Here is the code:
So, does any one know how to fix it?
I want to open login or register dialog, and i did that, but there is another problem.
If it load one from that dialogs, it don't load dialog with left, right and Spawn button, so when player login he/she need to press on Spawn, how to fix it?
Here is the code:
Code:
public OnPlayerConnect(playerid)
{
new
string[128],
pName[MAX_PLAYER_NAME],
f;
GetPlayerName(playerid,pName,sizeof(pName));
if(strfind(pName,"_",true,1)!=-1)
{
f=1;
}
if(pName[strlen(pName)-1]=='_')
{
f=0;
}
for(new i=0;i<strlen(pName);i++)
{
if((pName[i]<='9')&&(pName[i]>='0'))
{
f=0;
}
}
if(!f)
{
format(string, sizeof(string), "You have been kicked, Reason: Firstname_Lastname format.", pName);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "SERVER: %s was kicked from the server, reason: Firstname_Lastname format.", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
}
for(new bn = 0; bn < sizeof(Sopranos); bn++)
{
if(!strcmp(Sopranos[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: We aren't in The Sopranos series. (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(ViceCity); bn++)
{
if(!strcmp(ViceCity[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint Vice City. (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(GTA3); bn++)
{
if(!strcmp(GTA3[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint GTA III. (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(SA); bn++)
{
if(!strcmp(SA[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint GTA:SA . (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(GF); bn++)
{
if(!strcmp(GF[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: This aint The Godfather . (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(Famous); bn++)
{
if(!strcmp(Famous[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Yeah yeah of course, see you in Hollywood. (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(SmackD); bn++)
{
if(!strcmp(SmackD[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Go SmackDown somewhere else. (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
for(new bn = 0; bn < sizeof(BadName); bn++)
{
if(!strcmp(BadName[bn][0],pName,true,sizeof(pName)))
{
format(string, sizeof(string), "SERVER: %s was kicked from the server, Reason: Your name is lame. Gtfo. (kicked)", pName);
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
return 1;
}
}
sOldState[playerid] = GetPlayerState(playerid);
showspeedo[playerid] = 1;
IsLogged[playerid] = 0;
new name[256], queryconn[256], result, fname[2][128];
new Float:mx, Float:my, Float:mz;
GetPlayerName(playerid, name, sizeof(name));
split(name, fname, '_');
format(queryconn, sizeof(queryconn), "SELECT * FROM players WHERE name = '%s'", name);
result = mysql_query(queryconn);
mysql_store_result();
if(mysql_num_rows() == 0){
format(string, sizeof(string), "Welcome %s to Lost Heaven: RolePlay [v%s by Coa_Psy © 2010], Please register.", fname[0], VERSION_0);
SendClientMessage(playerid, COLOR_YELLOW, string);
GetPlayerPos(playerid, mx, my, mz);
PlayerPlaySound(playerid, 1185, 0, 0, 0);
Registerdialog(playerid);
return 1;
}else{
format(string, sizeof(string), "Welcome %s to Lost Heaven: RolePlay [v%s by Coa_Psy © 2010] , Please login.", fname[0], VERSION_0);
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerPlaySound(playerid, 1185, 0, 0, 0);
Logindialog(playerid);
return 1;
}
}





Spawn button comes up on player request class and not before that.