#include < a_samp >#include < sscanf2 >#include < zcmd >#define COLOR_GREEN 0x00FF00AA#define COLOR_RED 0xFF0000AACMD:skin( playerid, params[ ] ) {new skinID;if( sscanf( params, \"i\", skinID ) ) { SendClientMessage( playerid, COLOR_RED, \"Használat: /skin < SkinID >\" );} else if( !IsValidSkin( skinID ) ) { SendClientMessage( playerid, COLOR_RED, \"Érvénytelen azonosító!\" );} else { new stringFormat[ 38 ]; SetPlayerSkin( playerid, skinID ); format( stringFormat, sizeof stringFormat, \"A skined sikeresen átállítva![ %i ]\", skinID ); SendClientMessage( playerid, COLOR_GREEN, stringFormat );}return 1;}CMD:s( playerid, params[ ] ) {return cmd_skin( playerid, params );}IsValidSkin(skinid) //By Simon{ #define MAX_BAD_SKINS 22 new badSkins[MAX_BAD_SKINS] = { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 265, 266, 267, 268, 269, 270, 271, 272, 273, 289 }; if (skinid < 0 || skinid > 299) return false; for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skinid == badSkins) return false; } #undef MAX_BAD_SKINS return 1;}
Nem teszteltem. #include < a_samp >#include < sscanf2 >#include < zcmd >#define COLOR_GREEN 0x00FF00AA#define COLOR_RED 0xFF0000AACMD:skin( playerid, params[ ] ) {new skinID;if( sscanf( params, \"i\", skinID ) ) { SendClientMessage( playerid, COLOR_RED, \"Használat: /skin < SkinID >\" );} else if( !IsValidSkin( skinID ) ) { SendClientMessage( playerid, COLOR_RED, \"Érvénytelen azonosító!\" );} else { new stringFormat[ 38 ]; SetPlayerSkin( playerid, skinID ); format( stringFormat, sizeof stringFormat, \"A skined sikeresen átállítva![ %i ]\", skinID ); SendClientMessage( playerid, COLOR_GREEN, stringFormat );}return 1;}CMD:s( playerid, params[ ] ) {return cmd_skin( playerid, params );}IsValidSkin(skinid) //By Simon{ #define MAX_BAD_SKINS 22 new badSkins[MAX_BAD_SKINS] = { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 265, 266, 267, 268, 269, 270, 271, 272, 273, 289 }; if (skinid < 0 || skinid > 299) return false; for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skinid == badSkins) return false; } #undef MAX_BAD_SKINS return 1;}