18.03.2013, 04:31
(
Последний раз редактировалось Scrillex; 18.03.2013 в 10:39.
)
So basiclly the problem is on player text... It isnt showing dialogs after register and not switching camera it just spawns player in 0.0.0.0 localation.
so basicly here goes the code:
This is orginal: (everything worked fine after tutorial playerwas spawned
Took off tutorial but spawn point f...ed up..
I'm editing it for my self so don't rage at me.
so basicly here goes the code:
This is orginal: (everything worked fine after tutorial playerwas spawned
pawn Код:
if(RegistrationStep[playerid] > 0)
{
if(RegistrationStep[playerid] == 1)
{
if (strcmp("male", text, true) == 0)
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a male.");
SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
RegistrationStep[playerid] = 2;
return 0;
}
else if (strcmp("female", text, true) == 0)
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a female.");
SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
RegistrationStep[playerid] = 2;
return 0;
}
else
{
SendClientMessageEx(playerid, COLOR_GREEN, "Are you a male or female? Type in your choice.");
}
return 0;
}
else if(RegistrationStep[playerid] == 2)
{
new year, month,day;
getdate(year, month, day);
new DateInfo[3][20];
splits(text, DateInfo, '/');
if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
{
SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
return 0;
}
new check = year - strval(DateInfo[2]);
if(check == year)
{
SendClientMessageEx(playerid, COLOR_GREEN, "What is your date of birth? (Use dd/mm/yyyy)");
return 0;
}
if(strval(DateInfo[1]) > month)
{
check -= 1;
}
else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
{
check -= 1;
}
PlayerInfo[playerid][pAge] = check;
PlayerInfo[playerid][pOrigin] = 0;
format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][pAge]);
SendClientMessageEx(playerid, COLOR_YELLOW2, string);
SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thanks for filling in all the information, Welcome to Galaxy Roleplay.!");
//SendClientMessageEx(playerid, TEAM_CYAN, "We Hope Your Enjoy Your Stay Make Sure To Check Out Are Fourms");
RegistrationStep[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
ClearChatbox(playerid);
SendClientMessageEx(playerid, COLOR_YELLOW, "Type /newplayer if you are new to roleplay/would like to be shown around.");
SendClientMessageEx(playerid, COLOR_YELLOW, "Type /start to start playing!");
ShowTutGUIBox(playerid);
ShowTutGUIFrame(playerid, 1);
TutStep[playerid] = 1;
}
pawn Код:
#define dregister1 13000
if(RegistrationStep[playerid] > 0)
{
if(RegistrationStep[playerid] == 1)
{
ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
RegistrationStep[playerid] = 2;
return 0;
}
else if(RegistrationStep[playerid] == 2)
{
new year, month,day;
getdate(year, month, day);
new DateInfo[3][20];
splits(text, DateInfo, '/');
if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
{
SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
return 0;
}
new check = year - strval(DateInfo[2]);
if(check == year)
{
SendClientMessageEx(playerid, COLOR_GREEN, "What is your date of birth? (Use dd/mm/yyyy)");
return 0;
}
if(strval(DateInfo[1]) > month)
{
check -= 1;
}
else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
{
check -= 1;
}
PlayerInfo[playerid][pAge] = check;
PlayerInfo[playerid][pOrigin] = 0;
format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][pAge]);
SendClientMessageEx(playerid, COLOR_YELLOW2, string);
SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thanks for filling in all the information, Welcome to Free Roleplay.!");
//SendClientMessageEx(playerid, TEAM_CYAN, "We Hope Your Enjoy Your Stay Make Sure To Check Out Are Fourms");
RegistrationStep[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
ClearChatbox(playerid);
TutStep[playerid] = 1;
}
return 0;
}