29.12.2010, 17:56
Tengo un problema con el comando /skin. Cuando se lo coloco funciona correctamente, pero cuando reinicia, lleva el skin de la persona que se lo puso.
PD: es un GM que funciona por MySQL.
PD: es un GM que funciona por MySQL.
Код:
if(strcmp(cmd, "/skin", true) == 0) { new skin; cmd = strtok(cmdtext, idx); if(!strlen(cmd)) { SendClientMessage(playerid,COLOR_RED,"Usa: /skin [ID] [ID del Skin]"); return 1; } giveplayerid = strval(cmd); cmd = strtok(cmdtext, idx); if(!strlen(cmd)) { SendClientMessage(playerid,COLOR_RED,"Usa: /skin [ID] [ID del Skin]"); return 1; } skin = strval(cmd); if(IsPlayerConnected(giveplayerid)) { if(InfoJugador[playerid][pAdmin] > 1) { if (skin == 0) { GetPlayerName(giveplayerid,giveplayer, sizeof(giveplayer)); GetPlayerName(playerid,sendername, sizeof(sendername)); InfoJugador[giveplayerid][pModel] = skin; InfoJugador[giveplayerid][pChar] = skin; SetPlayerSkin(giveplayerid,0); format(string,sizeof(string),"* Has vestido a %s con el skin %d!",giveplayer,skin); SendClientMessage(playerid,COLOR_RED,string); format(string, sizeof(string), "AdminCmd: %s Te ha puesto el skin %d",sendername,skin); SendClientMessage(giveplayerid,COLOR_RED,string); return 1; } #define MAX_BAD_SKINS 22 new badSkins[MAX_BAD_SKINS] = { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289 }; if (skin < 0 || skin > 299) return SendClientMessage(playerid, COLOR_GREEN, "* id de skin invalida"); for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skin == badSkins[i]) return SendClientMessage(playerid, COLOR_GREEN, "* id de skin invalida"); } #undef MAX_BAD_SKINS GetPlayerName(giveplayerid,giveplayer, sizeof(giveplayer)); GetPlayerName(playerid,sendername, sizeof(sendername)); SetPlayerSkin(giveplayerid,skin); format(string,sizeof(string),"* Has vestido a %s con el skin %d!",giveplayer,skin); SendClientMessage(playerid,COLOR_RED,string); format(string, sizeof(string), "%s Te ha puesto el skin %d",sendername,skin); SendClientMessage(giveplayerid,COLOR_RED,string); } else { SendClientMessage(playerid, COLOR_GRAD1, " No puedes usar ese comando!"); } } return 1; }