Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes
- #include < a_samp > //SA-MP TeaM
- #include < zcmd > //Zeex's Include
- #include < sscanf2 > //y_Less Include
- // Loop
- #define Loop(%0,%1) for(new %0 = 0; %0 < %1; %0++)
- //dialogs
- #define DIALOG_SAVE 2256
- //variaveis
- new
- PlayerText:Painel[ 6 ][ MAX_PLAYERS ],
- TimerPlayer[ MAX_PLAYERS ]
- ;
- //CallBacks
- public OnPlayerConnect( playerid ){
- LoadPainel(playerid);
- return true;
- }
- public OnPlayerDisconnect( playerid ){
- KillTimer(TimerPlayer[ playerid ]);
- return true;
- }
- public OnFilterScriptInit()
- {
- print("\n");
- print("|_____________________________|");
- print("| | ");
- print("| SK Cords Editor Carregado ..| ");
- print("| Copyright © 2012-2013 | ");
- print("| | ");
- print("| Sky ™ | ");
- print("|_____________________________| ");
- print("\n");
- Loop(_i, GetMaxPlayers( ))
- {
- if(IsPlayerConnected(_i)) LoadPainel(_i);
- }
- return true;
- }
- public OnFilterScriptExit()
- {
- Loop(_i, GetMaxPlayers( ))
- {
- if(IsPlayerConnected(_i)) HideTextDraw(_i);
- KillTimer(TimerPlayer[ _i ]);
- }
- print("| SK Cords Editor Desligado .. | ");
- return true;
- }
- public OnPlayerSpawn(playerid)
- {
- SendClientMessage(playerid, -1, "{33AA33}Use: /vercords [ 1 - 2]");
- return 1;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- if(playertextid == Painel[ 4 ][ playerid ])
- {
- HideTextDraw(playerid);
- SendClientMessage(playerid, -1, "{33AA33}Salvando Cordenadas.");
- CancelSelectTextDraw(playerid);
- ShowPlayerDialog(playerid, DIALOG_SAVE, DIALOG_STYLE_INPUT, "SK Cords Editor", "{FFFFFF}A Cordenada será salva na pasta {FF0000}'{FFFFFF}Scriptfiles{FF0000}'\n\n\n{FFFFFF}Escreva o nome do Local ou um Comentario Sobre a Cordenada\nPara Salva-la", "Salvar", "Cancelar");
- return 1;
- }
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_SAVE:
- {
- new
- vartext[ 129 ]
- ;
- if(!response) return SendClientMessage(playerid, -1, "Salvamento {FF0000}Cancelado!");
- format(vartext, sizeof( vartext ), "{FFFFFF}o Local: {33AA33}%s {FFFFFF}foi salvo com sucesso!", inputtext);
- SendClientMessage(playerid, -1, vartext);
- SalvarPos(playerid, inputtext);
- }
- }
- return true;
- }
- //Comandos
- CMD:vercords(playerid, params[])
- {
- new sk;
- if(!sscanf(params, "i", sk))
- {
- switch(sk)
- {
- case 1:
- {
- Loop(id, sizeof Painel)
- {
- PlayerTextDrawShow(playerid, Painel[ id ][ playerid ]);
- }
- AtualizarCordenadas(playerid);
- SelectTextDraw(playerid, 0x00FF40FF);
- }
- case 2:
- {
- Loop(id, 4)
- {
- PlayerTextDrawShow(playerid, Painel[ id ][ playerid ]);
- }
- PlayerTextDrawShow(playerid, Painel[ 5 ][ playerid ]);
- SendClientMessage(playerid, -1, "Para fechar o Menu /fecharmenu ");
- TimerPlayer[ playerid ] = SetTimerEx("AtualizarCords", 100, true, "i", playerid);
- }
- }
- }
- else SendClientMessage(playerid, -1, "{FF0000}Use: /vercords [ 1- 2 ]");
- return true;
- }
- CMD:fecharmenu(playerid)
- {
- HideTextDraw(playerid);
- KillTimer(TimerPlayer[ playerid ]);
- SendClientMessage(playerid, -1, "Menu Fechado Com sucesso!");
- return true;
- }
- HideTextDraw(playerid)
- {
- Loop(id, sizeof Painel)
- {
- PlayerTextDrawHide(playerid, Painel[ id ][ playerid ]);
- }
- }
- LoadPainel(playerid)
- {
- Painel[ 0 ][ playerid ] = CreatePlayerTextDraw(playerid,94.000000, 119.000000, "_");
- PlayerTextDrawAlignment(playerid, Painel[ 0 ][ playerid ], 2);
- PlayerTextDrawBackgroundColor(playerid, Painel[ 0 ][ playerid ], 255);
- PlayerTextDrawFont(playerid, Painel[ 0 ][ playerid ], 1);
- PlayerTextDrawLetterSize(playerid, Painel[ 0 ][ playerid ], 0.500000, 14.999996);
- PlayerTextDrawColor(playerid, Painel[ 0 ][ playerid ], -1);
- PlayerTextDrawSetOutline(playerid, Painel[ 0 ][ playerid ], 0);
- PlayerTextDrawSetProportional(playerid, Painel[ 0 ][ playerid ], 1);
- PlayerTextDrawSetShadow(playerid, Painel[ 0 ][ playerid ], 1);
- PlayerTextDrawUseBox(playerid, Painel[ 0 ][ playerid ], 1);
- PlayerTextDrawBoxColor(playerid, Painel[ 0 ][ playerid ], 133);
- PlayerTextDrawTextSize(playerid, Painel[ 0 ][ playerid ], 0.000000, 138.000000);
- PlayerTextDrawSetSelectable(playerid, Painel[ 0 ][ playerid ], 0);
- Painel[ 1 ][ playerid ] = CreatePlayerTextDraw(playerid,94.000000, 106.000000, "_");
- PlayerTextDrawAlignment(playerid, Painel[ 1 ][ playerid ], 2);
- PlayerTextDrawBackgroundColor(playerid, Painel[ 1 ][ playerid ], 255);
- PlayerTextDrawFont(playerid, Painel[ 1 ][ playerid ], 1);
- PlayerTextDrawLetterSize(playerid, Painel[ 1 ][ playerid ], 0.500000, 1.100000);
- PlayerTextDrawColor(playerid, Painel[ 1 ][ playerid ], -1);
- PlayerTextDrawSetOutline(playerid, Painel[ 1 ][ playerid ], 0);
- PlayerTextDrawSetProportional(playerid, Painel[ 1 ][ playerid ], 1);
- PlayerTextDrawSetShadow(playerid, Painel[ 1 ][ playerid ], 1);
- PlayerTextDrawUseBox(playerid, Painel[ 1 ][ playerid ], 1);
- PlayerTextDrawBoxColor(playerid, Painel[ 1 ][ playerid ], -16777083);
- PlayerTextDrawTextSize(playerid, Painel[ 1 ][ playerid ], 0.000000, 138.000000);
- PlayerTextDrawSetSelectable(playerid, Painel[ 1 ][ playerid ], 0);
- Painel[ 2 ][ playerid ] = CreatePlayerTextDraw(playerid,53.000000, 105.000000, "SK Cordenadas");
- PlayerTextDrawBackgroundColor(playerid, Painel[ 2 ][ playerid ], 255);
- PlayerTextDrawFont(playerid, Painel[ 2 ][ playerid ], 0);
- PlayerTextDrawLetterSize(playerid, Painel[ 2 ][ playerid ], 0.480000, 1.000000);
- PlayerTextDrawColor(playerid, Painel[ 2 ][ playerid ], -1);
- PlayerTextDrawSetOutline(playerid, Painel[ 2 ][ playerid ], 0);
- PlayerTextDrawSetProportional(playerid, Painel[ 2 ][ playerid ], 1);
- PlayerTextDrawSetShadow(playerid, Painel[ 2 ][ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid, Painel[ 2 ][ playerid ], 0);
- Painel[ 3 ][ playerid ] = CreatePlayerTextDraw(playerid,26.000000, 130.000000, "Cord X:~n~_~n~Cord Y:~n~_~n~Cord Z:~n~_~n~Angulo:~n~_~n~Int:");
- PlayerTextDrawBackgroundColor(playerid, Painel[ 3 ][ playerid ], 255);
- PlayerTextDrawFont(playerid, Painel[ 3 ][ playerid ], 1);
- PlayerTextDrawLetterSize(playerid, Painel[ 3 ][ playerid ], 0.270000, 1.000000);
- PlayerTextDrawColor(playerid, Painel[ 3 ][ playerid ], -1);
- PlayerTextDrawSetOutline(playerid, Painel[ 3 ][ playerid ], 0);
- PlayerTextDrawSetProportional(playerid, Painel[ 3 ][ playerid ], 1);
- PlayerTextDrawSetShadow(playerid, Painel[ 3 ][ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid, Painel[ 3 ][ playerid ], 0);
- Painel[ 4 ][ playerid ] = CreatePlayerTextDraw(playerid,27.000000, 242.000000, "Save");
- PlayerTextDrawBackgroundColor(playerid, Painel[ 4 ][ playerid ], 255);
- PlayerTextDrawFont(playerid, Painel[ 4 ][ playerid ], 1);
- PlayerTextDrawLetterSize(playerid, Painel[ 4 ][ playerid ], 0.430000, 1.000000);
- PlayerTextDrawColor(playerid, Painel[ 4 ][ playerid ], -1);
- PlayerTextDrawSetOutline(playerid, Painel[ 4 ][ playerid ], 0);
- PlayerTextDrawSetProportional(playerid, Painel[ 4 ][ playerid ], 1);
- PlayerTextDrawSetShadow(playerid, Painel[ 4 ][ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid, Painel[ 4 ][ playerid ], 0);
- Painel[ 5 ][ playerid ] = CreatePlayerTextDraw(playerid,66.000000, 130.000000, "0000.0000~n~_~n~0000.0000~n~_~n~0000.0000~n~_~n~0000.0000");
- PlayerTextDrawBackgroundColor(playerid, Painel[ 5 ][ playerid ], 866792362);
- PlayerTextDrawFont(playerid, Painel[ 5 ][ playerid ], 1);
- PlayerTextDrawLetterSize(playerid, Painel[ 5 ][ playerid ], 0.240000, 1.000000);
- PlayerTextDrawColor(playerid, Painel[ 5 ][ playerid ], -1);
- PlayerTextDrawSetOutline(playerid, Painel[ 5 ][ playerid ], 0);
- PlayerTextDrawSetProportional(playerid, Painel[ 5 ][ playerid ], 1);
- PlayerTextDrawSetShadow(playerid, Painel[ 5 ][ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid, Painel[ 5 ][ playerid ], 0);
- PlayerTextDrawSetSelectable(playerid, Painel[ 4 ][ playerid ], true);
- return true;
- }
- forward AtualizarCords( playerid );
- public AtualizarCords( playerid ) return AtualizarCordenadas(playerid);
- AtualizarCordenadas(playerid)
- {
- new
- Float:Pos[ 4 ],
- inT,
- ACTD[ 100 ]
- ;
- inT = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- format(ACTD, sizeof( ACTD ), "%.4f~n~_~n~%.4f~n~_~n~%.4f~n~_~n~%.4f~n~_~n~%d", Pos[0], Pos[1], Pos[2], Pos[3], inT);
- return PlayerTextDrawSetString(playerid, Painel[ 5 ][ playerid ], ACTD);
- }
- SalvarPos(playerid, Local[])
- {
- new
- SKstr[ 200 ],
- Float:Pos[ 4 ],
- inT,
- File:Arquivo
- ;
- inT = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, Pos[3]);
- format(SKstr, sizeof( SKstr ), "%s: %.4f, %.4f, %.4f, %.4f, %d \r//Local, X , Y, Z, Interior\n", Local, Pos[0], Pos[1], Pos[2], Pos[3], inT);
- Arquivo = fopen("SKCords.txt", io_append);
- fwrite(Arquivo, SKstr);
- fclose(Arquivo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement