18.11.2012, 13:36
Quote:
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #include <comandos> #define COLOR_WHITE 0xFFFFFFAA new nokiaon[MAX_PLAYERS];//to check if mobile is On or OFF : new nokiastats[MAX_PLAYERS];//mobile stats simply , like calling.. main or whatsever new Select[MAX_PLAYERS]; new NewNum[MAX_PLAYERS][8]; new Text:nokia[16];//Mobile textdraw new Text:nokianum[MAX_PLAYERS];//number the player is calling, new Text:nokiamain[MAX_PLAYERS];//Stats... public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Texdraws Mobile by Shabi RoxX "); print("--------------------------------------\n"); //============================================ // Mobile TextDraw Start # //============================================ //Main BackGround With Nokai TAG nokia[0] = TextDrawCreate(542.000000, 260.000000, "Nokia~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n ~~n~~n~~n~~n~~n~"); TextDrawAlignment(nokia[0], 2); TextDrawBackgroundColor(nokia[0], 255); TextDrawFont(nokia[0], 1); TextDrawLetterSize(nokia[0], 1.000000, 1.000000); TextDrawColor(nokia[0], -1); TextDrawSetOutline(nokia[0], 0); TextDrawSetProportional(nokia[0], 1); TextDrawSetShadow(nokia[0], 1); TextDrawUseBox(nokia[0], 1); TextDrawBoxColor(nokia[0], 2071823560); TextDrawTextSize(nokia[0], 7.000000, 137.000000); //screen texdraw nokia[1] = TextDrawCreate(542.000000, 282.000000, "_~n~~n~~n~~n~~n~"); TextDrawAlignment(nokia[1], 2); TextDrawBackgroundColor(nokia[1], 255); TextDrawFont(nokia[1], 1); TextDrawLetterSize(nokia[1], 0.500000, 1.000000); TextDrawColor(nokia[1], -1); TextDrawSetOutline(nokia[1], 0); TextDrawSetProportional(nokia[1], 1); TextDrawSetShadow(nokia[1], 1); TextDrawUseBox(nokia[1], 1); TextDrawBoxColor(nokia[1], -1296911672); TextDrawTextSize(nokia[1], 467.000000, 125.000000); //Button 1 nokia[2] = TextDrawCreate(493.000000, 361.000000, "1"); TextDrawAlignment(nokia[2], 2); TextDrawBackgroundColor(nokia[2], 1504093896); TextDrawFont(nokia[2], 1); TextDrawLetterSize(nokia[2], 0.519999, 1.700000); TextDrawColor(nokia[2], -1); TextDrawSetOutline(nokia[2], 1); TextDrawSetProportional(nokia[2], 1); TextDrawUseBox(nokia[2], 1); TextDrawBoxColor(nokia[2], 1431655880); TextDrawTextSize(nokia[2], 31.000000, 18.000000); //Button 2 nokia[3] = TextDrawCreate(543.000000, 364.000000, "2"); TextDrawAlignment(nokia[3], 2); TextDrawBackgroundColor(nokia[3], 1504093896); TextDrawFont(nokia[3], 1); TextDrawLetterSize(nokia[3], 0.519999, 1.700000); TextDrawColor(nokia[3], -1); TextDrawSetOutline(nokia[3], 1); TextDrawSetProportional(nokia[3], 1); TextDrawUseBox(nokia[3], 1); TextDrawBoxColor(nokia[3], 1431655880); TextDrawTextSize(nokia[3], 31.000000, 18.000000); //Button 3 nokia[4] = TextDrawCreate(592.000000, 361.000000, "3"); TextDrawAlignment(nokia[4], 2); TextDrawBackgroundColor(nokia[4], 1504093896); TextDrawFont(nokia[4], 1); TextDrawLetterSize(nokia[4], 0.519999, 1.700000); TextDrawColor(nokia[4], -1); TextDrawSetOutline(nokia[4], 1); TextDrawSetProportional(nokia[4], 1); TextDrawUseBox(nokia[4], 1); TextDrawBoxColor(nokia[4], 1431655880); TextDrawTextSize(nokia[4], 31.000000, 18.000000); //Button 5 nokia[5] = TextDrawCreate(543.000000, 394.000000, "5"); TextDrawAlignment(nokia[5], 2); TextDrawBackgroundColor(nokia[5], 1504093896); TextDrawFont(nokia[5], 1); TextDrawLetterSize(nokia[5], 0.519999, 1.700000); TextDrawColor(nokia[5], -1); TextDrawSetOutline(nokia[5], 1); TextDrawSetProportional(nokia[5], 1); TextDrawUseBox(nokia[5], 1); TextDrawBoxColor(nokia[5], 1431655880); TextDrawTextSize(nokia[5], 31.000000, 18.000000); //Button 5 nokia[6] = TextDrawCreate(493.000000, 391.000000, "4"); TextDrawAlignment(nokia[6], 2); TextDrawBackgroundColor(nokia[6], 1504093896); TextDrawFont(nokia[6], 1); TextDrawLetterSize(nokia[6], 0.519999, 1.700000); TextDrawColor(nokia[6], -1); TextDrawSetOutline(nokia[6], 1); TextDrawSetProportional(nokia[6], 1); TextDrawUseBox(nokia[6], 1); TextDrawBoxColor(nokia[6], 1431655880); TextDrawTextSize(nokia[6], 31.000000, 18.000000); //Button 6 nokia[7] = TextDrawCreate(592.000000, 391.000000, "6"); TextDrawAlignment(nokia[7], 2); TextDrawBackgroundColor(nokia[7], 1504093896); TextDrawFont(nokia[7], 1); TextDrawLetterSize(nokia[7], 0.519999, 1.700000); TextDrawColor(nokia[7], -1); TextDrawSetOutline(nokia[7], 1); TextDrawSetProportional(nokia[7], 1); TextDrawUseBox(nokia[7], 1); TextDrawBoxColor(nokia[7], 1431655880); TextDrawTextSize(nokia[7], 31.000000, 18.000000); //Button 8 nokia[8] = TextDrawCreate(543.000000, 423.000000, "8"); TextDrawAlignment(nokia[8], 2); TextDrawBackgroundColor(nokia[8], 1504093896); TextDrawFont(nokia[8], 1); TextDrawLetterSize(nokia[8], 0.519999, 1.700000); TextDrawColor(nokia[8], -1); TextDrawSetOutline(nokia[8], 1); TextDrawSetProportional(nokia[8], 1); TextDrawUseBox(nokia[8], 1); TextDrawBoxColor(nokia[8], 1431655880); TextDrawTextSize(nokia[8], 31.000000, 18.000000); //Button 7 nokia[9] = TextDrawCreate(493.000000, 421.000000, "7"); TextDrawAlignment(nokia[9], 2); TextDrawBackgroundColor(nokia[9], 1504093896); TextDrawFont(nokia[9], 1); TextDrawLetterSize(nokia[9], 0.519999, 1.700000); TextDrawColor(nokia[9], -1); TextDrawSetOutline(nokia[9], 1); TextDrawSetProportional(nokia[9], 1); TextDrawUseBox(nokia[9], 1); TextDrawBoxColor(nokia[9], 1431655880); TextDrawTextSize(nokia[9], 31.000000, 18.000000); //Button 9 nokia[10] = TextDrawCreate(592.000000, 421.000000, "9"); TextDrawAlignment(nokia[10], 2); TextDrawBackgroundColor(nokia[10], 1504093896); TextDrawFont(nokia[10], 1); TextDrawLetterSize(nokia[10], 0.519999, 1.700000); TextDrawColor(nokia[10], -1); TextDrawSetOutline(nokia[10], 1); TextDrawSetProportional(nokia[10], 1); TextDrawUseBox(nokia[10], 1); TextDrawBoxColor(nokia[10], 1431655880); TextDrawTextSize(nokia[10], 31.000000, 18.000000); //UnDial Botton (Red) nokia[11] = TextDrawCreate(589.000000, 342.000000, "="); TextDrawAlignment(nokia[11], 2); TextDrawBackgroundColor(nokia[11], 255); TextDrawFont(nokia[11], 3); TextDrawLetterSize(nokia[11], 0.519999, 0.4); TextDrawColor(nokia[11], -16776961); TextDrawSetOutline(nokia[11], 0); TextDrawSetProportional(nokia[11], 1); TextDrawSetShadow(nokia[11], 1); TextDrawUseBox(nokia[11], 1); TextDrawBoxColor(nokia[11], 1566399944); TextDrawTextSize(nokia[11], 25.000000, 15.000000); //Main Menu Button nokia[12] = TextDrawCreate(542.000000, 342.000000, "+"); TextDrawAlignment(nokia[12], 2); TextDrawBackgroundColor(nokia[12], 255); TextDrawFont(nokia[12], 3); TextDrawLetterSize(nokia[12], 0.519999, 0.4); TextDrawColor(nokia[12], -1); TextDrawSetOutline(nokia[12], 1); TextDrawSetProportional(nokia[12], 1); TextDrawUseBox(nokia[12], 1); TextDrawBoxColor(nokia[12], 1566399944); TextDrawTextSize(nokia[12], 25.000000, 15.000000); //Dail Button (Green) nokia[13] = TextDrawCreate(494.000000, 342.000000, "="); TextDrawAlignment(nokia[13], 2); TextDrawBackgroundColor(nokia[13], 255); TextDrawFont(nokia[13], 3); TextDrawLetterSize(nokia[13], 0.519999, 0.4); TextDrawColor(nokia[13], 16711935); TextDrawSetOutline(nokia[13], 0); TextDrawSetProportional(nokia[13], 1); TextDrawSetShadow(nokia[13], 1); TextDrawUseBox(nokia[13], 1); TextDrawBoxColor(nokia[13], 1566399944); TextDrawTextSize(nokia[13], 25.000000, 15.000000); //TurnoFF BUTTON nokia[14] = TextDrawCreate(600.000000, 264.000000, "="); TextDrawAlignment(nokia[14], 2); TextDrawBackgroundColor(nokia[14], 255); TextDrawFont(nokia[14], 3); TextDrawLetterSize(nokia[14], 0.519999, 0.69999; TextDrawColor(nokia[14], -16776961); TextDrawSetOutline(nokia[14], 0); TextDrawSetProportional(nokia[14], 1); TextDrawSetShadow(nokia[14], 1); TextDrawUseBox(nokia[14], 1); TextDrawBoxColor(nokia[14], 1566399944); TextDrawTextSize(nokia[14], 33.000000, 9.000000); for(new i = 2;i < 15;i++) { TextDrawSetSelectable(nokia[i], true); } nokia[15] = TextDrawCreate(562.000000, 280.000000, "Time"); TextDrawBackgroundColor(nokia[15], 255); TextDrawFont(nokia[15], 1); TextDrawLetterSize(nokia[15], 0.500000, 1.000000); TextDrawColor(nokia[15], -1); TextDrawSetOutline(nokia[15], 0); TextDrawSetProportional(nokia[15], 1); TextDrawSetShadow(nokia[15], 1); for(new i = 0;i < MAX_PLAYERS;i++) { nokiamain[i] = TextDrawCreate(490.000000, 296.000000, "_"); TextDrawBackgroundColor(nokiamain[i], 255); TextDrawFont(nokiamain[i], 2); TextDrawLetterSize(nokiamain[i], 0.369999, 1.199999); TextDrawColor(nokiamain[i], 16711935); TextDrawSetOutline(nokiamain[i], 0); TextDrawSetProportional(nokiamain[i], 1); TextDrawSetShadow(nokiamain[i], 1); nokianum[i] = TextDrawCreate(492.000000, 313.000000, "_"); TextDrawBackgroundColor(nokianum[i], 255); TextDrawFont(nokianum[i], 1); TextDrawLetterSize(nokianum[i], 0.500000, 1.000000); TextDrawColor(nokianum[i], 172133856; TextDrawSetOutline(nokianum[i], 0); TextDrawSetProportional(nokianum[i], 1); TextDrawSetShadow(nokianum[i], 1); } //============================================ // Mobile TextDraw End # //============================================ return 1; } public OnGameModeExit() { return 1; } CMD:nokia(playerid,params[]) { if(nokiaon[playerid] != 1)//Mobile not ON { new String[24],hour,mins,secs; nokiaon[playerid] = 1; nokiastats[playerid] = 1; gettime(hour,mins,secs); format(String,sizeof(String),"%d:%d",hour,mins); TextDrawSetString(nokia[15],String); for(new i = 0;i < 16;i++) { TextDrawShowForPlayer(playerid,nokia[i]); } TextDrawShowForPlayer(playerid,nokiamain[playerid]); TextDrawShowForPlayer(playerid,nokianum[playerid]); SelectTextDraw(playerid, 0x22A5DDC; } else if(nokiaon[playerid] == 1 && Select[playerid] == -1) { Select[playerid] = 1; SelectTextDraw(playerid, 0x22A5DDC; } else if(nokiaon[playerid] == 1 && Select[playerid] != -1) { nokiaon[playerid] = 0; nokiastats[playerid] = 1; for(new i = 0;i < 16;i++) { TextDrawHideForPlayer(playerid,nokia[i]); } TextDrawHideForPlayer(playerid,nokiamain[playerid]); TextDrawHideForPlayer(playerid,nokianum[playerid]); TextDrawSetString(nokianum[playerid],"_"); CancelSelectTextDraw(playerid); } return 1; } public OnPlayerClickTextDraw(playerid, Text:clickedid) { for(new i = 2;i <= 10;i++) { if(clickedid == nokia[i]) { switch(i) { //number response case 2:format(NewNum[playerid],10,"%s1",NewNum[playerid]); case 3:format(NewNum[playerid],10,"%s2",NewNum[playerid]); case 4:format(NewNum[playerid],10,"%s3",NewNum[playerid]); case 5:format(NewNum[playerid],10,"%s5",NewNum[playerid]); case 6:format(NewNum[playerid],10,"%s4",NewNum[playerid]); case 7:format(NewNum[playerid],10,"%s6",NewNum[playerid]); case 8:format(NewNum[playerid],10,"%s8",NewNum[playerid]); case 9:format(NewNum[playerid],10,"%s7",NewNum[playerid]); case 10:format(NewNum[playerid],10,"%s9",NewNum[playerid]); } if(nokiastats[playerid] == 1 && strlen(NewNum[playerid]) < 10) { TextDrawSetString(nokianum[playerid],NewNum[playerid]); PlayerPlaySound(playerid, 21001, 0, 0, 0); break; } } } //Green Button if(clickedid == nokia[13]) { if(nokiastats[playerid] == 1 && !isnull(NewNum[playerid])) { nokiastats[playerid] = 2; TextDrawSetString(nokiamain[playerid],"Calling"); PlayerPlaySound(playerid, 21002, 0, 0, 0); } } if(clickedid == nokia[11]) { if(nokiastats[playerid] == 2 || nokiastats[playerid] == 1 && !isnull(NewNum[playerid])) { nokiastats[playerid] = 1; NewNum[playerid] = ""; TextDrawSetString(nokianum[playerid],"_"); TextDrawSetString(nokiamain[playerid],"_"); PlayerPlaySound(playerid, 21002, 0, 0, 0); } } //Off button if(clickedid == nokia[14]) { Select[playerid] = -1; CancelSelectTextDraw(playerid); } return 0; } |
(Sorry, i live in viet nam so I'm not fluent in English)