Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <Pawn.CMD>
- native GetMousePos(&x, &y);
- new Text:Text_Login[4];
- new bool:mostrou[MAX_PLAYERS];
- main(){}
- public OnGameModeInit()
- {
- Text_Login[0] = TextDrawCreate(267.600006, 177.057739, "box");
- TextDrawLetterSize(Text_Login[0], 0.000000, 4.160000);
- TextDrawTextSize(Text_Login[0], 387.000000, 0.000000);
- TextDrawAlignment(Text_Login[0], 1);
- TextDrawColor(Text_Login[0], -1);
- TextDrawUseBox(Text_Login[0], 1);
- TextDrawBoxColor(Text_Login[0], 12031);
- TextDrawSetShadow(Text_Login[0], 0);
- TextDrawSetOutline(Text_Login[0], 0);
- TextDrawBackgroundColor(Text_Login[0], 255);
- TextDrawFont(Text_Login[0], 1);
- TextDrawSetProportional(Text_Login[0], 1);
- TextDrawSetShadow(Text_Login[0], 0);
- Text_Login[1] = TextDrawCreate(267.600006, 181.057739, "REGISTRO");
- TextDrawLetterSize(Text_Login[1], 0.622000, 4.140089);
- TextDrawTextSize(Text_Login[1], 387.000000, 0.000000);
- TextDrawAlignment(Text_Login[1], 1);
- TextDrawColor(Text_Login[1], -1);
- TextDrawUseBox(Text_Login[1], 1);
- TextDrawBoxColor(Text_Login[1], 50943);
- TextDrawSetShadow(Text_Login[1], 0);
- TextDrawSetOutline(Text_Login[1], 0);
- TextDrawBackgroundColor(Text_Login[1], 255);
- TextDrawFont(Text_Login[1], 2);
- TextDrawSetProportional(Text_Login[1], 1);
- TextDrawSetShadow(Text_Login[1], 0);
- Text_Login[2] = TextDrawCreate(268.000000, 236.555511, "box");
- TextDrawLetterSize(Text_Login[2], 0.000000, 4.160000);
- TextDrawTextSize(Text_Login[2], 387.000000, 0.000000);
- TextDrawAlignment(Text_Login[2], 1);
- TextDrawColor(Text_Login[2], -1);
- TextDrawUseBox(Text_Login[2], 1);
- TextDrawBoxColor(Text_Login[2], 3932415);
- TextDrawSetShadow(Text_Login[2], 0);
- TextDrawSetOutline(Text_Login[2], 0);
- TextDrawBackgroundColor(Text_Login[2], 255);
- TextDrawFont(Text_Login[2], 1);
- TextDrawSetProportional(Text_Login[2], 1);
- TextDrawSetShadow(Text_Login[2], 0);
- Text_Login[3] = TextDrawCreate(267.999237, 241.057739, " LOGAR");
- TextDrawLetterSize(Text_Login[3], 0.587600, 4.080356);
- TextDrawTextSize(Text_Login[3], 386.489318, 0.009999);
- TextDrawAlignment(Text_Login[3], 1);
- TextDrawColor(Text_Login[3], -1);
- TextDrawUseBox(Text_Login[3], 1);
- TextDrawBoxColor(Text_Login[3], 16711935);
- TextDrawSetShadow(Text_Login[3], 0);
- TextDrawSetOutline(Text_Login[3], 0);
- TextDrawBackgroundColor(Text_Login[3], 255);
- TextDrawFont(Text_Login[3], 2);
- TextDrawSetProportional(Text_Login[3], 1);
- TextDrawSetShadow(Text_Login[3], 0);
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- CMD:mostra(playerid){
- static bool:mostrando;
- if(mostrando){
- for(new i = 0; i < sizeof(Text_Login); i++){
- TextDrawHideForPlayer(playerid, Text_Login[i]);
- TextDrawShowForPlayer(playerid, Text_Login[i]);
- }
- mostrando = false;
- }else{
- for(new i = 0; i < sizeof(Text_Login); i++){
- TextDrawHideForPlayer(playerid, Text_Login[i]);
- }
- mostrando = true;
- }
- return 1;
- }
- // REGISTRO
- //664min - 970max >: 352min - 442max
- // LOGIN
- // 664min - 970max y: 469min 563max
- public OnPlayerUpdate(playerid)
- {
- new x, y, string[30];
- GetMousePos(x, y);
- if(x >= 664 && y >= 352 && x <= 970 && y <= 442){
- if(mostrou[playerid]) return 1;
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Registro", "Faça um registro.", "Registrar", "Fechar");
- mostrou[playerid] = true;
- }else if(x >= 664 && y >= 469 && x <= 970 && y <= 563){
- if(mostrou[playerid]) return 1;
- for(new i = 0; i < sizeof(Text_Login); i++){
- TextDrawHideForPlayer(playerid, Text_Login[i]);
- }
- mostrou[playerid] = true;
- }
- format(string, sizeof(string), "X: %d - Y: %d", x, y);
- SendClientMessage(playerid, -1, string);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid){
- case 1:{
- if(!response) mostrou[playerid] = false; return 1;
- }
- case 2:{
- if(!response) mostrou[playerid] = false; return 1;
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- mostrou[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement