Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Selección de skin por Zume-Zero
- #include <a_samp>
- // Textdraws
- new Text:FlechaSkin1[MAX_PLAYERS];
- new Text:FlechaSkin2[MAX_PLAYERS];
- new Text:BarraNegra1;
- new Text:BarraNegra2;
- new Text:SkinIDInfo[MAX_PLAYERS];
- // Otras Variables
- new Skin[MAX_PLAYERS];
- new PuedeCambiarSkin[MAX_PLAYERS];
- new SkinAntiguo[MAX_PLAYERS];
- // Posiciones
- new Float:XANTES[MAX_PLAYERS],Float:YANTES[MAX_PLAYERS],Float:ZANTES[MAX_PLAYERS],Float:AANTES[MAX_PLAYERS];
- new InteriorAN[MAX_PLAYERS], VirtualWAN[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- BarraNegra1 = TextDrawCreate(660.000000, -6.000000, "_");
- TextDrawBackgroundColor(BarraNegra1, 255);
- TextDrawFont(BarraNegra1, 1);
- TextDrawLetterSize(BarraNegra1, 0.500000, 12.100004);
- TextDrawColor(BarraNegra1, -1);
- TextDrawSetOutline(BarraNegra1, 0);
- TextDrawSetProportional(BarraNegra1, 1);
- TextDrawSetShadow(BarraNegra1, 1);
- TextDrawUseBox(BarraNegra1, 1);
- TextDrawBoxColor(BarraNegra1, 117);
- TextDrawTextSize(BarraNegra1, -20.000000, 0.000000);
- TextDrawSetSelectable(BarraNegra1, 0);
- BarraNegra2 = TextDrawCreate(660.000000, 350.000000, "_");
- TextDrawBackgroundColor(BarraNegra2, 255);
- TextDrawFont(BarraNegra2, 1);
- TextDrawLetterSize(BarraNegra2, 0.500000, 11.000000);
- TextDrawColor(BarraNegra2, -1);
- TextDrawSetOutline(BarraNegra2, 0);
- TextDrawSetProportional(BarraNegra2, 1);
- TextDrawSetShadow(BarraNegra2, 1);
- TextDrawUseBox(BarraNegra2, 1);
- TextDrawBoxColor(BarraNegra2, 117);
- TextDrawTextSize(BarraNegra2, -20.000000, 0.000000);
- TextDrawSetSelectable(BarraNegra2, 0);
- for(new playerid = 0; playerid < MAX_PLAYERS; playerid++){
- Skin[playerid] = 0;
- CancelSelectTextDraw(playerid);
- FlechaSkin1[playerid] = TextDrawCreate(108.000000, 200.000000, "~<~");
- TextDrawBackgroundColor(FlechaSkin1[playerid], 255);
- TextDrawFont(FlechaSkin1[playerid], 1);
- TextDrawLetterSize(FlechaSkin1[playerid], 1.000000, 3.000000);
- TextDrawColor(FlechaSkin1[playerid], -1);
- TextDrawSetOutline(FlechaSkin1[playerid], 0);
- TextDrawSetProportional(FlechaSkin1[playerid], 1);
- TextDrawSetShadow(FlechaSkin1[playerid], 1);
- TextDrawSetSelectable(FlechaSkin1[playerid], 1);
- FlechaSkin2[playerid] = TextDrawCreate(502.000000, 190.000000, "~>~");
- TextDrawBackgroundColor(FlechaSkin2[playerid], 255);
- TextDrawFont(FlechaSkin2[playerid], 1);
- TextDrawLetterSize(FlechaSkin2[playerid], 1.000000, 3.000000);
- TextDrawColor(FlechaSkin2[playerid], -1);
- TextDrawSetOutline(FlechaSkin2[playerid], 0);
- TextDrawSetProportional(FlechaSkin2[playerid], 1);
- TextDrawSetShadow(FlechaSkin2[playerid], 1);
- TextDrawSetSelectable(FlechaSkin2[playerid], 1);
- SkinIDInfo[playerid] = TextDrawCreate(468.000000, 389.000000, "SKIN ID: 51");
- TextDrawBackgroundColor(SkinIDInfo[playerid], 255);
- TextDrawFont(SkinIDInfo[playerid], 3);
- TextDrawLetterSize(SkinIDInfo[playerid], 0.600000, 2.199999);
- TextDrawColor(SkinIDInfo[playerid], -1);
- TextDrawSetOutline(SkinIDInfo[playerid], 0);
- TextDrawSetProportional(SkinIDInfo[playerid], 1);
- TextDrawSetShadow(SkinIDInfo[playerid], 1);
- TextDrawSetSelectable(SkinIDInfo[playerid], 0);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Skin[playerid] = 0;
- PuedeCambiarSkin[playerid] = 0;
- SkinAntiguo[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Skin[playerid] = 0;
- PuedeCambiarSkin[playerid] = 0;
- SkinAntiguo[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/skin", cmdtext, true, 10) == 0)
- {
- new string[190];
- GetPlayerPos(playerid,XANTES[playerid],YANTES[playerid],ZANTES[playerid]);
- GetPlayerFacingAngle(playerid,AANTES[playerid]);
- VirtualWAN[playerid] = GetPlayerVirtualWorld(playerid);
- InteriorAN[playerid] = GetPlayerInterior(playerid);
- SetPlayerVirtualWorld(playerid, playerid+7341);
- SetPlayerCameraPos(playerid, 207.1526, -39.3834, 1002.8735);
- SetPlayerCameraLookAt(playerid, 207.5223, -38.4558, 1002.6689);
- SetPlayerPos(playerid,209.20, -34.24, 1001.93);
- SetPlayerFacingAngle(playerid, 180.0);
- SetPlayerInterior(playerid,1);
- Skin[playerid] = 1;
- PuedeCambiarSkin[playerid] = 1;
- SkinAntiguo[playerid] = GetPlayerSkin(playerid);
- TextDrawShowForPlayer(playerid, FlechaSkin1[playerid]);
- TextDrawShowForPlayer(playerid, FlechaSkin2[playerid]);
- TextDrawShowForPlayer(playerid, BarraNegra1);
- TextDrawShowForPlayer(playerid, BarraNegra2);
- TextDrawShowForPlayer(playerid, SkinIDInfo[playerid]);
- format(string, sizeof(string), "SKIN ID: %d", Skin[playerid]);
- TextDrawSetString(SkinIDInfo[playerid], string);
- SelectTextDraw(playerid, 0xE60005FF);
- for(new i = 0; i < 10; i++){SendClientMessage(playerid, -1, "");}
- SendClientMessage(playerid, -1,"{FFFF00}* TIP: {FFFFFF}Escribe {FFFF00}'/noquieroskin' {FFFFFF}para salir del catalogo de skins y no seleccionar el que tenías.");
- SendClientMessage(playerid, -1,"{FFFF00}* TIP: {FFFFFF}Escribe {FFFF00}'/quieroskin' {FFFFFF}para elegir el skin que tengas visto.");
- SendClientMessage(playerid, -1,"{FFFF00}* TIP: {FFFFFF}Presiona las flechas de {FFFF00}izquierda/derecha {FFFFFF}para mirar otros skins.");
- return 1;
- }
- if (strcmp("/quieroskin", cmdtext, true, 10) == 0)
- {
- if(PuedeCambiarSkin[playerid] == 1)
- {
- SetPlayerPos(playerid,XANTES[playerid],YANTES[playerid],ZANTES[playerid]);
- SetPlayerFacingAngle(playerid, AANTES[playerid]);
- SetPlayerInterior(playerid,InteriorAN[playerid]);
- SetPlayerVirtualWorld(playerid,VirtualWAN[playerid]);
- SetCameraBehindPlayer(playerid);
- TextDrawHideForPlayer(playerid, FlechaSkin1[playerid]);
- TextDrawHideForPlayer(playerid, FlechaSkin2[playerid]);
- TextDrawHideForPlayer(playerid, BarraNegra1);
- TextDrawHideForPlayer(playerid, BarraNegra2);
- TextDrawHideForPlayer(playerid, SkinIDInfo[playerid]);
- CancelSelectTextDraw(playerid);
- CancelSelectTextDraw(playerid);
- SetPlayerSkin(playerid, Skin[playerid]);
- Skin[playerid] = 0;
- PuedeCambiarSkin[playerid] = 0;
- SkinAntiguo[playerid] = 0;
- SendClientMessage(playerid, -1, "{FFFF00}* ¡Felicidades!: {FFFFFF}Ahora tienes un nuevo skin puesto.");
- return 1;
- }
- }
- if (strcmp("/noquieroskin", cmdtext, true, 10) == 0)
- {
- if(PuedeCambiarSkin[playerid] == 1)
- {
- SetPlayerPos(playerid,XANTES[playerid],YANTES[playerid],ZANTES[playerid]);
- SetPlayerFacingAngle(playerid, AANTES[playerid]);
- SetPlayerInterior(playerid,InteriorAN[playerid]);
- SetPlayerVirtualWorld(playerid,VirtualWAN[playerid]);
- SetCameraBehindPlayer(playerid);
- TextDrawHideForPlayer(playerid, FlechaSkin1[playerid]);
- TextDrawHideForPlayer(playerid, FlechaSkin2[playerid]);
- TextDrawHideForPlayer(playerid, BarraNegra1);
- TextDrawHideForPlayer(playerid, BarraNegra2);
- TextDrawHideForPlayer(playerid, SkinIDInfo[playerid]);
- CancelSelectTextDraw(playerid);
- CancelSelectTextDraw(playerid);
- SetPlayerSkin(playerid,SkinAntiguo[playerid]);
- Skin[playerid] = 0;
- PuedeCambiarSkin[playerid] = 0;
- SkinAntiguo[playerid] = 0;
- SendClientMessage(playerid, -1, "{FFFF00}* Información: {FFFFFF}No cambiaste el skin y vuelves a tener el que antes tenías.");
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid){
- new string[120];
- if(clickedid == FlechaSkin1[playerid]){
- if(Skin[playerid] < 0){
- Skin[playerid] = 1;
- SendClientMessage(playerid, -1, "{FF0000}* Error: {FFFFFF}No puedes ir más atrás, no existen más, vuelve con la otra flecha");
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- }
- Skin[playerid] --;
- SetPlayerSkin(playerid, Skin[playerid]);
- format(string, sizeof(string), "SKIN ID: %d", Skin[playerid]);
- TextDrawSetString(SkinIDInfo[playerid], string);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- }
- else if(clickedid == FlechaSkin2[playerid]){
- if(Skin[playerid] > 299){
- Skin[playerid] = 298;
- SendClientMessage(playerid, -1, "{FF0000}* Error: {FFFFFF}No puedes ir más adelante, no existen más, vuelve con la otra flecha");
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- }
- Skin[playerid] ++;
- SetPlayerSkin(playerid, Skin[playerid]);
- format(string, sizeof(string), "SKIN ID: %d", Skin[playerid]);
- TextDrawSetString(SkinIDInfo[playerid], string);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- }
- return 1;
- }
- // Selección de skin por Zume-Zero
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement