Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Graffity System
- // Credits :
- // PabuLetz. - Creator for FilterScripts
- // Acest Graffity System consta in creearea unor tatuaje pe pereti
- // Comenzi:
- // /cgraffity
- // /cremove
- #define FILTERSCRIPT
- #include <a_samp>
- #define COLOR_RED 0xAA3333AA
- //#define COLOR_GRAF1 0xFF0000FF
- #define COLOR_GRAF2 0xFF8000FF
- #define COLOR_GRAF3 0x0000FFFF
- #define COLOR_GRAF4 0x00FF00FF
- #define MAX_GRAFFITI 50
- #pragma tabsize 0
- new graffity;
- #define MAX_GRAFTEXT (64)
- new GrafText[MAX_PLAYERS][MAX_GRAFTEXT];
- new graf[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Graffity System");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" GRaffity System");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- graf[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- graf[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/cgraffity", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, 1998, DIALOG_STYLE_MSGBOX, "Graffity System", "Sigur vrei sa creezi un tatuaj?", "Ok", "");
- return 1;
- }
- if (strcmp("/cremove", cmdtext, true, 10) == 0)
- {
- DestroyObject(graffity);
- SendClientMessage(playerid,-1,"Ai sters tatuaju.");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1998)
- {
- if(response)
- {
- SendClientMessage(playerid,-1,"Aranjeaza cum vrei sa fie pozitionat tatuaju.");
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerFacingAngle(playerid, A);
- GetPlayerPos(playerid, X, Y, Z);
- graffity = CreateObject(19482,X,Y,Z+0.5,0.0,0.0,0.0,0.0);
- SetObjectMaterialText(graffity,"Tatuaj nou",0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,0xAA3333AA,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- EditObject(playerid,graffity);
- graf[playerid] = 1;
- }
- }
- if(dialogid == 1996)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- }
- if(listitem == 1)
- {
- SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- }
- if(listitem == 2)
- {
- SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- }
- }
- }
- if(dialogid == 1997)
- {
- if(response)
- {
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid,-1,"ERROR: Not write in the box text. !");
- ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
- return 1;
- }
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerFacingAngle(playerid, A);
- GetPlayerPos(playerid, X, Y, Z);
- SetObjectMaterialText(graffity, inputtext,0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,0xFFFFFFFF,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
- strcat(GrafText[playerid], inputtext, MAX_GRAFTEXT);
- ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Yellow\nGreen\nSky-Blue", "Select", "Close");
- graf[playerid] = 0;
- }
- }
- return 1;
- }
- public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
- {
- new Float:oldX, Float:oldY, Float:oldZ,
- Float:oldRotX, Float:oldRotY, Float:oldRotZ;
- GetObjectPos(graffity, oldX, oldY, oldZ);
- GetObjectRot(graffity, oldRotX, oldRotY, oldRotZ);
- if(!playerobject)
- {
- if(!IsValidObject(graffity)) return;
- MoveObject(graffity, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
- }
- if(response == EDIT_RESPONSE_FINAL)
- {
- SendClientMessage(playerid,-1,"Acum foloseste acest spray pentru a finaliza tatuaju !");
- GivePlayerWeapon(playerid, 41, 5000);
- }
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) == 41)
- {
- if(graf[playerid] == 1)
- {
- SetTimerEx("Object", 5000, false, "i", playerid);
- }
- }
- return 1;
- }
- forward Object(playerid);
- public Object(playerid)
- {
- ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement