Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include dini
- #pragma tabsize 0
- new Placa[3];
- new timer[3];
- public OnGameModeInit()
- {
- if(!fexist("placa.ini")) dini_Create("placa.ini");
- timer[1] = SetTimer("TrocarPlaca", 1000, true);
- Placa[1] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941, 0.00000, 0.00000, 269.69089);
- SetObjectMaterialText(Placa[1], dini_Get("placa.ini","texto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- Placa[2] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941, 0.00000, 0.00000, 269.69089);
- SetObjectMaterialText(Placa[2], dini_Get("placa.ini","SegundoTexto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerCommandText( playerid, cmdtext[])
- {
- if ( strcmp( cmdtext, "/msgplaca", true) == 0)
- {
- ShowPlayerDialog(playerid, 19340, DIALOG_STYLE_INPUT, "Sistema de autdoor", "Digite Ah msg que deseja:\n\n", "Mudar", "Cancelar");
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 19341)
- {
- new string[128];
- if(strlen(inputtext) < 1 || strlen(inputtext) > 30) return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
- else
- {
- format(string, sizeof(string), "Você mudou o texto do autdoor para '%s'.", inputtext);
- SendClientMessage(playerid, 0x33CCFFAA, string);
- DestroyObject(Placa[2]);
- dini_Set ("placa.ini", "SegundoTexto", inputtext);
- Placa[2] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941, 0.00000, 0.00000, 269.69089);
- SetObjectMaterialText(Placa[2], inputtext, 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- }
- }
- if(dialogid == 19340)
- {
- new string[128];
- if(strlen(inputtext) < 1 || strlen(inputtext) > 30) return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
- else
- {
- format(string, sizeof(string), "Você mudou o texto do autdoor para '%s'.", inputtext);
- SendClientMessage(playerid, 0x33CCFFAA, string);
- DestroyObject(Placa[1]);
- dini_Set ("placa.ini", "texto", inputtext);
- Placa[1] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941, 0.00000, 0.00000, 269.69089);
- SetObjectMaterialText(Placa[1], inputtext, 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- ShowPlayerDialog(playerid, 19341, DIALOG_STYLE_INPUT, "Sistema de autdoor", "Digite Ah segunda msg que deseja:\n\n", "Mudar", "Cancelar");
- }
- }
- return 1;
- }
- forward TrocarPlaca();
- public TrocarPlaca()
- {
- DestroyObject(Placa[2]);
- Placa[1] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941, 0.00000, 0.00000, 269.69089);
- SetObjectMaterialText(Placa[1], dini_Get("placa.ini","texto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- KillTimer(timer[1]);
- timer[2] = SetTimer("MudarPlaca", 1000, true);
- return 1;
- }
- forward MudarPlaca();
- public MudarPlaca()
- {
- DestroyObject(Placa[1]);
- Placa[2] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941, 0.00000, 0.00000, 269.69089);
- SetObjectMaterialText(Placa[2], dini_Get("placa.ini","SegundoTexto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- KillTimer(timer[2]);
- timer[1] = SetTimer("TrocarPlaca", 1000, true);
- return 1;
- }
- #pragma unused strtok
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement